Re: [RESEND PATCH v9 6/6] ASoC: amd: Added ACP3x system resume and runtime pm

From: Dan Carpenter
Date: Tue Nov 19 2019 - 08:37:15 EST


On Tue, Nov 19, 2019 at 06:26:17PM +0530, vishnu wrote:
>
>
> On 19/11/19 6:05 PM, Dan Carpenter wrote:
> > I can't apply this because I'm not CC'd on patches 2-5.
> >
> > On Tue, Nov 19, 2019 at 05:41:16PM +0530, Ravulapati Vishnu vardhan rao wrote:
> > > +static int acp3x_power_on(void __iomem *acp3x_base)
> > > +{
> > > + u32 val;
> > > + u32 timeout;
> > > +
> > > + timeout = 0;
> > > + val = rv_readl(acp3x_base + mmACP_PGFSM_STATUS);
> > > +
> > > + if (val == 0)
> > > + return val;
> > > +
> > > + if (!((val & ACP_PGFSM_STATUS_MASK) ==
> > > + ACP_POWER_ON_IN_PROGRESS))
> > > + rv_writel(ACP_PGFSM_CNTL_POWER_ON_MASK,
> > > + acp3x_base + mmACP_PGFSM_CONTROL);
> > > + while (++timeout) {
> >
> > while (++timeout < 500)
> >
>
> If I check with timeout<500 and in next condition i have
> if(timeout >500) this never happens.

I was maybe not clear enough. Please don't write:

while (++timeout) {

That doesn't make sense as a loop. It looks like you are trying to
loop UINT_MAX times. Put the ++ and the limit on the same line.

There is only one real bug in my review but there is just a lot of clean
up left. Can you have a co-worker review your patch before resending?
The patch 1/6 looks pretty good now but I haven't seen patches 2-5 so
I'm worried there is a lot of cleanup left to do.

regards,
dan carpenter