[PATCH 05/11] soc: imx: gpcv2: add runtime PM support for power-domains
Lucas Stach
l.stach at pengutronix.de
Wed Sep 30 12:20:58 EDT 2020
On Mi, 2020-09-30 at 18:14 +0200, Marek Vasut wrote:
> On 9/30/20 5:50 PM, Lucas Stach wrote:
> [...]
> > @@ -143,11 +144,17 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd)
> > u32 reg_val;
> > int i, ret;
> >
> > + ret = pm_runtime_get_sync(domain->dev);
> > + if (ret) {
> > + pm_runtime_put_noidle(domain->dev);
> > + return ret;
> > + }
> > +
> > if (!IS_ERR(domain->regulator)) {
> > ret = regulator_enable(domain->regulator);
> > if (ret) {
> > dev_err(domain->dev, "failed to enable regulator\n");
> > - return ret;
> > + goto out_put_pm;
> > }
> > }
> >
> > @@ -205,6 +212,8 @@ static int imx_pgc_power_up(struct generic_pm_domain *genpd)
> > clk_disable_unprepare(domain->clk[i]);
> > if (!IS_ERR(domain->regulator))
> > regulator_disable(domain->regulator);
> > +out_put_pm:
> > + pm_runtime_put(domain->dev);
> >
> > return ret;
> > }
> Shouldn't this be pm_runtime_put_sync() ?
We don't really care when the parent domains powers down, we just care
about it happening sometime, so I guess the code is fine as is, no?
Regards,
Lucas
More information about the linux-arm-kernel
mailing list