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]
Message-ID: <2026011937-snugness-movie-9e32@gregkh>
Date: Mon, 19 Jan 2026 09:20:49 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: 2023060904@....edu.cn
Cc: linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
	guagua210311@...com
Subject: Re: [PATCH] [rtl8723bs] Remove unnecessary atomic operations for
 continual_io_error

On Mon, Jan 19, 2026 at 04:06:06PM +0800, 2023060904@....edu.cn wrote:
> From: Changjun Zheng <guagua210311@...com>
> 
> continual_io_error is only accessed in SDIO IO single execution flow,
> no multi-thread race condition exists, so atomic operations are redundant.
> Change atomic_t to s32 and replace atomic_inc_return/atomic_set with normal ops.
> 
> Signed-off-by: Changjun Zheng <guagua210311@...com>
> ---
>  drivers/staging/rtl8723bs/core/rtw_io.c       | 16 ++++++++++++----
>  drivers/staging/rtl8723bs/include/drv_types.h |  2 +-
>  2 files changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/core/rtw_io.c b/drivers/staging/rtl8723bs/core/rtw_io.c
> index fe9f94001eed..95d42025807e 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_io.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_io.c
> @@ -135,11 +135,15 @@ int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct adapt
>  /*
>   * Increase and check if the continual_io_error of this @param dvobjprive is larger than MAX_CONTINUAL_IO_ERR
>   * @return true:
> - * @return false:
> + * @return false:
> +
> + * Note: Original implementation used atomic_inc_return for atomic increment.
> + * Reason for change: continual_io_error is only accessed in SDIO IO single execution flow,
> + * no race condition, so normal increment is safe (remove redundant atomic operation).

This is not needed, the git history should show this.

>   */
>  int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
>  {
> -	int error_count = atomic_inc_return(&dvobj->continual_io_error);
> +	s32 error_count = ++dvobj->continual_io_error;

No, please just put this in the caller, like was discussed already on
the list.  Please read the archives for details.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ