Re: [PATCH 05/11] soc: imx: gpcv2: add runtime PM support for power-domains

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux