Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH 1/3] rtl8723bs: io: Add independent rtw_check_continual_io_error function
       [not found] <20260110101801.5820-1-2023060904@ycu.edu.cn>
@ 2026-01-10 10:17 ` 2023060904
  2026-01-10 13:22   ` Greg KH
  2026-01-10 10:17 ` [PATCH 2/3] rtl8723bs: sdio: Use local error_count instead of global variable 2023060904
  2026-01-10 10:18 ` [PATCH 3/3] rtl8723bs: io: Remove redundant global continual_io_error variable 2023060904
  2 siblings, 1 reply; 5+ messages in thread
From: 2023060904 @ 2026-01-10 10:17 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, 2023060904, guagua210311

From: changjunzheng <guagua210311@qq.com>

Add a new function to check if the error count exceeds the MAX_CONTINUAL_IO_ERR
threshold. This function follows the single responsibility principle and
prepares for the subsequent removal of the global continual_io_error variable.

Changelog v3 -> v4:
1. Split the single v3 patch into 4 logical patches (per Greg KH's request)
2. Fix all coding style errors (trailing spaces, missing assignment spaces, indentation)
3. Add clear, purpose-driven commit messages for each patch
4. Add version changelog as required by kernel documentation
5. Add blank line before new function declaration to comply with coding style

Signed-off-by: changjunzheng <guagua210311@qq.com>
---
 drivers/staging/rtl8723bs/core/rtw_io.c    | 16 ++--------------
 drivers/staging/rtl8723bs/include/rtw_io.h |  3 +--
 2 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_io.c b/drivers/staging/rtl8723bs/core/rtw_io.c
index 0f52710e6d3a..cd455cfcf046 100644
--- a/drivers/staging/rtl8723bs/core/rtw_io.c
+++ b/drivers/staging/rtl8723bs/core/rtw_io.c
@@ -132,19 +132,7 @@ int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct adapt
 	return _SUCCESS;
 }
 
-/*
- * Increase and check if the continual_io_error of this @param dvobjprive is larger than MAX_CONTINUAL_IO_ERR
- * @return true:
- * @return false:
- */
-int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
-{
-	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)
+bool rtw_check_continual_io_error(int error_count)
 {
-	dvobj->continual_io_error = 0;
+	return (error_count > MAX_CONTINUAL_IO_ERR) ? true : false;
 }
diff --git a/drivers/staging/rtl8723bs/include/rtw_io.h b/drivers/staging/rtl8723bs/include/rtw_io.h
index adf1de4d7924..8ae8849f5fd9 100644
--- a/drivers/staging/rtl8723bs/include/rtw_io.h
+++ b/drivers/staging/rtl8723bs/include/rtw_io.h
@@ -48,8 +48,6 @@ struct	intf_hdl {
 #define SD_IO_TRY_CNT (8)
 #define MAX_CONTINUAL_IO_ERR SD_IO_TRY_CNT
 
-int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj);
-void rtw_reset_continual_io_error(struct dvobj_priv *dvobj);
 
 struct io_priv {
 
@@ -70,5 +68,6 @@ extern int rtw_write32(struct adapter *adapter, u32 addr, u32 val);
 extern u32 rtw_write_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
 
 int rtw_init_io_priv(struct adapter *padapter, void (*set_intf_ops)(struct adapter *padapter, struct _io_ops *pops));
+bool rtw_check_continual_io_error(int error_count);
 
 #endif	/* _RTL8711_IO_H_ */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] rtl8723bs: sdio: Use local error_count instead of global variable
       [not found] <20260110101801.5820-1-2023060904@ycu.edu.cn>
  2026-01-10 10:17 ` [PATCH 1/3] rtl8723bs: io: Add independent rtw_check_continual_io_error function 2023060904
@ 2026-01-10 10:17 ` 2023060904
  2026-01-10 13:24   ` Greg KH
  2026-01-10 10:18 ` [PATCH 3/3] rtl8723bs: io: Remove redundant global continual_io_error variable 2023060904
  2 siblings, 1 reply; 5+ messages in thread
From: 2023060904 @ 2026-01-10 10:17 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, 2023060904, guagua210311

From: changjunzheng <guagua210311@qq.com>

Replace the global continual_io_error variable with a local error_count in
sd_read32 and sd_write32 functions. This eliminates cross-function dependency
on the global variable and keeps the error counting logic isolated to each
IO operation.

Changelog v3 -> v4:
1. Split the single v3 patch into 4 logical patches (per Greg KH's request)
2. Fix all coding style errors (trailing spaces, missing assignment spaces, indentation)
3. Add clear, purpose-driven commit messages for each patch
4. Add version changelog as required by kernel documentation

Signed-off-by: changjunzheng <guagua210311@qq.com>
---
 .../staging/rtl8723bs/os_dep/sdio_ops_linux.c    | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
index 5dc00e9117ae..571a2c6fc37a 100644
--- a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
@@ -207,7 +207,7 @@ u32 sd_read32(struct intf_hdl *pintfhdl, u32 addr, s32 *err)
 
 	if (err && *err) {
 		int i;
-
+		int error_count = 0;
 		*err = 0;
 		for (i = 0; i < SD_IO_TRY_CNT; i++) {
 			if (claim_needed)
@@ -217,13 +217,13 @@ u32 sd_read32(struct intf_hdl *pintfhdl, u32 addr, s32 *err)
 				sdio_release_host(func);
 
 			if (*err == 0) {
-				rtw_reset_continual_io_error(psdiodev);
+				error_count=0;
 				break;
 			} else {
 				if ((-ESHUTDOWN == *err) || (-ENODEV == *err))
 					padapter->bSurpriseRemoved = true;
-
-				if (rtw_inc_and_chk_continual_io_error(psdiodev) == true) {
+				error_count++; 
+				if (rtw_check_continual_io_error(error_count) == true) {
 					padapter->bSurpriseRemoved = true;
 					break;
 				}
@@ -284,7 +284,7 @@ void sd_write32(struct intf_hdl *pintfhdl, u32 addr, u32 v, s32 *err)
 
 	if (err && *err) {
 		int i;
-
+		int error_count = 0; 
 		*err = 0;
 		for (i = 0; i < SD_IO_TRY_CNT; i++) {
 			if (claim_needed)
@@ -292,14 +292,16 @@ void sd_write32(struct intf_hdl *pintfhdl, u32 addr, u32 v, s32 *err)
 			sdio_writel(func, v, addr, err);
 			if (claim_needed)
 				sdio_release_host(func);
+
 			if (*err == 0) {
-				rtw_reset_continual_io_error(psdiodev);
+				error_count = 0; 
 				break;
 			} else {
 				if ((-ESHUTDOWN == *err) || (-ENODEV == *err))
 					padapter->bSurpriseRemoved = true;
 
-				if (rtw_inc_and_chk_continual_io_error(psdiodev) == true) {
+				error_count++; 
+				if (rtw_check_continual_io_error(error_count) == true) { 
 					padapter->bSurpriseRemoved = true;
 					break;
 				}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] rtl8723bs: io: Remove redundant global continual_io_error variable
       [not found] <20260110101801.5820-1-2023060904@ycu.edu.cn>
  2026-01-10 10:17 ` [PATCH 1/3] rtl8723bs: io: Add independent rtw_check_continual_io_error function 2023060904
  2026-01-10 10:17 ` [PATCH 2/3] rtl8723bs: sdio: Use local error_count instead of global variable 2023060904
@ 2026-01-10 10:18 ` 2023060904
  2 siblings, 0 replies; 5+ messages in thread
From: 2023060904 @ 2026-01-10 10:18 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, 2023060904, guagua210311

From: changjunzheng <guagua210311@qq.com>

Remove the global continual_io_error member from struct dvobj_priv, as it is
no longer used after the local error_count logic is adopted in sdio functions.
This reduces unnecessary memory usage and simplifies the dvobj_priv structure.

Changelog v3 -> v4:
1. Split the single v3 patch into 4 logical patches (per Greg KH's request)
2. Fix all coding style errors (trailing spaces, missing assignment spaces, indentation)
3. Add clear, purpose-driven commit messages for each patch
4. Add version changelog as required by kernel documentation

Signed-off-by: changjunzheng <guagua210311@qq.com>
---
 drivers/staging/rtl8723bs/include/drv_types.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/include/drv_types.h b/drivers/staging/rtl8723bs/include/drv_types.h
index bd7bb5828d56..de4bec961671 100644
--- a/drivers/staging/rtl8723bs/include/drv_types.h
+++ b/drivers/staging/rtl8723bs/include/drv_types.h
@@ -279,7 +279,6 @@ struct dvobj_priv {
 	u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */
 
 	u8 irq_alloc;
-	int continual_io_error;
 
 	atomic_t disable_func;
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] rtl8723bs: io: Add independent rtw_check_continual_io_error function
  2026-01-10 10:17 ` [PATCH 1/3] rtl8723bs: io: Add independent rtw_check_continual_io_error function 2023060904
@ 2026-01-10 13:22   ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2026-01-10 13:22 UTC (permalink / raw)
  To: 2023060904; +Cc: linux-staging, linux-kernel, guagua210311

On Sat, Jan 10, 2026 at 06:17:58PM +0800, 2023060904@ycu.edu.cn wrote:
> From: changjunzheng <guagua210311@qq.com>

Please use your real name (either in native characters, or not, but with
spaces where correct.)

> Add a new function to check if the error count exceeds the MAX_CONTINUAL_IO_ERR
> threshold. This function follows the single responsibility principle and
> prepares for the subsequent removal of the global continual_io_error variable.
> 
> Changelog v3 -> v4:
> 1. Split the single v3 patch into 4 logical patches (per Greg KH's request)
> 2. Fix all coding style errors (trailing spaces, missing assignment spaces, indentation)
> 3. Add clear, purpose-driven commit messages for each patch
> 4. Add version changelog as required by kernel documentation
> 5. Add blank line before new function declaration to comply with coding style

I think my bot pointed you at the documentation, that says this all goes
below the --- line, right?

And what about the changes from 1 -> 2 and 2 -> 3?

Please fix up and resend a new series (v5?)

Also, the subject line does not have the version in it :(

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/3] rtl8723bs: sdio: Use local error_count instead of global variable
  2026-01-10 10:17 ` [PATCH 2/3] rtl8723bs: sdio: Use local error_count instead of global variable 2023060904
@ 2026-01-10 13:24   ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2026-01-10 13:24 UTC (permalink / raw)
  To: 2023060904; +Cc: linux-staging, linux-kernel, guagua210311

On Sat, Jan 10, 2026 at 06:17:59PM +0800, 2023060904@ycu.edu.cn wrote:
> From: changjunzheng <guagua210311@qq.com>
> 
> Replace the global continual_io_error variable with a local error_count in
> sd_read32 and sd_write32 functions. This eliminates cross-function dependency
> on the global variable and keeps the error counting logic isolated to each
> IO operation.
> 
> Changelog v3 -> v4:
> 1. Split the single v3 patch into 4 logical patches (per Greg KH's request)
> 2. Fix all coding style errors (trailing spaces, missing assignment spaces, indentation)
> 3. Add clear, purpose-driven commit messages for each patch
> 4. Add version changelog as required by kernel documentation
> 
> Signed-off-by: changjunzheng <guagua210311@qq.com>
> ---
>  .../staging/rtl8723bs/os_dep/sdio_ops_linux.c    | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
> index 5dc00e9117ae..571a2c6fc37a 100644
> --- a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
> +++ b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
> @@ -207,7 +207,7 @@ u32 sd_read32(struct intf_hdl *pintfhdl, u32 addr, s32 *err)
>  
>  	if (err && *err) {
>  		int i;
> -
> +		int error_count = 0;
>  		*err = 0;
>  		for (i = 0; i < SD_IO_TRY_CNT; i++) {
>  			if (claim_needed)
> @@ -217,13 +217,13 @@ u32 sd_read32(struct intf_hdl *pintfhdl, u32 addr, s32 *err)
>  				sdio_release_host(func);
>  
>  			if (*err == 0) {
> -				rtw_reset_continual_io_error(psdiodev);
> +				error_count=0;

Always run checkpatch.pl on your submissions so that you don't get
grumpy maintainers asking you why you didn't run checkpatch.pl on your
submission :)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-01-10 20:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260110101801.5820-1-2023060904@ycu.edu.cn>
2026-01-10 10:17 ` [PATCH 1/3] rtl8723bs: io: Add independent rtw_check_continual_io_error function 2023060904
2026-01-10 13:22   ` Greg KH
2026-01-10 10:17 ` [PATCH 2/3] rtl8723bs: sdio: Use local error_count instead of global variable 2023060904
2026-01-10 13:24   ` Greg KH
2026-01-10 10:18 ` [PATCH 3/3] rtl8723bs: io: Remove redundant global continual_io_error variable 2023060904

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox