From nobody Tue Dec 2 01:51:38 2025 Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F514217722 for ; Fri, 21 Nov 2025 01:08:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763687322; cv=none; b=gPTzxbwC6JAGccGHM/DJK3jILCWg0DpzN4Whs7LX9eO6CeRaZYICDujLMqQ1uElW0QXD3bQp9dVHWuKHR6xDo/JSRYdgMQYfKDGWQjYyQFCTK8Bv3LYPXAiZyE6iEkhSropGngRtTWPKgcWumKLf2T9bWlad2hFuD2iRhzgznO8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763687322; c=relaxed/simple; bh=M/c2EXnK5JDRsjyRnYsqBIEMPL8YziewH0mBQGmD2pM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ECaGU+yQuuMWBMyyNWl2QIufiTcA3PnxIeGi/xA8MYW49Q16M3hUFZu+odM0qF11vkXWC50N+/FWsimeaoi6Zpjgg6sZZ1D3+ONKHuH+2JZZq683q3M1AhUdMc8g06YgxjJI7FgVW+GZGmRKg1C+gI+tomFbMcy7e+IoUTgHtEg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=packett.cool; spf=pass smtp.mailfrom=packett.cool; dkim=pass (2048-bit key) header.d=packett.cool header.i=@packett.cool header.b=hr1YTfTG; arc=none smtp.client-ip=91.218.175.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=packett.cool Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=packett.cool Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=packett.cool header.i=@packett.cool header.b="hr1YTfTG" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=packett.cool; s=key1; t=1763687318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=z0lB3o3SwbOYKkV5Q0JuzwgjnjNnSnFiQ4AX0Mcpicc=; b=hr1YTfTGgd3PUDkIDH8vn+xaYQpiQITjQ3PP0CMHGeD8WcxNAvTZrwlOMVZrQhzR4Uxv90 gGgxueXVuH+AaZpaDdFgwVyiGuC0a2Lndd0SgjdVFVkc7u2sQiXYAse8bePoDwLcusu8kf 5OAoB0LOJOlNr6V7k2ztBBiQ15XZnMc0pJNOQBHKLXzkAtK6aTm4QI6mh12j2EmJxiSXUj l4OUqwpovtt1127jPykIjltcD2WfJNpTWlEue++3PxNUDRjh3+OIOS48xlHLt2ZqfND+1v lXNQJ/gYNQyEvlwJvVcKfgVoS/LEdfO/nnhTcCeDNFyfh4+/StvL7uttO6SI4w== From: Val Packett To: "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Artem Bityutskiy Cc: Val Packett , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, "Rafael J. Wysocki" , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] cpuidle: warn and fixup on sanity check instead of rejecting the driver Date: Thu, 20 Nov 2025 22:06:25 -0300 Message-ID: <20251121010756.6687-1-val@packett.cool> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" On Device Tree platforms, the latency and target residency values come directly from device trees, which are numerous and weren't all written with cpuidle invariants in mind. For example, qcom/hamoa.dtsi currently trips this check: exit latency 680000 > residency 600000. Instead of harshly rejecting the entire cpuidle driver with a mysterious error message, print a warning and set the target residency value to be equal to the exit latency. Fixes: 76934e495cdc ("cpuidle: Add sanity check for exit latency and target= residency") Signed-off-by: Val Packett --- drivers/cpuidle/driver.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c index 1c295a93d582..06aeb59c1017 100644 --- a/drivers/cpuidle/driver.c +++ b/drivers/cpuidle/driver.c @@ -199,8 +199,11 @@ static int __cpuidle_driver_init(struct cpuidle_driver= *drv) * exceed its target residency which is assumed in cpuidle in * multiple places. */ - if (s->exit_latency_ns > s->target_residency_ns) - return -EINVAL; + if (s->exit_latency_ns > s->target_residency_ns) { + pr_warn("cpuidle: state %d: exit latency %lld > residency %lld (fixing)= \n", + i, s->exit_latency_ns, s->target_residency_ns); + s->target_residency_ns =3D s->exit_latency_ns; + } } =20 return 0; --=20 2.51.0