staging: rtl8723bs: replace msleep with usleep_range
PATCH 1/1 staging: rtl8723bs: replace msleep with usleep_range
Replace msleep(1) with usleep_range(1000, 1500) because msleep with small values (<20ms) can sleep for up to 20ms due to timer tick resolution. Using usleep_range provides a more precise and consistent delay for hardware power control operations.
--- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +1 -1
@@ -561,7 +561,7 @@ void LPS_Leave_check(struct adapter *padapter)if (jiffies_to_msecs (jiffies - start_time) >100 )break ; -msleep (1 ); +usleep_range (1000 ,1500 ); } }
Signature · 1 line
2.55.0
Quoted 15 lines · Omer PALA
Replace msleep(1) with
usleep_range(1000, 1500)because msleep with small values (<20ms) can sleep for up to 20ms due to timer tick resolution. Usingusleep_rangeprovides a more precise and consistent delay for hardware power control operations.Signed-off-by Omer PALA <[email protected]>--- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +0
-0
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c void LPS_Leave_check(struct adapter *padapter) · line 564
Quoted 5 lines
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +1
-1@@ -561,7 +561,7 @@ void LPS_Leave_check(struct adapter *padapter)if (jiffies_to_msecs (jiffies - start_time) >100 )break ; -msleep (1 ); +usleep_range (1000 ,1500 );
These kinds of changes need to be tested.
I don't love this checkpatch warning because it we reject almost all these patches. If it were new code, presumably the person sending the patch would be able to test it... But I guess it serves as a kind of lesson to not listen to checkpatch and also to search lore before sending stuff.
https://lore.kernel.org/all/?q=LPS_Leave_check%20msleep
regards,
dan carpenter
Quoted 11 lines · Dan Carpenter
These kinds of changes need to be tested.
I don't love this checkpatch warning because it we reject almost all these patches. If it were new code, presumably the person sending the patch would be able to test it... But I guess it serves as a kind of lesson to not listen to checkpatch and also to search lore before sending stuff.
https://lore.kernel.org/all/?q=LPS_Leave_check%20msleepregards,
dan carpenter
Sorry for wasting your time.
I thought it was an issue.
You can drop my patch.
Best regards,
Omer PALA
Quoted 10 lines · Ömer PALA
Quoted 9 lines · Dan Carpenter
These kinds of changes need to be tested.
I don't love this checkpatch warning because it we reject almost all these patches. If it were new code, presumably the person sending the patch would be able to test it... But I guess it serves as a kind of lesson to not listen to checkpatch and also to search lore before sending stuff.
https://lore.kernel.org/all/?q=LPS_Leave_check%20msleep
Quoted 7 lines
Quoted 2 lines
regards,
dan carpenterSorry for wasting your time.
I thought it was an issue.
I kind of told you to look up archives in other thread. Nam Cao told you this in other thread. Dan told you this in this thread.
Yet, day later on 18th, you decided to send "dt-bindings: iio: adc: Add dt binding to xlnx,xadc" without checking in archives.
And that one was even pure AI slop.
Mistakes are fine, we all learn from them, but it seems that you are not. You are just acknowledging the comment and not taking it as anyhow learning thing, to change something.
I find it not acceptable, because it means we need to repeat you THE SAME feedback all over again, because you will be always repeating the same mistake.
Best regards,
Krzysztof
Quoted 4 lines · Omer PALA
Replace msleep(1) with
usleep_range(1000, 1500)because msleep with small values (<20ms) can sleep for up to 20ms due to timer tick resolution. Usingusleep_rangeprovides a more precise and consistent delay for hardware power control operations.
Why is precise delay important for power control?
Precise delay comes with a cost, so we don't do that unless necessary.
Nam
Quoted 5 lines · Nam Cao
Why is precise delay important for power control?
Precise delay comes with a cost, so we don't do that unless necessary.
Nam
Thanks for feedback.
I am sorry for wasting your time.
I thought waiting up to 20ms was too much for power control, so I submitted this patch.
So i wrote this patch.
I understand this isn't necessary.
You can drop my patch.
Best regards,
Omer PALA