Re: [PATCH] Revert "Staging: panel: usleep_range is preferred over udelay"

From: Joe Perches
Date: Mon Jan 25 2016 - 07:58:44 EST


On Mon, 2016-01-25 at 18:21 +0530, Sudip Mukherjee wrote:
> On Mon, Jan 25, 2016 at 04:47:26AM -0800, Joe Perches wrote:
> > On Mon, 2016-01-25 at 12:16 +0300, Dan Carpenter wrote:
> > > Ugh...  Checkpatch told us to introduce bugs...  :(  We almost certainly
> > > would have missed this bug in review, but it wasn't sent to the list so
> > > I guess we'll never know.
> >
> > So when isn't usleep_range preferred over udelay?
>
> inside a spin_lock or in some interrupt routine.

That's what timers-howto says and the checkpatch message
for this refers to it.

This message has been in checkpatch since 2010
commit 1a15a250862fda3fbdf8454cc7131e24de904e7c
Author: Patrick Pannuto <ppannuto@xxxxxxxxxxxxxx>

Maybe the checkpatch message can have "when not atomic"
added or some such.