linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: rts5208: ms.c: Remove two udelay calls and use usleep_range instead
@ 2021-10-17 12:27 Sebastian Luchetti
  2021-10-17 13:41 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Luchetti @ 2021-10-17 12:27 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel

This patch fixes the issue:
CHECK: usleep_range is preferred over udelay; see
Documentation/timers/timers-howto.txt
in two occurrences.

Signed-off-by: Sebastian Luchetti <luchetti.linux@gmail.com>
---
 drivers/staging/rts5208/ms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c
index 2a6fab5c117a..7292c8f013fd 100644
--- a/drivers/staging/rts5208/ms.c
+++ b/drivers/staging/rts5208/ms.c
@@ -3236,7 +3236,7 @@ static int ms_write_multiple_pages(struct rtsx_chip *chip, u16 old_blk,
 			return STATUS_FAIL;
 		}
 
-		udelay(30);
+		usleep_range(27, 32);
 
 		rtsx_init_cmd(chip);
 
@@ -4158,7 +4158,7 @@ int mg_set_ICV(struct scsi_cmnd *srb, struct rtsx_chip *chip)
 
 #ifdef MG_SET_ICV_SLOW
 	for (i = 0; i < 2; i++) {
-		udelay(50);
+		usleep_range(47, 52);
 
 		rtsx_init_cmd(chip);
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: rts5208: ms.c: Remove two udelay calls and use usleep_range instead
  2021-10-17 12:27 [PATCH] staging: rts5208: ms.c: Remove two udelay calls and use usleep_range instead Sebastian Luchetti
@ 2021-10-17 13:41 ` Greg KH
  2021-10-20 20:46   ` David Laight
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2021-10-17 13:41 UTC (permalink / raw)
  To: Sebastian Luchetti; +Cc: linux-staging, linux-kernel

On Sun, Oct 17, 2021 at 02:27:12PM +0200, Sebastian Luchetti wrote:
> This patch fixes the issue:
> CHECK: usleep_range is preferred over udelay; see
> Documentation/timers/timers-howto.txt
> in two occurrences.
> 
> Signed-off-by: Sebastian Luchetti <luchetti.linux@gmail.com>
> ---
>  drivers/staging/rts5208/ms.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c
> index 2a6fab5c117a..7292c8f013fd 100644
> --- a/drivers/staging/rts5208/ms.c
> +++ b/drivers/staging/rts5208/ms.c
> @@ -3236,7 +3236,7 @@ static int ms_write_multiple_pages(struct rtsx_chip *chip, u16 old_blk,
>  			return STATUS_FAIL;
>  		}
>  
> -		udelay(30);
> +		usleep_range(27, 32);

These are very odd choices of a number, where did they come from?

And as the other thread on this mailing list a few hours ago describes,
for this same type of change, you need to test this with the actual
hardware to know if this works properly or not.  Have you done so?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] staging: rts5208: ms.c: Remove two udelay calls and use usleep_range instead
  2021-10-17 13:41 ` Greg KH
@ 2021-10-20 20:46   ` David Laight
  0 siblings, 0 replies; 3+ messages in thread
From: David Laight @ 2021-10-20 20:46 UTC (permalink / raw)
  To: 'Greg KH', Sebastian Luchetti; +Cc: linux-staging, linux-kernel

From: Greg KH
> Sent: 17 October 2021 14:42
> 
> On Sun, Oct 17, 2021 at 02:27:12PM +0200, Sebastian Luchetti wrote:
> > This patch fixes the issue:
> > CHECK: usleep_range is preferred over udelay; see
> > Documentation/timers/timers-howto.txt
> > in two occurrences.
> >
> > Signed-off-by: Sebastian Luchetti <luchetti.linux@gmail.com>
> > ---
> >  drivers/staging/rts5208/ms.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c
> > index 2a6fab5c117a..7292c8f013fd 100644
> > --- a/drivers/staging/rts5208/ms.c
> > +++ b/drivers/staging/rts5208/ms.c
> > @@ -3236,7 +3236,7 @@ static int ms_write_multiple_pages(struct rtsx_chip *chip, u16 old_blk,
> >  			return STATUS_FAIL;
> >  		}
> >
> > -		udelay(30);
> > +		usleep_range(27, 32);
> 
> These are very odd choices of a number, where did they come from?
> 
> And as the other thread on this mailing list a few hours ago describes,
> for this same type of change, you need to test this with the actual
> hardware to know if this works properly or not.  Have you done so?

You also need to check that it is actually safe to sleep.
The style of the commit messages doesn't give massive
confidence that you have checked.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-20 20:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-17 12:27 [PATCH] staging: rts5208: ms.c: Remove two udelay calls and use usleep_range instead Sebastian Luchetti
2021-10-17 13:41 ` Greg KH
2021-10-20 20:46   ` David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).