[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025121803-overeater-playset-6017@gregkh>
Date: Thu, 18 Dec 2025 15:37:25 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: cjz <guagua210311@...com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] rtl8723bs: Replace atomic_t with int for
continual_io_error (no concurrency)
On Thu, Dec 18, 2025 at 10:16:55PM +0800, cjz wrote:
> From: changjunzheng <guagua210311@...com>
>
> The 'continual_io_error' variable is defined as atomic_t, but all call sites
> of rtw_inc_and_chk_continual_io_error/rtw_reset_continual_io_error are in
> process context (sdio_ops_linux.c/sdio_intf.c, SDIO read/write retry logic).
> There is no interrupt/thread concurrency modifying this variable, so atomic
> operations are unnecessary and introduce slight performance overhead.
>
> This change replaces atomic_t with a normal int, and replaces atomic_inc_return()/atomic_set()
> with ordinary increment/assignment, keeping all functional logic unchanged.
>
> Signed-off-by: changjunzheng <guagua210311@...com>
> ---
> drivers/staging/rtl8723bs/core/rtw_io.c | 10 +++-------
> drivers/staging/rtl8723bs/include/drv_types.h | 2 +-
> 2 files changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_io.c b/drivers/staging/rtl8723bs/core/rtw_io.c
> index fe9f94001eed..0f52710e6d3a 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_io.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_io.c
> @@ -139,16 +139,12 @@ int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct adapt
> */
> int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
> {
> - int error_count = atomic_inc_return(&dvobj->continual_io_error);
> -
> - if (error_count > MAX_CONTINUAL_IO_ERR)
> - return true;
> -
> - return false;
> + dvobj->continual_io_error++;
> + return (dvobj->continual_io_error > MAX_CONTINUAL_IO_ERR);
> }
>
> /* Set the continual_io_error of this @param dvobjprive to 0 */
> void rtw_reset_continual_io_error(struct dvobj_priv *dvobj)
> {
> - atomic_set(&dvobj->continual_io_error, 0);
> + dvobj->continual_io_error = 0;
> }
> diff --git a/drivers/staging/rtl8723bs/include/drv_types.h b/drivers/staging/rtl8723bs/include/drv_types.h
> index f86180dc350c..bd7bb5828d56 100644
> --- a/drivers/staging/rtl8723bs/include/drv_types.h
> +++ b/drivers/staging/rtl8723bs/include/drv_types.h
> @@ -279,7 +279,7 @@ struct dvobj_priv {
> u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */
>
> u8 irq_alloc;
> - atomic_t continual_io_error;
> + int continual_io_error;
>
> atomic_t disable_func;
>
> --
> 2.43.0
>
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:
- This looks like a new version of a previously submitted patch, but you
did not list below the --- line any changes from the previous version.
Please read the section entitled "The canonical patch format" in the
kernel file, Documentation/process/submitting-patches.rst for what
needs to be done here to properly describe this.
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
Powered by blists - more mailing lists