[alsa-devel] [RESEND PATCH v9 6/6] ASoC: amd: Added ACP3x system resume and runtime pm
Dan Carpenter
dan.carpenter at oracle.com
Tue Nov 19 14:34:16 CET 2019
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
More information about the Alsa-devel
mailing list