[PATCH 3/3] pci: pcie_dw_rockchip: Use udelay instead of msleep

Patrick Wildt patrick at blueri.se
Tue Apr 27 21:27:39 CEST 2021


Am Tue, Apr 27, 2021 at 11:11:19AM +0530 schrieb Anand Moon:
> hi Patrick,
> 
> On Tue, 27 Apr 2021 at 01:38, Patrick Wildt <patrick at blueri.se> wrote:
> >
> > Am Mon, Apr 26, 2021 at 01:26:32PM +0000 schrieb Anand Moon:
> > > Use udelay instead of msleep fix the below warning.
> >
> > You sure that's correct? the m in msleep means milli, while the u
> > in udelay means micro.  That's a factor of 1000 of a difference.
> >
> Thanks for your review comments.
> 
> Most of the u-boot driver prefers udelay and usleep_range internally
> calls udelay.
> 
> I don't have the HW to test and verify.
> 
> -Anand

Sure, I'm not complaining about that.  My point is that if you pass
e. g. 8 milliseconds to a function that takes microseconds, you need
to add the factor.

Not good: msleep(1000) -> udelay(1000)
Much better: msleep(1000) -> udelay(1000 * 1000)

Which also means that you either have to rename PERST_WAIT_MS and change
its value, or do udelay(PERST_WAIT_MS * 1000)


More information about the U-Boot mailing list