diff mbox series

[V5,RESEND,2/5] PM: domains: Add the domain HW-managed mode to the summary

Message ID 20240413152013.22307-3-quic_jkona@quicinc.com (mailing list archive)
State Not Applicable
Headers show
Series PM: domains: Add control for switching back and forth to HW control | expand

Commit Message

Jagadeesh Kona April 13, 2024, 3:20 p.m. UTC
From: Abel Vesa <abel.vesa@linaro.org>

Now that genpd supports dynamically switching the control for an
attached device between hardware- and software-mode, let's add this
information to the genpd summary under managed by column in debugfs.

Suggested-by: Taniya Das <quic_tdas@quicinc.com>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Signed-off-by: Jagadeesh Kona <quic_jkona@quicinc.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
---
 drivers/pmdomain/core.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

Comments

Taniya Das June 18, 2024, 9:33 a.m. UTC | #1
On 4/13/2024 8:50 PM, Jagadeesh Kona wrote:
> Now that genpd supports dynamically switching the control for an
> attached device between hardware- and software-mode, let's add this
> information to the genpd summary under managed by column in debugfs.
> 
> Suggested-by: Taniya Das<quic_tdas@quicinc.com>
> Signed-off-by: Abel Vesa<abel.vesa@linaro.org>
> Signed-off-by: Jagadeesh Kona<quic_jkona@quicinc.com>
> Reviewed-by: Ulf Hansson<ulf.hansson@linaro.org>
> Reviewed-by: Dmitry Baryshkov<dmitry.baryshkov@linaro.org>
> Reviewed-by: Bjorn Andersson<andersson@kernel.org>
> Reviewed-by: Dhruva Gole<d-gole@ti.com>
> ---
>   drivers/pmdomain/core.c | 14 ++++++++++++--
>   1 file changed, 12 insertions(+), 2 deletions(-)

Reviewed-by: Taniya Das <quic_tdas@quicinc.com>
diff mbox series

Patch

diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c
index 70d8634dd9e8..18a101215c9c 100644
--- a/drivers/pmdomain/core.c
+++ b/drivers/pmdomain/core.c
@@ -3173,6 +3173,15 @@  static void rtpm_status_str(struct seq_file *s, struct device *dev)
 	seq_printf(s, "%-25s  ", p);
 }
 
+static void mode_status_str(struct seq_file *s, struct device *dev)
+{
+	struct generic_pm_domain_data *gpd_data;
+
+	gpd_data = to_gpd_data(dev->power.subsys_data->domain_data);
+
+	seq_printf(s, "%20s", gpd_data->hw_mode ? "HW" : "SW");
+}
+
 static void perf_status_str(struct seq_file *s, struct device *dev)
 {
 	struct generic_pm_domain_data *gpd_data;
@@ -3231,6 +3240,7 @@  static int genpd_summary_one(struct seq_file *s,
 		seq_printf(s, "\n    %-50s  ", kobj_path);
 		rtpm_status_str(s, pm_data->dev);
 		perf_status_str(s, pm_data->dev);
+		mode_status_str(s, pm_data->dev);
 		kfree(kobj_path);
 	}
 
@@ -3247,8 +3257,8 @@  static int summary_show(struct seq_file *s, void *data)
 	int ret = 0;
 
 	seq_puts(s, "domain                          status          children                           performance\n");
-	seq_puts(s, "    /device                                             runtime status\n");
-	seq_puts(s, "----------------------------------------------------------------------------------------------\n");
+	seq_puts(s, "    /device                                             runtime status                           managed by\n");
+	seq_puts(s, "------------------------------------------------------------------------------------------------------------\n");
 
 	ret = mutex_lock_interruptible(&gpd_list_lock);
 	if (ret)