lkml.org 
[lkml]   [2019]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 20/23] staging: qlge: Fix CHECK: usleep_range is preferred over udelay
On Thu, Dec 12, 2019 at 01:45:57PM +0300, Sergei Shtylyov wrote:
> Hello!
>
> On 11.12.2019 21:12, Scott Schafer wrote:
>
> > chage udelay() to usleep_range()
>
> Change?
>
> > Signed-off-by: Scott Schafer <schaferjscott@gmail.com>
> > ---
> > drivers/staging/qlge/qlge_main.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
> > index e18aa335c899..9427386e4a1e 100644
> > --- a/drivers/staging/qlge/qlge_main.c
> > +++ b/drivers/staging/qlge/qlge_main.c
> > @@ -147,7 +147,7 @@ int ql_sem_spinlock(struct ql_adapter *qdev, u32 sem_mask)
> > do {
> > if (!ql_sem_trylock(qdev, sem_mask))
> > return 0;
> > - udelay(100);
> > + usleep_range(100, 200);
>
> I hope you're not in atomic context...

I have an unpublished Smatch check which says that we aren't in atomic
context, but still this has spin_lock() in the name so you're right, it
shouldn't sleep.

regards,
dan carpenter

\
 
 \ /
  Last update: 2019-12-12 12:08    [W:0.049 / U:7.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site