[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aW3qZahKi7UVQI7A@stanley.mountain>
Date: Mon, 19 Jan 2026 11:25:09 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: 2023060904@....edu.cn
Cc: gregkh@...uxfoundation.org, 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.
So you're saying that sd_read32() can only be called by one thread at a
time. What sort of locking enforces this? I don't see any at first
glance, but I also don't want to invest a lot of time into looking for
it. Please explain it clearly in the commit message so reviewers can
easily check.
What's the motivation for this change?
>
> 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).
The history goes in the commit message not the comments.
regards,
dan carpenter
Powered by blists - more mailing lists