lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 6 Jun 2022 08:05:14 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Martin Kaiser <martin@...ser.cx>
Cc:     Larry Finger <Larry.Finger@...inger.net>,
        Phillip Potter <phil@...lpotter.co.uk>,
        Michael Straube <straube.linux@...il.com>,
        Pavel Skripkin <paskripkin@...il.com>,
        linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] staging: r8188eu: remove rtw_usleep_os

On Thu, Jun 02, 2022 at 09:48:06PM +0200, Martin Kaiser wrote:
> Remove the rtw_usleep_os helper function. There are only two callers, both
> of which call rtw_usleep_os(100).
> 
> The original code would translate rtw_usleep_os(100) into msleep(1). Using
> msleep for < 20ms is not recommended. Replace the msleep calls with
> usleep_range, based on the explanations in
> Documentation/timers/timers-howto.rst.
> 
> Signed-off-by: Martin Kaiser <martin@...ser.cx>
> ---
>  drivers/staging/r8188eu/core/rtw_pwrctrl.c      | 2 +-
>  drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 2 +-
>  drivers/staging/r8188eu/include/osdep_service.h | 2 --
>  drivers/staging/r8188eu/os_dep/osdep_service.c  | 8 --------
>  4 files changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
> index 7b816b824947..11fd05633529 100644
> --- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c
> +++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
> @@ -266,7 +266,7 @@ static s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
>  			err = -1;
>  			break;
>  		}
> -		rtw_usleep_os(100);
> +		usleep_range(1000, 1200);

How do you know this is the proper range?

>  	}
>  
>  	return err;
> diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> index e17375a74f17..1aa7d01b67b1 100644
> --- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> +++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> @@ -208,7 +208,7 @@ static void efuse_read_phymap_from_txpktbuf(
>  		rtw_write8(adapter, REG_TXPKTBUF_DBG, 0);
>  		timeout = jiffies + msecs_to_jiffies(1000);
>  		while (!rtw_read8(adapter, REG_TXPKTBUF_DBG) && time_before(jiffies, timeout))
> -			rtw_usleep_os(100);
> +			usleep_range(1000, 1200);

Same here, how do you know this is the correct range?

I would just use msleep as needed and later change to a range if you
have figured out that is allowed.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ