提交 e84b2c20 编写于 作者: R Rafael J. Wysocki

PM / Domains: Make it possible to assign names to generic PM domains

Add a name member pointer to struct generic_pm_domain and use it in
diagnostic messages regarding the domain power-off and power-on
latencies.  Update the ARM shmobile SH7372 code to assign names to
the PM domains used by it.
Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
Acked-by: NMagnus Damm <damm@opensource.se>
上级 4f042cda
...@@ -101,8 +101,8 @@ static int pd_power_down(struct generic_pm_domain *genpd) ...@@ -101,8 +101,8 @@ static int pd_power_down(struct generic_pm_domain *genpd)
} }
if (!sh7372_pd->no_debug) if (!sh7372_pd->no_debug)
pr_debug("sh7372 power domain down 0x%08x -> PSTR = 0x%08x\n", pr_debug("%s: Power off, 0x%08x -> PSTR = 0x%08x\n",
mask, __raw_readl(PSTR)); genpd->name, mask, __raw_readl(PSTR));
return 0; return 0;
} }
...@@ -133,8 +133,8 @@ static int __pd_power_up(struct sh7372_pm_domain *sh7372_pd, bool do_resume) ...@@ -133,8 +133,8 @@ static int __pd_power_up(struct sh7372_pm_domain *sh7372_pd, bool do_resume)
ret = -EIO; ret = -EIO;
if (!sh7372_pd->no_debug) if (!sh7372_pd->no_debug)
pr_debug("sh7372 power domain up 0x%08x -> PSTR = 0x%08x\n", pr_debug("%s: Power on, 0x%08x -> PSTR = 0x%08x\n",
mask, __raw_readl(PSTR)); sh7372_pd->genpd.name, mask, __raw_readl(PSTR));
out: out:
if (ret == 0 && sh7372_pd->resume && do_resume) if (ret == 0 && sh7372_pd->resume && do_resume)
...@@ -233,18 +233,22 @@ void sh7372_pm_add_subdomain(struct sh7372_pm_domain *sh7372_pd, ...@@ -233,18 +233,22 @@ void sh7372_pm_add_subdomain(struct sh7372_pm_domain *sh7372_pd,
} }
struct sh7372_pm_domain sh7372_a4lc = { struct sh7372_pm_domain sh7372_a4lc = {
.genpd.name = "A4LC",
.bit_shift = 1, .bit_shift = 1,
}; };
struct sh7372_pm_domain sh7372_a4mp = { struct sh7372_pm_domain sh7372_a4mp = {
.genpd.name = "A4MP",
.bit_shift = 2, .bit_shift = 2,
}; };
struct sh7372_pm_domain sh7372_d4 = { struct sh7372_pm_domain sh7372_d4 = {
.genpd.name = "D4",
.bit_shift = 3, .bit_shift = 3,
}; };
struct sh7372_pm_domain sh7372_a4r = { struct sh7372_pm_domain sh7372_a4r = {
.genpd.name = "A4R",
.bit_shift = 5, .bit_shift = 5,
.gov = &sh7372_always_on_gov, .gov = &sh7372_always_on_gov,
.suspend = sh7372_a4r_suspend, .suspend = sh7372_a4r_suspend,
...@@ -253,14 +257,17 @@ struct sh7372_pm_domain sh7372_a4r = { ...@@ -253,14 +257,17 @@ struct sh7372_pm_domain sh7372_a4r = {
}; };
struct sh7372_pm_domain sh7372_a3rv = { struct sh7372_pm_domain sh7372_a3rv = {
.genpd.name = "A3RV",
.bit_shift = 6, .bit_shift = 6,
}; };
struct sh7372_pm_domain sh7372_a3ri = { struct sh7372_pm_domain sh7372_a3ri = {
.genpd.name = "A3RI",
.bit_shift = 8, .bit_shift = 8,
}; };
struct sh7372_pm_domain sh7372_a3sp = { struct sh7372_pm_domain sh7372_a3sp = {
.genpd.name = "A3SP",
.bit_shift = 11, .bit_shift = 11,
.gov = &sh7372_always_on_gov, .gov = &sh7372_always_on_gov,
.no_debug = true, .no_debug = true,
...@@ -275,6 +282,7 @@ static void sh7372_a3sp_init(void) ...@@ -275,6 +282,7 @@ static void sh7372_a3sp_init(void)
} }
struct sh7372_pm_domain sh7372_a3sg = { struct sh7372_pm_domain sh7372_a3sg = {
.genpd.name = "A3SG",
.bit_shift = 13, .bit_shift = 13,
}; };
......
...@@ -209,8 +209,13 @@ int __pm_genpd_poweron(struct generic_pm_domain *genpd) ...@@ -209,8 +209,13 @@ int __pm_genpd_poweron(struct generic_pm_domain *genpd)
goto err; goto err;
elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start)); elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start));
if (elapsed_ns > genpd->power_on_latency_ns) if (elapsed_ns > genpd->power_on_latency_ns) {
genpd->power_on_latency_ns = elapsed_ns; genpd->power_on_latency_ns = elapsed_ns;
if (genpd->name)
pr_warning("%s: Power-on latency exceeded, "
"new value %lld ns\n", genpd->name,
elapsed_ns);
}
} }
genpd_set_active(genpd); genpd_set_active(genpd);
...@@ -428,8 +433,13 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd) ...@@ -428,8 +433,13 @@ static int pm_genpd_poweroff(struct generic_pm_domain *genpd)
} }
elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start)); elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start));
if (elapsed_ns > genpd->power_off_latency_ns) if (elapsed_ns > genpd->power_off_latency_ns) {
genpd->power_off_latency_ns = elapsed_ns; genpd->power_off_latency_ns = elapsed_ns;
if (genpd->name)
pr_warning("%s: Power-off latency exceeded, "
"new value %lld ns\n", genpd->name,
elapsed_ns);
}
} }
genpd->status = GPD_STATE_POWER_OFF; genpd->status = GPD_STATE_POWER_OFF;
......
...@@ -50,6 +50,7 @@ struct generic_pm_domain { ...@@ -50,6 +50,7 @@ struct generic_pm_domain {
struct mutex lock; struct mutex lock;
struct dev_power_governor *gov; struct dev_power_governor *gov;
struct work_struct power_off_work; struct work_struct power_off_work;
char *name;
unsigned int in_progress; /* Number of devices being suspended now */ unsigned int in_progress; /* Number of devices being suspended now */
atomic_t sd_count; /* Number of subdomains with power "on" */ atomic_t sd_count; /* Number of subdomains with power "on" */
enum gpd_status status; /* Current state of the domain */ enum gpd_status status; /* Current state of the domain */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册