staging: rts5208: ms.c: Remove two udelay calls and use usleep_range instead
PATCH 1/1 staging: rts5208: ms.c: Remove two udelay calls and use usleep_range instead
This patch fixes the issue:
CHECK: usleep_range is preferred over udelay; seeDocumentation/timers/timers-howto.txt
in two occurrences.
--- drivers/staging/rts5208/ms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rts5208/ms.c +2 -2
@@ -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);
Signature · 1 line
2.30.2
Greg KH
maintainerQuoted 15 lines · Sebastian Luchetti
This patch fixes the issue:
CHECK:usleep_rangeis preferred over udelay; seeDocumentation/timers/timers-howto.txt
in two occurrences.Signed-off-by Sebastian Luchetti <[email protected]>--- drivers/staging/rts5208/ms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/rts5208/ms.c +0
-0
drivers/staging/rts5208/ms.c static int ms_write_multiple_pages(struct rtsx_chip *chip, u16 old_blk, · line 3239
Quoted 5 lines
drivers/staging/rts5208/ms.c +1
-1@@ -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
From: Greg KH
Quoted 21 lines
Sent: 17 October 2021 14:42
Quoted 18 lines · Sebastian Luchetti
This patch fixes the issue:
CHECK:usleep_rangeis preferred over udelay; seeDocumentation/timers/timers-howto.txt
in two occurrences.Signed-off-by Sebastian Luchetti <[email protected]>--- drivers/staging/rts5208/ms.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/rts5208/ms.c +0
-0@@ -3236,7 +3236,7 @@ static int ms_write_multiple_pages(struct rtsx_chip *chip, u16 old_blk,return STATUS_FAIL ; }
Quoted 8 lines
drivers/staging/rts5208/ms.c static int ms_write_multiple_pages(struct rtsx_chip *chip, u16 old_blk, · line 3239
Quoted 2 lines
drivers/staging/rts5208/ms.c +1
-1-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)