From nobody Tue Dec 2 02:03:29 2025 Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (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 84C933446B5 for ; Fri, 21 Nov 2025 10:03:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763719426; cv=none; b=W78HebcoGfd+rG0tQMVEJNsVDQneMTbLXApqHIVs8vwtuBKMwD48DZknq71Y3KmHRGTBIZchvtCRKRJB6jAfSlsoDB2ok/36LisUdZpFdxkyHkhVvIEQT3/Y8FH5yyocUJ57eD4p0CD9HUd6D/9qzFzZSL72kATaSx/4Rk0ljao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763719426; c=relaxed/simple; bh=8POtwl+8gIl6KiVvX3+dIyH9ModDs3FOmNCMp2hDAF0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n21JWzv0DZmAv4yBM4+TjPn2byT8N7Z26TQD6AUEpFR+04FRPZrYTHF2Jz2hD88ZLKo5JeAQIdrC9UHTAHxeJZCB5ugKky9M0L6kA0cgLuRvnsIU1W588bDXM3oSNSIb4E5rxVVuySbK5Wn3Sm5TC9SQNS0bBuSrWFLqExx6mM0= 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=dHa3APnU; arc=none smtp.client-ip=209.85.208.169 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="dHa3APnU" Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-37a3d86b773so16976451fa.0 for ; Fri, 21 Nov 2025 02:03:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1763719421; x=1764324221; 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=wjWIzWz/eyhljtrpfcXseW6nO885XaZnowKeb56K2bo=; b=dHa3APnU6Bt507S1cIhflRL9rGDzEnF32TE195mr1RVk2wC+nw/B7SwOCeMEQ9D7l3 Wyul4mv/t7UpPJ4a/KdhsPc5bei+Aj9g2TPaEPKMA2UW0KxMTS0yxiwaHte5qCbNx4/8 qOdkKnIWoEawEAv6zGWQZEt53Rtk9SXMtqm7Gjv8akRVGpGiAbqczz+mGm3IVZetNkGl FWa8udFaGu9YPUIhSEJERHYrC+bW1AOXkAJgHELfwMURwkuGxIo39S6CeW+nu8TkugjW A2DBXmm4FE6Vb9KMmC6gIIYcLGSRbgRn2kVQijDmQ4kqFaH0sGJFBEFVDPQyRHmyLbXW QjWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763719421; x=1764324221; 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=wjWIzWz/eyhljtrpfcXseW6nO885XaZnowKeb56K2bo=; b=McRfmuHnzhs9oEaRJFBuef71tgxAVk+i1PIWzNbdowlo7Xujxhv1FuaK+DC0Fq6QFF NnmJzpFBrBxAgzS+9JH2gVR1awfZPfkk9kZRDg9gxqy8cPgiEmOhxyvu+eTKcH2pj/pO Z1fMOllWe8gKvRRJMPr73GchgbE3apKzehNcDmlvMA56X3S2cWcfSFON4bRLs/C3DT8N k3gufWlNerxxSzxZtdxvWZvXH4t2fN6mtQD+hTq5HODkU6TMYlwRQybYYU760xwXkuYA w7rI5ZWCyGKBoEd3GJ9aiZ+W89E4A4mv1QeOPxbwF6nQc5ibEl4KvU+yPfdWEnwWCwhn s8Xg== X-Forwarded-Encrypted: i=1; AJvYcCUy3wfxoJil7upSmunZGSyC0UohqLWR9tfYSNASN4nxOCTrpmxae3ESsbC56YKyCRRygiDzxCCSZBpSubM=@vger.kernel.org X-Gm-Message-State: AOJu0YzLrxhfXb6lFB6YgTplzJTUyF7drFOPpsPRLeF/ZuobmthvmGnd jxWm7Ca2HYzzid4ky+b78dXbokhOKAwoyjDlbNJGeBzW0Yqjb76V7SLRntsr3RoICGQ= X-Gm-Gg: ASbGncsqLdUyp158s+UGqDhCMLk0uWUgUC7V0AwjM/s+gRM8YwHb/eor5txO+euzqYL sCPQtqAHproTgBGGrW4713NAcFrjkzgwKENVNHyZffc9whl53r7aR4TFjw00uBkD3u+hzyG8agx SImn0ELL3lJMGRu0JnMCVAr7EKnYOu+OoGuOJ5D0MZRgm8m/m/dC75Mrqk2k8CyG8HWkuNq+pj1 Y5Y7wPcF7rsBXLHH49MfWJ0ao3lCnWrrY12soeofD5es8XCMM4434GQphNMZ+9dzseVhEBgWV+e eKHCZnnFoiptOIbQDdPhaPOEpFwMjetBlj7mqqH1MbZOcOH+JlFJ6hP8yLVschHEc/W2BzR/NHu r3j7Scb6zh1+2iAPTt7mpT9gt6JvtHNRFAQO3nBILvAfQjdwbS84duVqBmJ/0ybkJp4z/8A4Ygc l4KcTKvJ4S59J1ONAHosDJjsmNjPoz81BReDDgwSf90wwSDvHigfU5Df6dmUEy X-Google-Smtp-Source: AGHT+IFSL0xhKngQoCd6w7yuR7+wVAiUcarsUMEIQV5fjj4GKrmC8uuyieReZfwwK4nQsRjrwIWOlg== X-Received: by 2002:a2e:92cc:0:b0:37b:9d7e:2295 with SMTP id 38308e7fff4ca-37cd92e3665mr3603501fa.41.1763719421288; Fri, 21 Nov 2025 02:03:41 -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 38308e7fff4ca-37cc6b597b2sm11056181fa.12.2025.11.21.02.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 02:03:40 -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 v3 3/6] pmdomain: Respect the CPU system wakeup QoS limit for cpuidle Date: Fri, 21 Nov 2025 11:03:09 +0100 Message-ID: <20251121100315.316300-4-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251121100315.316300-1-ulf.hansson@linaro.org> References: <20251121100315.316300-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. Signed-off-by: Ulf Hansson Reviewed-by: Dhruva Gole --- 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