staging: rtl8723bs: replace msleep(1) with fsleep()
PATCH 1/1 staging: rtl8723bs: replace msleep(1) with fsleep()
msleep(1) is not suitable for short delays due to scheduler granularity.
Use fsleep(USEC_PER_MSEC) instead, which provides a more appropriate delay for 1 ms sleeps.
--- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 5 +++-- drivers/staging/rtl8723bs/hal/hal_btcoex.c | 3 ++- drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 5 +++-- drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c | 3 ++- drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 5 +++-- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 3 ++- 6 files changed, 15 insertions(+), 9 deletions(-)
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +3 -2
@@ -4,6 +4,7 @@* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * ******************************************************************************/ +#include <linux/delay.h> #include <drv_types.h> #include <hal_data.h> #include <linux/jiffies.h>
@@ -414,7 +415,7 @@ s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms) err =-1 ;break ; } -msleep (1 ); +fsleep (USEC_PER_MSEC ); }return err;
@@ -567,7 +568,7 @@ void LPS_Leave_check(struct adapter *padapter)if (jiffies_to_msecs (jiffies - start_time) >100 )break ; -msleep (1 ); +fsleep (USEC_PER_MSEC ); } }
drivers/staging/rtl8723bs/hal/hal_btcoex.c +2 -1
@@ -5,6 +5,7 @@* ******************************************************************************/ +#include <linux/delay.h> #include <hal_data.h> #include <hal_btcoex.h> #include <Mp_Precomp.h>
@@ -98,7 +99,7 @@ static void halbtcoutsrc_LeaveLowPower(struct btc_coexist *pBtCoexist)if (utime > timeout)break ; -msleep (1 ); +fsleep (USEC_PER_MSEC ); }while (1 ); }
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +3 -2
@@ -5,6 +5,7 @@* ******************************************************************************/ +#include <linux/delay.h> #include <linux/firmware.h> #include <linux/slab.h> #include <drv_types.h>
@@ -28,7 +29,7 @@ static void _FWDownloadEnable(struct adapter *padapter, bool enable)if (tmp &0x01 )break ;rtw_write8 (padapter,REG_MCUFWDL , tmp|0x01 ); -msleep (1 ); +fsleep (USEC_PER_MSEC ); }while (count++ <100 );/* 8051 reset */
@@ -1157,7 +1158,7 @@ s32 rtl8723b_InitLLTTable(struct adapter *padapter)if (passing_time >1000 )break ; -msleep (1 ); +fsleep (USEC_PER_MSEC ); }while (1 );return ret;
drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +2 -1
@@ -5,6 +5,7 @@* ******************************************************************************/ +#include <linux/delay.h> #include <drv_types.h> #include <rtl8723b_hal.h>
@@ -391,7 +392,7 @@ int PHY_BBConfig8723B(struct adapter *Adapter)rtw_write8 (Adapter,REG_RF_CTRL ,RF_EN |RF_RSTB |RF_SDMRSTB ); -msleep (1 ); +fsleep (USEC_PER_MSEC );PHY_SetRFReg (Adapter,RF_PATH_A ,0x1 ,0xfffff ,0x780 );
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +3 -2
@@ -5,6 +5,7 @@* ******************************************************************************/ +#include <linux/delay.h> #include <drv_types.h> #include <rtl8723b_hal.h>
@@ -23,7 +24,7 @@ static u8 rtw_sdio_wait_enough_TxOQT_space(struct adapter *padapter, u8 agg_num)HalQueryTxOQTBufferStatus8723BSdio (padapter);if ((++n %60 ) ==0 ) { -msleep (1 ); +fsleep (USEC_PER_MSEC );/* yield(); */ } }
@@ -386,7 +387,7 @@ static s32 rtl8723bs_xmit_handler(struct adapter *padapter)/* here sleep 1ms will cause big TP loss of TX */ /* from 50+ to 40+ */ if (padapter->registrypriv.wifi_spec) -msleep (1 ); +fsleep (USEC_PER_MSEC );else yield (); goto next;
drivers/staging/rtl8723bs/os_dep/os_intfs.c +2 -1
@@ -4,6 +4,7 @@* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. * ******************************************************************************/ +#include <linux/delay.h> #include <drv_types.h> #include <hal_data.h> #include <rtl8723b_xmit.h>
@@ -1091,7 +1092,7 @@ void rtw_suspend_common(struct adapter *padapter) pwrpriv->bInSuspend = true;while (pwrpriv->bips_processing) -msleep (1 ); +fsleep (USEC_PER_MSEC );if ((!padapter->bup) || (padapter->bDriverStopped) || (padapter->bSurpriseRemoved))return ;
Signature · 1 line
2.39.5
Greg KH
maintainerQuoted 173 lines · Zile Xiong
msleep(1) is not suitable for short delays due to scheduler granularity.
Use
fsleep(USEC_PER_MSEC)instead, which provides a more appropriate delay for 1 ms sleeps.Signed-off-by Zile Xiong <[email protected]>--- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 5 +++-- drivers/staging/rtl8723bs/hal/hal_btcoex.c | 3 ++- drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 5 +++-- drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c | 3 ++- drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 5 +++-- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 3 ++- 6 files changed, 15 insertions(+), 9 deletions(-)drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +3
-2@@ -4,6 +4,7 @@* Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * ******************************************************************************/ +#include <linux/delay.h> #include <drv_types.h> #include <hal_data.h> #include <linux/jiffies.h> @@ -414,7 +415,7 @@ s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms) err =-1 ;break ; } -msleep (1 ); +fsleep (USEC_PER_MSEC ); }return err;@@ -567,7 +568,7 @@ void LPS_Leave_check(struct adapter *padapter)if (jiffies_to_msecs (jiffies - start_time) >100 )break ; -msleep (1 ); +fsleep (USEC_PER_MSEC ); } }drivers/staging/rtl8723bs/hal/hal_btcoex.c +2
-1@@ -5,6 +5,7 @@* ******************************************************************************/ +#include <linux/delay.h> #include <hal_data.h> #include <hal_btcoex.h> #include <Mp_Precomp.h> @@ -98,7 +99,7 @@ static void halbtcoutsrc_LeaveLowPower(struct btc_coexist *pBtCoexist)if (utime > timeout)break ; -msleep (1 ); +fsleep (USEC_PER_MSEC ); }while (1 ); }drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +3
-2@@ -5,6 +5,7 @@* ******************************************************************************/ +#include <linux/delay.h> #include <linux/firmware.h> #include <linux/slab.h> #include <drv_types.h> @@ -28,7 +29,7 @@ static void _FWDownloadEnable(struct adapter *padapter, bool enable)if (tmp &0x01 )break ;rtw_write8 (padapter,REG_MCUFWDL , tmp|0x01 ); -msleep (1 ); +fsleep (USEC_PER_MSEC ); }while (count++ <100 );/* 8051 reset */ @@ -1157,7 +1158,7 @@ s32 rtl8723b_InitLLTTable(struct adapter *padapter)if (passing_time >1000 )break ; -msleep (1 ); +fsleep (USEC_PER_MSEC ); }while (1 );return ret;drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +2
-1@@ -5,6 +5,7 @@* ******************************************************************************/ +#include <linux/delay.h> #include <drv_types.h> #include <rtl8723b_hal.h> @@ -391,7 +392,7 @@ int PHY_BBConfig8723B(struct adapter *Adapter)rtw_write8 (Adapter,REG_RF_CTRL ,RF_EN |RF_RSTB |RF_SDMRSTB ); -msleep (1 ); +fsleep (USEC_PER_MSEC );PHY_SetRFReg (Adapter,RF_PATH_A ,0x1 ,0xfffff ,0x780 );drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +3
-2@@ -5,6 +5,7 @@* ******************************************************************************/ +#include <linux/delay.h> #include <drv_types.h> #include <rtl8723b_hal.h> @@ -23,7 +24,7 @@ static u8 rtw_sdio_wait_enough_TxOQT_space(struct adapter *padapter, u8 agg_num)HalQueryTxOQTBufferStatus8723BSdio (padapter);if ((++n %60 ) ==0 ) { -msleep (1 ); +fsleep (USEC_PER_MSEC );/* yield(); */ } }@@ -386,7 +387,7 @@ static s32 rtl8723bs_xmit_handler(struct adapter *padapter)/* here sleep 1ms will cause big TP loss of TX */ /* from 50+ to 40+ */ if (padapter->registrypriv.wifi_spec) -msleep (1 ); +fsleep (USEC_PER_MSEC );else yield (); goto next;drivers/staging/rtl8723bs/os_dep/os_intfs.c +2
-1@@ -4,6 +4,7 @@* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. * ******************************************************************************/ +#include <linux/delay.h> #include <drv_types.h> #include <hal_data.h> #include <rtl8723b_xmit.h> @@ -1091,7 +1092,7 @@ void rtw_suspend_common(struct adapter *padapter) pwrpriv->bInSuspend = true;while (pwrpriv->bips_processing) -msleep (1 ); +fsleep (USEC_PER_MSEC );if ((!padapter->bup) || (padapter->bDriverStopped) || (padapter->bSurpriseRemoved))return ;Signature · 1 line
2.39.5
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.
You are receiving this message because of the following common error(s) as indicated below:
- You sent a patch that has been sent multiple times in the past few days, and is identical to ones that has been recently rejected. Please always look at the mailing list traffic to determine if you are duplicating other people's work.
If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.
thanks,
greg k-h's patch email bot