Message ID | 1417614107-5985-4-git-send-email-geert+renesas@glider.be (mailing list archive) |
---|---|
State | Accepted |
Commit | 64b0089e0c4867365b66973f3d844843e403d2a3 |
Headers | show |
On 3 December 2014 at 14:41, Geert Uytterhoeven <geert+renesas@glider.be> wrote: > If CONFIG_PM_RUNTIME is not set, the clocks must be enabled before the > devices can be used. > > Currently these clocks are enabled by the !CONFIG_PM_RUNTIME version of > pm_clk_notify, activated by the hack in drivers/sh/pm_runtime.c, but > this will go away soon (at least for DT). > > On detach, disabling the clocks is already handled by pm_clk_destroy(). > On system suspend/resume, disabling/enabling clocks is already handled > from the genpd->dev_ops.{start,stop}() callbacks. > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > --- > v6: > - No changes, > v5: > - No changes, > v4: > - New. > --- > arch/arm/mach-shmobile/pm-rmobile.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c > index 168046c355fc8368..6d912ce801aa88bd 100644 > --- a/arch/arm/mach-shmobile/pm-rmobile.c > +++ b/arch/arm/mach-shmobile/pm-rmobile.c > @@ -118,6 +118,14 @@ static int rmobile_pd_attach_dev(struct generic_pm_domain *domain, > goto fail; > } > > + if (!IS_ENABLED(CONFIG_PM_RUNTIME)) { This will require a fixup later on, since using genpd will always be done for CONFIG_PM_RUNTIME (or CONFIG_PM actually) ). I guess you knew that already, but then you can't keep my response as a reminder. :-) Kind regards Uffe > + error = pm_clk_resume(dev); > + if (error) { > + dev_err(dev, "pm_clk_resume failed %d\n", error); > + goto fail; > + } > + } > + > return 0; > > fail: > -- > 1.9.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Ulf, On Thu, Dec 4, 2014 at 2:41 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote: >> diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c >> index 168046c355fc8368..6d912ce801aa88bd 100644 >> --- a/arch/arm/mach-shmobile/pm-rmobile.c >> +++ b/arch/arm/mach-shmobile/pm-rmobile.c >> @@ -118,6 +118,14 @@ static int rmobile_pd_attach_dev(struct generic_pm_domain *domain, >> goto fail; >> } >> >> + if (!IS_ENABLED(CONFIG_PM_RUNTIME)) { > > This will require a fixup later on, since using genpd will always be > done for CONFIG_PM_RUNTIME (or CONFIG_PM actually) ). Indeed. But this is queued up in a branch that doesn't have the PM unification yet. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c index 168046c355fc8368..6d912ce801aa88bd 100644 --- a/arch/arm/mach-shmobile/pm-rmobile.c +++ b/arch/arm/mach-shmobile/pm-rmobile.c @@ -118,6 +118,14 @@ static int rmobile_pd_attach_dev(struct generic_pm_domain *domain, goto fail; } + if (!IS_ENABLED(CONFIG_PM_RUNTIME)) { + error = pm_clk_resume(dev); + if (error) { + dev_err(dev, "pm_clk_resume failed %d\n", error); + goto fail; + } + } + return 0; fail:
If CONFIG_PM_RUNTIME is not set, the clocks must be enabled before the devices can be used. Currently these clocks are enabled by the !CONFIG_PM_RUNTIME version of pm_clk_notify, activated by the hack in drivers/sh/pm_runtime.c, but this will go away soon (at least for DT). On detach, disabling the clocks is already handled by pm_clk_destroy(). On system suspend/resume, disabling/enabling clocks is already handled from the genpd->dev_ops.{start,stop}() callbacks. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> --- v6: - No changes, v5: - No changes, v4: - New. --- arch/arm/mach-shmobile/pm-rmobile.c | 8 ++++++++ 1 file changed, 8 insertions(+)