From nobody Mon Feb 9 17:23:15 2026 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 5C2DC362136 for ; Mon, 19 Jan 2026 14:31:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768833094; cv=none; b=sU9usr7bYm6n+N0rByATYSGVE+YmZQnIyHMWqYG26gF65AmD4gbQm6vjGJJE9v9FXyJTRe4YtsI24pNWrhQBTk2IQeWhzMdknX8/Byq2CHrMHSrFLKDMmAUAIwukxGFV2CiT12vWZINMJKk2egNJBXVFxTEEPr0nciX8vBsVuJc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768833094; c=relaxed/simple; bh=9+QkNdO5VQ2yPX0vM4RE6f2/Gi4gkhAf8OoCEvuCYjg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QVD/T8ldd+ZoJFMOo8c0ZwumeykPrv/Wtn2RAkZCGibauUdngKrgDBSmmstuRW1pTHeAgQj9Qw9fYKYPT/z025UjmH7okeseIACA7MTm1r84c2zKYqD143TAsdKESzpAEt7c1vBIQ6GFuCjA5qzx/oGAYTvy+7X8e/fXrj6fTUY= 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=Bs/DKRdb; arc=none smtp.client-ip=209.85.167.52 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="Bs/DKRdb" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-59b30275e69so5473497e87.1 for ; Mon, 19 Jan 2026 06:31:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1768833090; x=1769437890; 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=64A4cniu7Nu112V7CHRL//FijlPeEL9Dny3BjkKYjlY=; b=Bs/DKRdbQUuEmQcwfrCaVcs4LS3vObov/7EJR0XQhrgj2lNtOzCkkM3lip8ycaMvdT /eMnepArYxb7PrjSYO1iv6vdVW70wEOMcVyFmWPcxSQPF3n0e14eIh+IwqcDaA9Ihqkt QXIKlIjZbcZexAcgBFdfW2zZ9Tcr1nuF5FM3tJPp+Np9AC40X1gUOihnXZA914QyfA48 WaJdQmKE74kKRhfWMH4ibOEj9aZ6yDQqyTz8SYUyRjLpnp6cr+qPtBa3R7MwleAx9YVP LqeSi+al0VssouWBDLDj8hoXS2X/UwTgOkBWz4RtKPO8F7VfFV/AKt5xnqPRE4eEU2Nu aUvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768833090; x=1769437890; 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=64A4cniu7Nu112V7CHRL//FijlPeEL9Dny3BjkKYjlY=; b=Dy01fLdJLmZhtW0DrpDg22cPWL4C66+wBmG5z6fsDFv40NVH8x/Q+shnJHbBwXcSjn EtIYaefGaRUVfGDBbOKdcxksXr2gNo+B9Ohs564f+kath+ad7WkFm1r7KthfN3kuvBW2 et6ZFdNp+hSJcJGyIu7JPDn7tDLestAduyZdKizH27z4SPb6icbs4okMtnn62rfFvjiu AwtnvmHUaLAHluH2bZclAFAhoddJL5QlBKpji4yH2fIUrdauZ3Jf9i2BuKP8zZIxmaHY 9GPjkwUpbOQBlfGvstnz4Y4G+C4MWxLQcDRxXXb/24Xr4uE5Rh3Ox22+vWhIqmt0F+N0 jLUA== X-Forwarded-Encrypted: i=1; AJvYcCUfrH73UzI37sRh8tRfsZzXhtG8JzuSfgxEpGHbUWSGKrOrV6Z13kFU4MAdrcmlZ3XyJZgCDoQ4LS2AMn0=@vger.kernel.org X-Gm-Message-State: AOJu0YwN02t5yf2/daQPmp1eH3l4O5Ic0jjqLhT8d/0Ew7UxZBdhjcbo F7bd2rnLkYgmEjxpGTqAfrNzIS7ur3oEyHd7lv1DDDLuRNhUKi9dZjXNF5A3eFgxU4U= X-Gm-Gg: AY/fxX59SQEVticYILwCYgtn5OkP5ibTR21pN5m9df4gc9NutfvZdWd2kvcLbMY0L+d onH3EaM55cNQnJ2N5mT6HjdQWDnT3m90tms/rtd8xrmaQ5JMLgeerB54nAndrJrb3ZP2s4t/NwI +w0m/E89NkN2P19+Oa6fgGNZ74jyD6HiHfGVp3tK2hhg/R7HQ+Z2+NlYFLZIHGbJe1v4YRqCO3u 3cx4VuBYkvTGAKJBawYKPKgcV2bTQFYdtZr5zCuhG3t9ucQjuZlHhCk4FJRUQMzOyKEET1xvJLr HHZTzIxUQtOHbMjYwm1Yk94q5g5X6Cpler79NPdfQGmho1uVCC+Tfpolw6Ev1NKNS8Pb6MkU2BV 6zyFzA4NKaDy5KdeDBtnTffL60w1zewocU9/zot1zRFQ8X6uWSwIyUg5P3Vo0/XNemvS0076XwE Gri120ftbqs/lqtt41wVs9NeNtPjrf7QYmVU+ee+21HmGoo98XA/a5aAwPACXU X-Received: by 2002:a05:6512:b1a:b0:59c:ba5a:c085 with SMTP id 2adb3069b0e04-59cba5ac2d3mr1685282e87.0.1768833090357; Mon, 19 Jan 2026 06:31:30 -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-59baf33e7fcsm3407211e87.20.2026.01.19.06.31.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jan 2026 06:31:29 -0800 (PST) From: Ulf Hansson To: Ulf Hansson , Dhruva Gole , linux-pm@vger.kernel.org Cc: "Rafael J . Wysocki" , Kevin Hilman , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] pmdomain: core: Extend statistics for domain idle states with s2idle data Date: Mon, 19 Jan 2026 15:31:15 +0100 Message-ID: <20260119143121.161583-4-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119143121.161583-1-ulf.hansson@linaro.org> References: <20260119143121.161583-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" To allow user space to monitor the selection of the domain idle state during s2idle for a CPU PM domain, let's extend the debugfs support in genpd with this information. Suggested-by: Dhruva Gole Signed-off-by: Ulf Hansson Reviewed-by: Dhruva Gole --- drivers/pmdomain/core.c | 13 ++++++++++--- include/linux/pm_domain.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index bf512ff0857d..bb04cb7ccdcd 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -1438,6 +1438,13 @@ static void genpd_sync_power_off(struct generic_pm_d= omain *genpd, bool use_lock, return; } else { genpd->states[genpd->state_idx].usage++; + + /* + * The ->system_power_down_ok() callback is currently used only + * for s2idle. Use it to know when to update the usage counter. + */ + if (genpd->gov && genpd->gov->system_power_down_ok) + genpd->states[genpd->state_idx].usage_s2idle++; } =20 genpd->status =3D GENPD_STATE_OFF; @@ -3772,7 +3779,7 @@ static int idle_states_show(struct seq_file *s, void = *data) if (ret) return -ERESTARTSYS; =20 - seq_puts(s, "State Time(ms) Usage Rejected Above Below= \n"); + seq_puts(s, "State Time(ms) Usage Rejected Above Below= S2idle\n"); =20 for (i =3D 0; i < genpd->state_count; i++) { struct genpd_power_state *state =3D &genpd->states[i]; @@ -3790,9 +3797,9 @@ static int idle_states_show(struct seq_file *s, void = *data) =20 snprintf(state_name, ARRAY_SIZE(state_name), "S%-5d", i); do_div(idle_time, NSEC_PER_MSEC); - seq_printf(s, "%-6s %-14llu %-10llu %-10llu %-10llu %llu\n", + seq_printf(s, "%-6s %-14llu %-10llu %-10llu %-10llu %-10llu %llu\n", state_name, idle_time, state->usage, state->rejected, - state->above, state->below); + state->above, state->below, state->usage_s2idle); } =20 genpd_unlock(genpd); diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 93ba0143ca47..f6f6d494f728 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -183,6 +183,7 @@ struct genpd_power_state { u64 rejected; u64 above; u64 below; + u64 usage_s2idle; struct fwnode_handle *fwnode; u64 idle_time; void *data; --=20 2.43.0