From nobody Tue Dec 2 00:25:36 2025 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D035231987D for ; Tue, 25 Nov 2025 11:27:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764070031; cv=none; b=MDbGU+96toX8t32OpEpFquDCbMpZ4Avjl6/xAETtPTPg6qXj3WWwkbwbNm+JSMg6kQrPBdcUBFkL/4LJnoM6toOLAVGoZ9WiCO6B1IA+Zfm3tSrNt4wP0xshxKRJqyE47Ao82t+VksQ5rgNQHvZKQBUrs2JOO0GfUr8V/jDqwbQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764070031; c=relaxed/simple; bh=VU9S2gTiBfBqPpLuX8g7itKZUK/ev7QCKE78FGsGaTY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Bz0+Wz2lMeEwrXff0vQeuPdUK07SIDbkX8fJ12BV1swBTiE9sAkoPO0ZwnEjKi0Awrz8Gr6CH0hwO265wA1m6MDUKjan/L8Yr0b443kyqExQT0sIvhaXjJuUX9fnounAE88p1x2YzNUg3L9TIujdMQFrDOq9Ej8PEeT0nLjtzT8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Ux8eod0u; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ux8eod0u" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-5959105629bso5188144e87.2 for ; Tue, 25 Nov 2025 03:27:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764070026; x=1764674826; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MXSNim2QNAEfMWA0bqcIei0hGjp8YF0YF97p3EaO60o=; b=Ux8eod0u+Fy8rtcdbn8XIk9YEHpLbVTxHkQxPwGD5Rp0W5PTMR1qbtlLVB+pXojzMu nzIf1HKsrgtE3VL9gtS4fcmxZBj3H8iEdD6LcV4WyfBwSGFVtoQO1ndMQGGCstlzzcdG Tk0Sk8KvSEH5G5iVojvQo9jsRUqWDZXdlx439MWqV4jt+WDOtG2AXVwWVLzomYErJjKp UYe0ynJ7a9AWuwgCBk37jSNba7fNoj4f6nhxW9M//j+U2ofyifmSNOUfMKd0a91QvmFR 1hajsQpHZ1FiQduR2+tB44LtKxDRm4bQqp3EFC+BhjeYAcI3slAX3Cmvxii+e2mxAz3x Ktmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764070026; x=1764674826; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=MXSNim2QNAEfMWA0bqcIei0hGjp8YF0YF97p3EaO60o=; b=bs4l9ilNGoYPCs0EWIhj9XWFblbUQ3GudYw93B2i+441BC9uoM+OPZWHmWIsuJtGA4 gHo+H34jX2h45ocv3lamBrYmfHym094+cSLcuC1tZ0nCuXFsmiCN6T22ABro/NCf5XYO xFpYn7vZwFK9dGECPfV8HrtfHdiVeGnMKf1BfjwhSgMKiB63h0UV/VbPGJNJ7/pzQwjG WSi/fe7sF/BUb1/MSL5hb9GrpJTn1l/GvNghlGCXM1qvhyWJN7Z58Fh1MaZ2JccmWr8r tU7ARNC2/CsbjfbGkMvQF8P4UQpcAZzID5Nr8a2JdymTu1Srf8pd5pqzrEo26cGHhyoQ yT3g== X-Forwarded-Encrypted: i=1; AJvYcCXaIFlGGh8ni8XGuvoK2/8wl1eLvZFiff5yH1Yz2ypuNVptvMsIqTvKUoytkITPj3ynesojh8+Bfjp7aBY=@vger.kernel.org X-Gm-Message-State: AOJu0YwP2y2aehPQJN743c7cF9ORAVwueZ9ZACrP/o0B9W/bYKi0WLCU n5AZCZYehUUHCA+PnCm83NwfZDYNEM8/6oGvgGlV/CWa86FT2CwQMjujfuXIj9fe7a8= X-Gm-Gg: ASbGnctQbEfDZiiACDhWD96/PDL2YW9Cri9HgwecDNvF2wATOXE2C64suKpzU6OFSsT c3WLKULNzpVzVsySOdVojZVIHTkmcDxmJMhF2My9AIWT+2sN5E7caIXrE6fbEaD0KChQ1Qq1zcV YmN4G3mmQ/dsE+VH2Xq67mR+x72oQ/xGutI6dsTP57YaMghlzotWsh7C2phk/HKzFj/YYqsDkyk Bqsw5cON++gnREgRz5kgl+6n6GqmlkZodgjo+1ZwNFRh5DUKlyKet/CAJOwtYiWyD4kNaT2OYn5 cPjJCnziO2lMEBzT84aK3RTTXiu11r7Us2AiIggFwVA2X8uVYmwZTGJtAtEJ/mCY/vZT4hiMo0Q iV9+ICNlhUOJ2XAWjDN5l/QQX/5F/1fbSbQKgWtcFBk4OFwhzRIPUrVfVoYs5b1jEk1YKj46AIr n+3axFhWHfJ+YazOcmyBpA5tLVnJq0XZEBHiWwMNgzveMHgA898T1T67LGmsHs X-Google-Smtp-Source: AGHT+IH0spmvYE7vsLYvU6CWBQu+9dSmSus9W4Lq8aSvY9tGf9JRWtAh5DwE7Z4KHFl6BrOxsXpyVw== X-Received: by 2002:a05:6512:b0f:b0:594:2b58:ab83 with SMTP id 2adb3069b0e04-596b528d61amr1089814e87.40.1764070025793; Tue, 25 Nov 2025 03:27:05 -0800 (PST) Received: from uffe-tuxpro14.. (h-178-174-189-39.A498.priv.bahnhof.se. [178.174.189.39]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5969db7563fsm4993526e87.2.2025.11.25.03.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Nov 2025 03:27:04 -0800 (PST) From: Ulf Hansson To: "Rafael J . Wysocki" , linux-pm@vger.kernel.org Cc: Vincent Guittot , Peter Zijlstra , Kevin Hilman , Pavel Machek , Len Brown , Daniel Lezcano , Maulik Shah , Prasad Sodagudi , Dhruva Gole , Deepti Jaggi , Ulf Hansson , linux-kernel@vger.kernel.org Subject: [PATCH v4 5/6] cpuidle: Respect the CPU system wakeup QoS limit for cpuidle Date: Tue, 25 Nov 2025 12:26:46 +0100 Message-ID: <20251125112650.329269-6-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251125112650.329269-1-ulf.hansson@linaro.org> References: <20251125112650.329269-1-ulf.hansson@linaro.org> 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 Content-Type: text/plain; charset="utf-8" The CPU system wakeup QoS limit must be respected for the regular cpuidle state selection. Therefore, let's extend the common governor helper cpuidle_governor_latency_req(), to take the constraint into account. Reviewed-by: Dhruva Gole Reviewed-by: Kevin Hilman (TI) Tested-by: Kevin Hilman (TI) Signed-off-by: Ulf Hansson --- Changes in v4: - Added tags. Changes in v3: - New patch. --- drivers/cpuidle/governor.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/cpuidle/governor.c b/drivers/cpuidle/governor.c index 0d0f9751ff8f..5d0e7f78c6c5 100644 --- a/drivers/cpuidle/governor.c +++ b/drivers/cpuidle/governor.c @@ -111,6 +111,10 @@ s64 cpuidle_governor_latency_req(unsigned int cpu) struct device *device =3D get_cpu_device(cpu); int device_req =3D dev_pm_qos_raw_resume_latency(device); int global_req =3D cpu_latency_qos_limit(); + int global_wake_req =3D cpu_wakeup_latency_qos_limit(); + + if (global_req > global_wake_req) + global_req =3D global_wake_req; =20 if (device_req > global_req) device_req =3D global_req; --=20 2.43.0