2023-11-01 09:04:53

by Abel Vesa

[permalink] [raw]
Subject: [PATCH RESEND v3 2/5] PM: domains: Add the domain HW-managed mode to the summary

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 in debugfs.

Suggested-by: Taniya Das <[email protected]>
Signed-off-by: Abel Vesa <[email protected]>
Reviewed-by: Ulf Hansson <[email protected]>
---
drivers/base/power/domain.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 3fb1a234c7f2..7044271ec93b 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -3181,6 +3181,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;
@@ -3239,6 +3248,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);
}

@@ -3255,8 +3265,9 @@ 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)

--
2.34.1


2023-11-01 21:28:24

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: [PATCH RESEND v3 2/5] PM: domains: Add the domain HW-managed mode to the summary

On Wed, 1 Nov 2023 at 11:06, Abel Vesa <[email protected]> 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 in debugfs.
>
> Suggested-by: Taniya Das <[email protected]>
> Signed-off-by: Abel Vesa <[email protected]>
> Reviewed-by: Ulf Hansson <[email protected]>
> ---
> drivers/base/power/domain.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)

Reviewed-by: Dmitry Baryshkov <[email protected]>

--
With best wishes
Dmitry

2023-11-03 19:44:14

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH RESEND v3 2/5] PM: domains: Add the domain HW-managed mode to the summary

On Wed, Nov 01, 2023 at 11:04:08AM +0200, Abel Vesa 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 in debugfs.
>
> Suggested-by: Taniya Das <[email protected]>
> Signed-off-by: Abel Vesa <[email protected]>
> Reviewed-by: Ulf Hansson <[email protected]>

Reviewed-by: Bjorn Andersson <[email protected]>

Regards,
Bjorn

> ---
> drivers/base/power/domain.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> index 3fb1a234c7f2..7044271ec93b 100644
> --- a/drivers/base/power/domain.c
> +++ b/drivers/base/power/domain.c
> @@ -3181,6 +3181,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;
> @@ -3239,6 +3248,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);
> }
>
> @@ -3255,8 +3265,9 @@ 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)
>
> --
> 2.34.1
>