From patchwork Sat Nov 30 16:39:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 846430 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 E5AE01E884; Sat, 30 Nov 2024 16:39:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732984790; cv=none; b=D7Cwl29v4OqO9TC+nuBnoKj9lnSZTdD3obgzzU3tKuUovMnsEM/XnNkrghxxlVISrnrrmNJ/2J77fjwjUbKJYxc3YC7rplUkiuZmgR/N3Zhcv5VpGOrVj6thIw9TQZe7Wo26JEy2nZFGAA7Bo1zgQ3AGpAvaDQzCBXqraXxh61M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732984790; c=relaxed/simple; bh=XG4Tuu0tc1bwT2b6fJl7qoNMDQsqyjSebI/5+tZaOK0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=M+DeWD/fKdpx7x/GlqtQO7vKW8/17J0hw+E56TzNLxc0WaV9kxXnm1mRTolam/asWAEmOtTbh23ktbZWeYTFth/nr3uPdQHQlRnqdTI54v7WJ8JAAGVlZtX07N0Xym86P66cSQGv321YgL6QeieWnVttFv6AJebq0NKW9+PSPk4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eMxm1Dt0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eMxm1Dt0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 234F8C4CECC; Sat, 30 Nov 2024 16:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732984789; bh=XG4Tuu0tc1bwT2b6fJl7qoNMDQsqyjSebI/5+tZaOK0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=eMxm1Dt0+WOYvH7t8i5CPm5yh9r2stzX1xyeD6C9fOZE10zpmrnCzPi+qSLQ+nf8j eLbkkp3fU8KeMhu7AZEyYiOcF9oRroYYN8RBtOJOtVsOHovyTS9njGeDphvwum/hXk 4LLoh+KHQ0XYL5VqixtDL02qqlu+42stThtqjY3Tw7WQqEZpmBb8MybyZN8Bblp6ra D5clBwp4LvYkD6DHcuD7nJou1F071SwF0PeAQ27l41oe/eO3T9lkd0GmwO/avleR+J joJE86XVDtyosJ7MV7eeeeic0g4MOOMuPAQY3NAeuAmthG0Xvuo6vKWYkBUWDRfr/7 U0syTElKWJq4Q== From: Konrad Dybcio Date: Sat, 30 Nov 2024 17:39:36 +0100 Subject: [PATCH 1/2] dt-bindings: power: domain-idle-state: Allow idle-state-name Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241130-topic-idle_state_name-v1-1-d0ff67b0c8e9@oss.qualcomm.com> References: <20241130-topic-idle_state_name-v1-0-d0ff67b0c8e9@oss.qualcomm.com> In-Reply-To: <20241130-topic-idle_state_name-v1-0-d0ff67b0c8e9@oss.qualcomm.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ulf Hansson , "Rafael J. Wysocki" Cc: Marijn Suijten , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Bjorn Andersson , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732984781; l=1070; i=konrad.dybcio@oss.qualcomm.com; s=20230215; h=from:subject:message-id; bh=8kfXvaVq7Y3C1ujH0UYk3GamLfvEvQQpE+vDZPL0nhA=; b=xhiEdwL9ZYE/LxD4Nclcan2QZJFOf71r4fkEVb3vTGlcRpL3jEQuUZXr+jZXVqnMveUrDV6LM cww2gXssKKhCk7xImD3UCJvGSTKRXSS2+v5D28uLVSG8qaOeH2UbkMS X-Developer-Key: i=konrad.dybcio@oss.qualcomm.com; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= From: Konrad Dybcio Allow specifying a name for idle states, similar to CPU idle states in cpu/idle-states.yaml Signed-off-by: Konrad Dybcio --- Documentation/devicetree/bindings/power/domain-idle-state.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/power/domain-idle-state.yaml b/Documentation/devicetree/bindings/power/domain-idle-state.yaml index ec1f6f669e50b2e7b0756cb6a737c685ad81045b..4dd4f59bbbec3058cf20f064aeec4c9602a99eb7 100644 --- a/Documentation/devicetree/bindings/power/domain-idle-state.yaml +++ b/Documentation/devicetree/bindings/power/domain-idle-state.yaml @@ -54,6 +54,11 @@ patternProperties: (i.e. idle states node with entry-method property is set to "psci") must specify this property. + idle-state-name: + $ref: /schemas/types.yaml#/definitions/string + description: + A string used as a descriptive name for the idle state. + required: - compatible - entry-latency-us From patchwork Sat Nov 30 16:39:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 846857 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7C1861A262D; Sat, 30 Nov 2024 16:39:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732984793; cv=none; b=ZqyYfy+Z+5ktWd6sVXYz8Y8kbXevdB+a7gJRzuJje3BlzAKibukT9+Pxe4o5B9M6X3XqH6benu0lyJ+dsuFfY0Yi6TrRcJzytc9bEl2DGCjy+HbAPakE3ELnnf+Sqqa7ZPpUCoMjhIA8JW79SlK7UxXwt2pdEhA3bsfU7E8P8H4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732984793; c=relaxed/simple; bh=P/Ora394aiAIsv2E40+bNDx45WNlD9B4Bex2g9v0SAU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nAPUAPBBfi1zvTY4GmLWhRpiRNk4/+U56nOcSt2fu3uPbkKvq5eNGMKuRcq3GVLePXcWYqPYtljWZFATobHwcXVuPrm19089+nSDm74LFwhd+vZBm+QiTEijZ63sTbe7BMVxDBDFz6+4+ilLDx030GhGH2u719ijKnIvxc2PbXU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KGThtjdv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KGThtjdv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7FB9C4CED3; Sat, 30 Nov 2024 16:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1732984793; bh=P/Ora394aiAIsv2E40+bNDx45WNlD9B4Bex2g9v0SAU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=KGThtjdvUKYypb4b8OVKCKjvU1uK3aTvE1x/X/57Xkk/QTjB6H2DKPir0KZ/vrHyr hp7eTjk91zemieUWVFygz7cQ4DDt5l0IGJuNhc3iJpM15dMbS2ElkQyxUTyU8C6qX+ pWLeY3Ymi5I/8047ItiGFGnc0yZd58o/u5Of4GPCKB951TbwgZrvIl3DIPDepVwJW9 9TaufzhO1daP7PiW6Zvda9inBCPFKQ9Gmj6iGsE4YWPYKtR8aMOe4Nl8/s22KA4NAF xKnkEalrXHPYDdX0J235vbpeJIZe/txZSfbShk3mvJPG3/tSqAHSCfB4+Arw1fqmcA uEZoxNW9SsJDA== From: Konrad Dybcio Date: Sat, 30 Nov 2024 17:39:37 +0100 Subject: [PATCH 2/2] pmdomain: core: Support naming idle states Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241130-topic-idle_state_name-v1-2-d0ff67b0c8e9@oss.qualcomm.com> References: <20241130-topic-idle_state_name-v1-0-d0ff67b0c8e9@oss.qualcomm.com> In-Reply-To: <20241130-topic-idle_state_name-v1-0-d0ff67b0c8e9@oss.qualcomm.com> To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ulf Hansson , "Rafael J. Wysocki" Cc: Marijn Suijten , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Bjorn Andersson , Konrad Dybcio X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1732984781; l=2553; i=konrad.dybcio@oss.qualcomm.com; s=20230215; h=from:subject:message-id; bh=u/1xp80sxdJbOQMI7rGBW5elAYaMjhAKE1/mS4dnTnA=; b=LMvarwmd6uBjNHLDuSkBpgjXVhlwG/EfRBwLpXNOxW9vPgNSb4G6GtBDcMPbTXEzO+1aqKTSy XvvNh8qfmqdBEmIfSnMoagGWReHU4hFsQC6YwyOVblZNt+VYyfO0qO7 X-Developer-Key: i=konrad.dybcio@oss.qualcomm.com; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= From: Konrad Dybcio Commit 422f2d418186 ("arm64: dts: qcom: Drop undocumented domain "idle-state-name"") brought to light the common misbelief that idle-state-names also applies to e.g. PSCI power domain idle states. Make that a reality, mimicking the property name used by cpuidle states. Signed-off-by: Konrad Dybcio --- drivers/pmdomain/core.c | 15 ++++++++++++--- include/linux/pm_domain.h | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c index a6c8b85dd02478e227ac74886225a3fbad330eac..6f41ebdbc24fdfdf02021d4db1b2f324736940ae 100644 --- a/drivers/pmdomain/core.c +++ b/drivers/pmdomain/core.c @@ -3171,6 +3171,8 @@ static int genpd_parse_state(struct genpd_power_state *genpd_state, if (!err) genpd_state->residency_ns = 1000LL * residency; + of_property_read_string(state_node, "idle-state-name", &genpd_state->name); + genpd_state->power_on_latency_ns = 1000LL * exit_latency; genpd_state->power_off_latency_ns = 1000LL * entry_latency; genpd_state->fwnode = &state_node->fwnode; @@ -3449,7 +3451,10 @@ static int idle_states_show(struct seq_file *s, void *data) seq_puts(s, "State Time Spent(ms) Usage Rejected\n"); for (i = 0; i < genpd->state_count; i++) { - idle_time += genpd->states[i].idle_time; + struct genpd_power_state *state = &genpd->states[i]; + char state_name[15]; + + idle_time += state->idle_time; if (genpd->status == GENPD_STATE_OFF && genpd->state_idx == i) { now = ktime_get_mono_fast_ns(); @@ -3459,9 +3464,13 @@ static int idle_states_show(struct seq_file *s, void *data) } } + if (!state->name) + snprintf(state_name, ARRAY_SIZE(state_name), "S%-13d", i); + do_div(idle_time, NSEC_PER_MSEC); - seq_printf(s, "S%-13i %-14llu %-14llu %llu\n", i, idle_time, - genpd->states[i].usage, genpd->states[i].rejected); + seq_printf(s, "%-14s %-14llu %-14llu %llu\n", + state->name ?: state_name, idle_time, + state->usage, state->rejected); } genpd_unlock(genpd); diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 45646bfcaf1a5eb7169e497677c3a2acd9263a9c..1aab31370065caad13bf951179f75ff3cf798a96 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -147,6 +147,7 @@ struct genpd_governor_data { }; struct genpd_power_state { + const char *name; s64 power_off_latency_ns; s64 power_on_latency_ns; s64 residency_ns;