[PATCH 01/13] mmc: bcm2835: add bcm2835_read_wait_sdcmd
Gerd Hoffmann
kraxel at redhat.com
Fri Jan 27 02:28:32 PST 2017
Hi,
> > + for (;;) {
> > + value = readl(host->ioaddr + SDCMD);
> > + if (!(value & SDCMD_NEW_FLAG))
> > + break;
> > + if (check_fail && (value & SDCMD_FAIL_FLAG))
> > + break;
> > + if (time_after(jiffies, end)) {
> > + dev_err(dev, "%s: timeout (%d us)\n",
> > + __func__, timeout);
> > + break;
> > + }
> > +
> > + /* if it takes longer reduce poll interval */
> > + if (time_after(jiffies, fastpoll))
> > + udelay(10);
> > + else
> > + cpu_relax();
> > + }
>
> Use readl_poll_timeout intead of open-coding them..
Cool. Didn't know this exists. Incremental fixup attached.
thanks,
Gerd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-mmc-bcm2835-use-readl_poll_timeout-in-bcm2835_read_w.patch
Type: text/x-patch
Size: 2245 bytes
Desc:
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170127/320c74c6/attachment.bin>
More information about the linux-arm-kernel
mailing list