From nobody Tue Dec 2 00:25:40 2025 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (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 5B77C3164CE for ; Tue, 25 Nov 2025 11:27:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764070024; cv=none; b=FH4uHKV8X/CgHna687jVOjDQjLUtabpa0a0J6hii0ygjEQipqaKRxdT8rnyNSgimefpGHPEmCNd++ccD9yBjjkFCZ6a69bvEK4F/9mvKSJZ+7VkQpBLbGlC24uhAdI6T56U4fbpDY7hyOMUPU6wLVCl0Qr334e+jZpKhlGtmT+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764070024; c=relaxed/simple; bh=0ObsQzJ1S8aelaCoYcrZLP2G/ftVmS6hZ0U7EyZsDXg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QoSgyLrTyRZjD1DCPZhSOcbWtRIYcnetBvjr7Ky3QXx9JdESigV2mnZhIJSu9+R1qJ/cCEXPk3EP/b+cvV+k0v1p6quj7jxXNvUnp8suo7mmxdO6bGsEPnlB71wJeiDmpLpz2BdzmDr/RytIF8YrDVHUaiYxkxLKhloFPTTM2Kg= 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=Ozy0T/E3; arc=none smtp.client-ip=209.85.167.46 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="Ozy0T/E3" Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-5957c929a5eso7112531e87.1 for ; Tue, 25 Nov 2025 03:27:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764070020; x=1764674820; 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=AN6dvpy0YMflZKUplqB9lPyC8X+L5QXrs3PpGRd9+i4=; b=Ozy0T/E3L9xE8Tc4aGvNiOgyu3oECFsqVHGctY3/t9a6VRxNGp1fWHgpURig6BfC30 oGrVb3IO0+QTOYxcHR4mU3m3Tf1oTFJ/Soghw7ZR87tnKLKC9tuc3NbvHaR6BsZJAEGh +9whh5RJ/bZXQ3XRIwVeP03z0jND22M3NKHuXqcnninPN+L11ILj4DbasSJ+19+WITrI cw6LFn7WtGXNku2cwBSrHHWMKgR9/T9Rmni+mUV7H57w3lPhPY5571cfM18jvYw58/4Y 9aaxtAhyVrnkyNcvXkmS3qxOk10UUTecHSjLuD5SBwQOlsbul1NCoeitMG6YR/8i4gBT KBtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764070020; x=1764674820; 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=AN6dvpy0YMflZKUplqB9lPyC8X+L5QXrs3PpGRd9+i4=; b=wtkSpofByJZlqBfJqsMLauGQtoUHs9kj9Yl6rEkRpRFuLJr4jFh//v0uf6xVG5gmwX 8Es9b/y1UaPq9wYtdxSIzQgxEy1G+/gPxd/F1KMM+Y1cXO+JMsCZVRCCFsPybRSHodmu 1nAyKl8wbXbgGckqO5Ql/8mRoecxgq1Hr6cVajjAroLXVffLsUlKWoDq9AXZZ3A4+4Pt 91HbabMFZuijwsd/i0e3ldLzzCCo3cuw80xkAchtPL1csDTCZIHKXleO1wr1LxDZenEs 8x4VC4BgzYoklDFUnFUoZQ18mepR6+TPE0NuJpHfeaHKVImzB+yiKUjJzypIfcVTpzqj obyg== X-Forwarded-Encrypted: i=1; AJvYcCU8oTeRo4ShXCBhzovXQouP6KSXcde8CY2MvmB0nN/svSr7AYZow3XaWbHapXqM11QKxUyvjlDeJgs0kzs=@vger.kernel.org X-Gm-Message-State: AOJu0Yytu8r56Vu3DrNWRPOCS363V2qDbwqEW2tp29j2z8eVSMFRr539 Fm5JK3xC73MmRwUGpB8oBFzonB0srD0Ry7IocP8z8dFJRCpFMFWJSITzgtmdjTjhSPc= X-Gm-Gg: ASbGncsMfAmIeiP08aiZXlDCkH+88OoN5s/PiQur101sTmHzlZ/LQ0J7+ZStONQl3Wl 5zP/woIXvOLES7nqNKQQhSLIr8G3+MQwhGg3Ud0ZdyMo3H+DrDUvDYb2SUvheX6qjxjvKyQUoOz 0n4m356noeBdmNe6eDfkw5NXMeEEMNymZT/Rzlia0ZfHQJ3vDVqA8oyhcLEj3guAjQQXb12s+hM 4Ev6bdDRVisCY+UXF1sO3TnP1ABhUShNe+wo/lQSoqsxPN/3UiZ10H5UL0QvIscFYdD5i0q68Jj MWEGwLnSptM2DiKX5rpq09rusViK63SYQLE2HqZQgHJXBfO0idrBIy6WdI1RH7lA4q2VzU6uJ2n f0mT4v+YE/kxq8JO/JYh4pQhHbaucKxbIHGLeyeDEJ7mrIoFKlG922CuBc6FL1pL72bAs4jQTy8 3ydK3Hvcy+R/+GP0Sf9g668s5h3eBr1PsejhaRC8t+mT7iotSr3yV6qwOof7du X-Google-Smtp-Source: AGHT+IGxFbAVgLhFkE94TlbZzTA30uW9uPeS6eJKhZuh9qvjSZm3x7Z35cTuGkrMp5RHYfZTfiLMSA== X-Received: by 2002:a05:6512:3a82:b0:594:27dd:2701 with SMTP id 2adb3069b0e04-596b529d662mr891695e87.49.1764070020428; Tue, 25 Nov 2025 03:27:00 -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.26.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Nov 2025 03:26:58 -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 3/6] pmdomain: Respect the CPU system wakeup QoS limit for cpuidle Date: Tue, 25 Nov 2025 12:26:44 +0100 Message-ID: <20251125112650.329269-4-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 genpd governor for CPUs to take the constraint into account when it selects a domain idle state for the corresponding PM domain. 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/pmdomain/governor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/pmdomain/governor.c b/drivers/pmdomain/governor.c index bd1b9d66d4a5..05e68680f34b 100644 --- a/drivers/pmdomain/governor.c +++ b/drivers/pmdomain/governor.c @@ -351,7 +351,7 @@ static bool cpu_power_down_ok(struct dev_pm_domain *pd) ktime_t domain_wakeup, next_hrtimer; ktime_t now =3D ktime_get(); struct device *cpu_dev; - s64 cpu_constraint, global_constraint; + s64 cpu_constraint, global_constraint, wakeup_constraint; s64 idle_duration_ns; int cpu, i; =20 @@ -362,7 +362,11 @@ static bool cpu_power_down_ok(struct dev_pm_domain *pd) if (!(genpd->flags & GENPD_FLAG_CPU_DOMAIN)) return true; =20 + wakeup_constraint =3D cpu_wakeup_latency_qos_limit(); global_constraint =3D cpu_latency_qos_limit(); + if (global_constraint > wakeup_constraint) + global_constraint =3D wakeup_constraint; + /* * Find the next wakeup for any of the online CPUs within the PM domain * and its subdomains. Note, we only need the genpd->cpus, as it already --=20 2.43.0