Skip to contentSkip to conversation

staging: rtl8723bs: remove unused diagnostic

PATCH In review Ethan Tidmore 4 participants 8 messages Jan 28 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover staging: rtl8723bs: remove unused diagnostic

This series performs a driver-wide audit and cleanup of dead diagnostic code within the rtl8723bs staging driver.

The vendor-originated code included a variety of diagnostic counters housed within 'struct debug_priv'. These counters were updated throughout the driver's hot paths—including MLME, receive, power control, and SDIO allocation—but were never read, exposed via debugfs, or utilized for any internal logic.

This series removes the write-only counters, the skeletal functions used to update them, and cleans up the resulting unused pointers and logic blocks.

Changes in v2:
- Expanded the series to include the removal of RX FIFO overflow logic in hal_com.c.

Ethan Tidmore (4):
staging: rtl8723bs: remove dead RX info reset logic
staging: rtl8723bs: remove dead RX FIFO overflow logic
staging: rtl8723bs: remove dead RX sequence logic
staging: rtl8723bs: remove unused struct debug_priv and all counters

 drivers/staging/rtl8723bs/core/rtw_mlme.c     | 12 -----
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c |  3 --
 drivers/staging/rtl8723bs/core/rtw_pwrctrl.c  |  6 +--
 drivers/staging/rtl8723bs/core/rtw_recv.c     | 23 +--------
 drivers/staging/rtl8723bs/hal/hal_com.c       | 19 --------
 drivers/staging/rtl8723bs/hal/rtl8723b_dm.c   |  7 ---
 .../staging/rtl8723bs/hal/rtl8723b_hal_init.c |  4 --
 drivers/staging/rtl8723bs/hal/sdio_halinit.c  |  8 +---
 drivers/staging/rtl8723bs/include/drv_types.h | 41 ----------------
 drivers/staging/rtl8723bs/include/hal_com.h   |  1 -
 drivers/staging/rtl8723bs/os_dep/os_intfs.c   | 14 ++----
 drivers/staging/rtl8723bs/os_dep/sdio_intf.c  | 48 +++++--------------
 12 files changed, 17 insertions(+), 169 deletions(-)
Signature · 1 line
2.52.0
#1 lore raw

PATCH v2 1/4 staging: rtl8723bs: remove dead RX info reset logic

The function rtw_reset_rx_info() and its associated counters in struct debug_priv are used to track AMPDU and management frame statistics that are never read by the driver.

Remove the unused function, the write-only struct members, and the now-unused pdbgpriv/psdpriv pointers in rtw_free_assoc_resources() to clean up the MLME code

---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 12 ------------
 1 file changed, 12 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme.c +0 -12
index f81a29cd6a78..411339ebab7e 100644
@@ -819,15 +819,6 @@ static void free_scanqueue(struct	mlme_priv *pmlmepriv)
 	spin_unlock_bh(&scan_queue->lock);
 }
 
-static void rtw_reset_rx_info(struct debug_priv *pdbgpriv)
-{
-	pdbgpriv->dbg_rx_ampdu_drop_count = 0;
-	pdbgpriv->dbg_rx_ampdu_forced_indicate_count = 0;
-	pdbgpriv->dbg_rx_ampdu_loss_count = 0;
-	pdbgpriv->dbg_rx_dup_mgt_frame_drop_count = 0;
-	pdbgpriv->dbg_rx_ampdu_window_shift_cnt = 0;
-}
-
 static void find_network(struct adapter *adapter)
 {
 	struct wlan_network *pwlan = NULL;
@@ -848,8 +839,6 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
 {
 	struct	mlme_priv *pmlmepriv = &adapter->mlmepriv;
 	struct wlan_network *tgt_network = &pmlmepriv->cur_network;
-	struct dvobj_priv *psdpriv = adapter->dvobj;
-	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
 
 	if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_AP_STATE)) {
 		struct sta_info *psta;
@@ -874,7 +863,6 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
 	if (lock_scanned_queue)
 		adapter->securitypriv.key_mask = 0;
 
-	rtw_reset_rx_info(pdbgpriv);
 }
 
 /* rtw_indicate_connect: the caller has to lock pmlmepriv->lock */
Signature · 1 line
2.52.0
#2 lore raw

PATCH v2 2/4 staging: rtl8723bs: remove dead RX FIFO overflow logic

In reply to Ethan Tidmore

The function rtw_hal_check_rxfifo_full() populates debug variables in struct debug_priv that are never read. These variables (dbg_rx_fifo_*) are write-only and the function itself is a skeletal implementation.

Additionally, remove a redundant hw_init_completed check in the caller rtl8723b_HalDmWatchDog(), as it is already covered by a guard clause.

Removing this dead code saves unnecessary I/O cycles and cleans up the driver's internal debug structures.

---
 drivers/staging/rtl8723bs/hal/hal_com.c     | 19 -------------------
 drivers/staging/rtl8723bs/hal/rtl8723b_dm.c |  7 -------
 drivers/staging/rtl8723bs/include/hal_com.h |  1 -
 3 files changed, 27 deletions(-)
drivers/staging/rtl8723bs/hal/hal_com.c +0 -19
index 70b5b289f9cb..fae251c332d3 100644
@@ -780,25 +780,6 @@ bool GetU1ByteIntegerFromStringInDecimal(char *Str, u8 *pInt)
 	return true;
 }
 
-void rtw_hal_check_rxfifo_full(struct adapter *adapter)
-{
-	struct dvobj_priv *psdpriv = adapter->dvobj;
-	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
-	int save_cnt = false;
-
-	/* switch counter to RX fifo */
-	rtw_write8(adapter, REG_RXERR_RPT+3, rtw_read8(adapter, REG_RXERR_RPT+3)|0xf0);
-	save_cnt = true;
-	/* todo: other chips */
-
-	if (save_cnt) {
-		/* rtw_write8(adapter, REG_RXERR_RPT+3, rtw_read8(adapter, REG_RXERR_RPT+3)|0xa0); */
-		pdbgpriv->dbg_rx_fifo_last_overflow = pdbgpriv->dbg_rx_fifo_curr_overflow;
-		pdbgpriv->dbg_rx_fifo_curr_overflow = rtw_read16(adapter, REG_RXERR_RPT);
-		pdbgpriv->dbg_rx_fifo_diff_overflow = pdbgpriv->dbg_rx_fifo_curr_overflow-pdbgpriv->dbg_rx_fifo_last_overflow;
-	}
-}
-
 static u32 Array_kfreemap[] = {
 	0xf8, 0xe,
 	0xf6, 0xc,
drivers/staging/rtl8723bs/hal/rtl8723b_dm.c +0 -7
index 928226679ab4..3e1ec33fe829 100644
@@ -137,13 +137,6 @@ void rtl8723b_HalDmWatchDog(struct adapter *Adapter)
 	fw_current_in_ps_mode = adapter_to_pwrctl(Adapter)->fw_current_in_ps_mode;
 	rtw_hal_get_hwreg(Adapter, HW_VAR_FWLPS_RF_ON, (u8 *)(&bFwPSAwake));
 
-	if (
-		(hw_init_completed == true) &&
-		((!fw_current_in_ps_mode) && bFwPSAwake)
-	) {
-		rtw_hal_check_rxfifo_full(Adapter);
-	}
-
 	/* ODM */
 	if (hw_init_completed == true) {
 		u8 bLinked = false;
drivers/staging/rtl8723bs/include/hal_com.h +0 -1
index 74d6c892c401..24e7fd8ee4dc 100644
@@ -136,7 +136,6 @@ void rtw_hal_update_sta_rate_mask(struct adapter *padapter, struct sta_info *pst
 
 void SetHwReg(struct adapter *padapter, u8 variable, u8 *val);
 void GetHwReg(struct adapter *padapter, u8 variable, u8 *val);
-void rtw_hal_check_rxfifo_full(struct adapter *adapter);
 
 u8 GetHalDefVar(struct adapter *adapter, enum hal_def_variable variable,
 		void *value);
Signature · 1 line
2.52.0
#3 lore raw

Re: [PATCH v2 2/4] staging: rtl8723bs: remove dead RX FIFO overflow logic

kernel test robot noticed the following build warnings:

Hi Ethan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Ethan-Tidmore/staging-rtl8723bs-remove-dead-RX-info-reset-logic/20260128-084338
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20260128004009.51095-3-ethantidmore06%40gmail.com
patch subject: [PATCH v2 2/4] staging: rtl8723bs: remove dead RX FIFO  overflow logic
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20260128/[email protected]/config)
compiler: sh4-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260128/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

drivers/staging/rtl8723bs/hal/rtl8723b_dm.c: In function 'rtl8723b_HalDmWatchDog':

>> drivers/staging/rtl8723bs/hal/rtl8723b_dm.c:127:14: warning: variable 'fw_current_in_ps_mode' set but not used [-Wunused-but-set-variable]
     127 |         bool fw_current_in_ps_mode = false;
         |              ^~~~~~~~~~~~~~~~~~~~~

vim +/fw_current_in_ps_mode +127 drivers/staging/rtl8723bs/hal/rtl8723b_dm.c

554c0a3abf216c Hans de Goede         2017-03-29  124  
554c0a3abf216c Hans de Goede         2017-03-29  125  void rtl8723b_HalDmWatchDog(struct adapter *Adapter)
554c0a3abf216c Hans de Goede         2017-03-29  126  {
90b69822a5cb6b Fabio M. De Francesco 2021-04-11 @127  	bool fw_current_in_ps_mode = false;
554c0a3abf216c Hans de Goede         2017-03-29  128  	bool bFwPSAwake = true;
554c0a3abf216c Hans de Goede         2017-03-29  129  	u8 hw_init_completed = false;
554c0a3abf216c Hans de Goede         2017-03-29  130  	struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
554c0a3abf216c Hans de Goede         2017-03-29  131  
554c0a3abf216c Hans de Goede         2017-03-29  132  	hw_init_completed = Adapter->hw_init_completed;
554c0a3abf216c Hans de Goede         2017-03-29  133  
554c0a3abf216c Hans de Goede         2017-03-29  134  	if (hw_init_completed == false)
554c0a3abf216c Hans de Goede         2017-03-29  135  		goto skip_dm;
554c0a3abf216c Hans de Goede         2017-03-29  136  
90b69822a5cb6b Fabio M. De Francesco 2021-04-11  137  	fw_current_in_ps_mode = adapter_to_pwrctl(Adapter)->fw_current_in_ps_mode;
554c0a3abf216c Hans de Goede         2017-03-29  138  	rtw_hal_get_hwreg(Adapter, HW_VAR_FWLPS_RF_ON, (u8 *)(&bFwPSAwake));
554c0a3abf216c Hans de Goede         2017-03-29  139  
554c0a3abf216c Hans de Goede         2017-03-29  140  	/* ODM */
554c0a3abf216c Hans de Goede         2017-03-29  141  	if (hw_init_completed == true) {
554c0a3abf216c Hans de Goede         2017-03-29  142  		u8 bLinked = false;
554c0a3abf216c Hans de Goede         2017-03-29  143  		u8 bsta_state = false;
14c77a18375db3 Nishka Dasgupta       2019-07-02  144  		bool bBtDisabled = true;
554c0a3abf216c Hans de Goede         2017-03-29  145  
554c0a3abf216c Hans de Goede         2017-03-29  146  		if (rtw_linked_check(Adapter)) {
554c0a3abf216c Hans de Goede         2017-03-29  147  			bLinked = true;
554c0a3abf216c Hans de Goede         2017-03-29  148  			if (check_fwstate(&Adapter->mlmepriv, WIFI_STATION_STATE))
554c0a3abf216c Hans de Goede         2017-03-29  149  				bsta_state = true;
554c0a3abf216c Hans de Goede         2017-03-29  150  		}
554c0a3abf216c Hans de Goede         2017-03-29  151  
554c0a3abf216c Hans de Goede         2017-03-29  152  		ODM_CmnInfoUpdate(&pHalData->odmpriv, ODM_CMNINFO_LINK, bLinked);
554c0a3abf216c Hans de Goede         2017-03-29  153  		ODM_CmnInfoUpdate(&pHalData->odmpriv, ODM_CMNINFO_STATION_STATE, bsta_state);
554c0a3abf216c Hans de Goede         2017-03-29  154  
554c0a3abf216c Hans de Goede         2017-03-29  155  		/* ODM_CmnInfoUpdate(&pHalData->odmpriv , ODM_CMNINFO_RSSI_MIN, pdmpriv->MinUndecoratedPWDBForDM); */
554c0a3abf216c Hans de Goede         2017-03-29  156  
d1f4b78027202d Nishka Dasgupta       2019-07-01  157  		bBtDisabled = hal_btcoex_IsBtDisabled(Adapter);
554c0a3abf216c Hans de Goede         2017-03-29  158  
a8fa78b8f49752 Javier F. Arias       2019-11-05  159  		ODM_CmnInfoUpdate(&pHalData->odmpriv, ODM_CMNINFO_BT_ENABLED,
c3a12cc1ec4c9c Javier F. Arias       2019-11-05  160  				  !bBtDisabled);
554c0a3abf216c Hans de Goede         2017-03-29  161  
554c0a3abf216c Hans de Goede         2017-03-29  162  		ODM_DMWatchdog(&pHalData->odmpriv);
554c0a3abf216c Hans de Goede         2017-03-29  163  	}
554c0a3abf216c Hans de Goede         2017-03-29  164  
554c0a3abf216c Hans de Goede         2017-03-29  165  skip_dm:
554c0a3abf216c Hans de Goede         2017-03-29  166  	return;
554c0a3abf216c Hans de Goede         2017-03-29  167  }
554c0a3abf216c Hans de Goede         2017-03-29  168  
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#4 lore raw

PATCH v2 3/4 staging: rtl8723bs: remove dead RX sequence logic

In reply to Ethan Tidmore

The function recv_indicatepkts_pkt_loss_cnt() is used to calculate values for dbg_rx_ampdu_loss_count, but this variable is never used anywhere in the driver.

Remove the function and its call site.

---
 drivers/staging/rtl8723bs/core/rtw_recv.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/staging/rtl8723bs/core/rtw_recv.c +0 -10
index 24cc4a9e0445..cc824427f9a8 100644
@@ -1861,15 +1861,6 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un
 
 }
 
-static void recv_indicatepkts_pkt_loss_cnt(struct debug_priv *pdbgpriv, u64 prev_seq, u64 current_seq)
-{
-	if (current_seq < prev_seq)
-		pdbgpriv->dbg_rx_ampdu_loss_count += (4096 + current_seq - prev_seq);
-	else
-		pdbgpriv->dbg_rx_ampdu_loss_count += (current_seq - prev_seq);
-
-}
-
 static int rtw_recv_indicatepkt(struct adapter *padapter, union recv_frame *precv_frame)
 {
 	struct recv_priv *precvpriv;
@@ -1937,7 +1928,6 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
 		prframe = (union recv_frame *)plist;
 		pattrib = &prframe->u.hdr.attrib;
 
-		recv_indicatepkts_pkt_loss_cnt(pdbgpriv, preorder_ctrl->indicate_seq, pattrib->seq_num);
 		preorder_ctrl->indicate_seq = pattrib->seq_num;
 
 	}
Signature · 1 line
2.52.0
#5 lore raw

PATCH v2 4/4 staging: rtl8723bs: remove unused struct debug_priv and all counters

In reply to Ethan Tidmore

The struct debug_priv is a collection of diagnostic counters that are updated throughout the driver's hot paths (RX/TX, MLME, Power Control, and SDIO) but are never read, exposed via debugfs, or used for logic.

This cleanup removes:
- The entire struct debug_priv definition and its instance in dvobj_priv.
- All write-only counter increments across the core, hal, and os_dep.
- Unused local pointers (psdpriv, pdbgpriv) that were only serving the dead diagnostic logic.
- Redundant logic blocks that only existed to update these counters.

---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c |  3 --
 drivers/staging/rtl8723bs/core/rtw_pwrctrl.c  |  6 +--
 drivers/staging/rtl8723bs/core/rtw_recv.c     | 13 +----
 .../staging/rtl8723bs/hal/rtl8723b_hal_init.c |  4 --
 drivers/staging/rtl8723bs/hal/sdio_halinit.c  |  8 +---
 drivers/staging/rtl8723bs/include/drv_types.h | 41 ----------------
 drivers/staging/rtl8723bs/os_dep/os_intfs.c   | 14 ++----
 drivers/staging/rtl8723bs/os_dep/sdio_intf.c  | 48 +++++--------------
 8 files changed, 17 insertions(+), 120 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +0 -3
index fa1e3ad59254..f4b50bfdb9d5 100644
@@ -438,8 +438,6 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 	u8 *pframe = precv_frame->u.hdr.rx_data;
 	struct sta_info *psta = rtw_get_stainfo(&padapter->stapriv, GetAddr2Ptr(pframe));
-	struct dvobj_priv *psdpriv = padapter->dvobj;
-	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
 
 	if (GetFrameType(pframe) != WIFI_MGT_TYPE)
 		return;
@@ -463,7 +461,6 @@ void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
 		if (GetRetry(pframe)) {
 			if (precv_frame->u.hdr.attrib.seq_num == psta->RxMgmtFrameSeqNum) {
 				/* drop the duplicate management frame */
-				pdbgpriv->dbg_rx_dup_mgt_frame_drop_count++;
 				return;
 			}
 		}
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +1 -5
index 0ef788abf403..f06d8bc6dac5 100644
@@ -139,8 +139,6 @@ static bool rtw_pwr_unassociated_idle(struct adapter *adapter)
 void rtw_ps_processor(struct adapter *padapter)
 {
 	struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
-	struct dvobj_priv *psdpriv = padapter->dvobj;
-	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
 	u32 ps_deny = 0;
 
 	mutex_lock(&adapter_to_pwrctl(padapter)->lock);
@@ -149,10 +147,8 @@ void rtw_ps_processor(struct adapter *padapter)
 	if (ps_deny != 0)
 		goto exit;
 
-	if (pwrpriv->bInSuspend) {/* system suspend or autosuspend */
-		pdbgpriv->dbg_ps_insuspend_cnt++;
+	if (pwrpriv->bInSuspend)
 		return;
-	}
 
 	pwrpriv->ps_processing = true;
 
drivers/staging/rtl8723bs/core/rtw_recv.c +1 -12
index cc824427f9a8..409dab008a1d 100644
@@ -1782,9 +1782,6 @@ static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
 
 static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_num)
 {
-	struct adapter *padapter = preorder_ctrl->padapter;
-	struct dvobj_priv *psdpriv = padapter->dvobj;
-	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
 	u8 wsize = preorder_ctrl->wsize_b;
 	u16 wend = (preorder_ctrl->indicate_seq + wsize - 1) % 4096u;
 
@@ -1810,7 +1807,6 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n
 			preorder_ctrl->indicate_seq = seq_num + 1 - wsize;
 		else
 			preorder_ctrl->indicate_seq = 0xFFF - (wsize - (seq_num + 1)) + 1;
-		pdbgpriv->dbg_rx_ampdu_window_shift_cnt++;
 	}
 
 	return true;
@@ -1907,8 +1903,6 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
 	int bPktInBuf = false;
 	struct recv_priv *precvpriv = &padapter->recvpriv;
 	struct __queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
-	struct dvobj_priv *psdpriv = padapter->dvobj;
-	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
 
 	/* spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); */
 	/* spin_lock(&ppending_recvframe_queue->lock); */
@@ -1918,7 +1912,6 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
 
 	/*  Handling some condition for forced indicate case. */
 	if (bforced == true) {
-		pdbgpriv->dbg_rx_ampdu_forced_indicate_count++;
 		if (list_empty(phead)) {
 			/*  spin_unlock_irqrestore(&ppending_recvframe_queue->lock, irql); */
 			/* spin_unlock(&ppending_recvframe_queue->lock); */
@@ -1988,8 +1981,6 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
 	struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
 	struct recv_reorder_ctrl *preorder_ctrl = prframe->u.hdr.preorder_ctrl;
 	struct __queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
-	struct dvobj_priv *psdpriv = padapter->dvobj;
-	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
 
 	if (!pattrib->amsdu) {
 		/* s1. */
@@ -2032,10 +2023,8 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
 	spin_lock_bh(&ppending_recvframe_queue->lock);
 
 	/* s2. check if winstart_b(indicate_seq) needs to been updated */
-	if (!check_indicate_seq(preorder_ctrl, pattrib->seq_num)) {
-		pdbgpriv->dbg_rx_ampdu_drop_count++;
+	if (!check_indicate_seq(preorder_ctrl, pattrib->seq_num))
 		goto _err_exit;
-	}
 
 
 	/* s3. Insert all packet into Reorder Queue to maintain its ordering. */
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +0 -4
index 054e2c2eab02..0527f36c6bfa 100644
@@ -304,8 +304,6 @@ s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool  bUsedWoWLANFw)
 	const struct firmware *fw;
 	struct device *device = dvobj_to_dev(padapter->dvobj);
 	u8 *fwfilepath;
-	struct dvobj_priv *psdpriv = padapter->dvobj;
-	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
 	u8 tmp_ps;
 
 	pFirmware = kzalloc(sizeof(struct rt_firmware), GFP_KERNEL);
@@ -324,8 +322,6 @@ s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool  bUsedWoWLANFw)
 	/* 2. read power_state = 0xA0[1:0] */
 	tmp_ps = rtw_read8(padapter, 0xa0);
 	tmp_ps &= 0x03;
-	if (tmp_ps != 0x01)
-		pdbgpriv->dbg_downloadfw_pwr_state_cnt++;
 
 	fwfilepath = "rtlwifi/rtl8723bs_nic.bin";
 
drivers/staging/rtl8723bs/hal/sdio_halinit.c +1 -7
index 4e81ef53dc47..a3940b61e177 100644
@@ -886,9 +886,6 @@ static void CardDisableRTL8723BSdio(struct adapter *padapter)
 
 u32 rtl8723bs_hal_deinit(struct adapter *padapter)
 {
-	struct dvobj_priv *psdpriv = padapter->dvobj;
-	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
-
 	if (padapter->hw_init_completed) {
 		if (adapter_to_pwrctl(padapter)->bips_processing) {
 			if (padapter->netif_up) {
@@ -921,18 +918,15 @@ u32 rtl8723bs_hal_deinit(struct adapter *padapter)
 				adapter_to_pwrctl(padapter)->pre_ips_type = 0;
 
 			} else {
-				pdbgpriv->dbg_carddisable_cnt++;
 				CardDisableRTL8723BSdio(padapter);
 
 				adapter_to_pwrctl(padapter)->pre_ips_type = 1;
 			}
 
 		} else {
-			pdbgpriv->dbg_carddisable_cnt++;
 			CardDisableRTL8723BSdio(padapter);
 		}
-	} else
-		pdbgpriv->dbg_deinit_fail_cnt++;
+	}
 
 	return _SUCCESS;
 }
drivers/staging/rtl8723bs/include/drv_types.h +0 -41

53 lines not on this page · raw message

drivers/staging/rtl8723bs/os_dep/os_intfs.c +3 -11
index bc02db13781c..fd47f324a8bc 100644
@@ -964,8 +964,6 @@ void rtw_ndev_destructor(struct net_device *ndev)
 void rtw_dev_unload(struct adapter *padapter)
 {
 	struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter);
-	struct dvobj_priv *pobjpriv = padapter->dvobj;
-	struct debug_priv *pdbgpriv = &pobjpriv->drv_dbg;
 	struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
 	u8 cnt = 0;
 
@@ -994,7 +992,6 @@ void rtw_dev_unload(struct adapter *padapter)
 			/* check HW status and SW state */
 			netdev_dbg(padapter->pnetdev,
 				   "%s: driver in IPS-FWLPS\n", __func__);
-			pdbgpriv->dbg_dev_unload_inIPS_cnt++;
 			LeaveAllPowerSaveMode(padapter);
 		} else {
 			netdev_dbg(padapter->pnetdev,
@@ -1077,24 +1074,21 @@ static void rtw_suspend_normal(struct adapter *padapter)
 void rtw_suspend_common(struct adapter *padapter)
 {
 	struct dvobj_priv *psdpriv = padapter->dvobj;
-	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
 	struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(psdpriv);
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
 	unsigned long start_time = jiffies;
 
 	netdev_dbg(padapter->pnetdev, " suspend start\n");
-	pdbgpriv->dbg_suspend_cnt++;
 
 	pwrpriv->bInSuspend = true;
 
 	while (pwrpriv->bips_processing)
 		msleep(1);
 
-	if ((!padapter->bup) || (padapter->bDriverStopped) || (padapter->bSurpriseRemoved)) {
-		pdbgpriv->dbg_suspend_error_cnt++;
+	if ((!padapter->bup) || (padapter->bDriverStopped) || (padapter->bSurpriseRemoved))
 		return;
-	}
+
 	rtw_ps_deny(padapter, PS_DENY_SUSPEND);
 
 	rtw_cancel_all_timer(padapter);
@@ -1123,7 +1117,6 @@ static int rtw_resume_process_normal(struct adapter *padapter)
 	struct pwrctrl_priv *pwrpriv;
 	struct mlme_priv *pmlmepriv;
 	struct dvobj_priv *psdpriv;
-	struct debug_priv *pdbgpriv;
 
 	int ret = _SUCCESS;
 
@@ -1136,7 +1129,7 @@ static int rtw_resume_process_normal(struct adapter *padapter)
 	pwrpriv = adapter_to_pwrctl(padapter);
 	pmlmepriv = &padapter->mlmepriv;
 	psdpriv = padapter->dvobj;
-	pdbgpriv = &psdpriv->drv_dbg;
+
 	/*  interface init */
 	/* if (sdio_init(adapter_to_dvobj(padapter)) != _SUCCESS) */
 	if ((padapter->intf_init) && (padapter->intf_init(adapter_to_dvobj(padapter)) != _SUCCESS)) {
@@ -1155,7 +1148,6 @@ static int rtw_resume_process_normal(struct adapter *padapter)
 
 	if (pm_netdev_open(pnetdev, true) != 0) {
 		ret = -1;
-		pdbgpriv->dbg_resume_error_cnt++;
 		goto exit;
 	}
 
drivers/staging/rtl8723bs/os_dep/sdio_intf.c +11 -37

112 lines not on this page · raw message

Signature · 1 line
2.52.0
#6 lore raw
In reply to Ethan Tidmore
Quoted 9 lines · Ethan Tidmore

This series performs a driver-wide audit and cleanup of dead diagnostic code within the rtl8723bs staging driver.

The vendor-originated code included a variety of diagnostic counters housed within 'struct debug_priv'. These counters were updated throughout the driver's hot paths—including MLME, receive, power control, and SDIO allocation—but were never read, exposed via debugfs, or utilized for any internal logic.

Quoted 7 lines

This series removes the write-only counters, the skeletal functions used to update them, and cleans up the resulting unused pointers and logic blocks.

Changes in v2:
- Expanded the series to include the removal of RX FIFO overflow logic in hal_com.c.

Please slow down and give people, and tools, a chance to review previous versions before sending new versions.

Take the time and review changes sent in by others as well while you wait. There is no rush here.

thanks,

greg k-h

#7 lore raw
In reply to Ethan Tidmore
Quoted 9 lines · Ethan Tidmore

This series performs a driver-wide audit and cleanup of dead diagnostic code within the rtl8723bs staging driver.

The vendor-originated code included a variety of diagnostic counters housed within 'struct debug_priv'. These counters were updated throughout the driver's hot paths—including MLME, receive, power control, and SDIO allocation—but were never read, exposed via debugfs, or utilized for any internal logic.

Quoted 8 lines

This series removes the write-only counters, the skeletal functions used to update them, and cleans up the resulting unused pointers and logic blocks.

Changes in v2:
- Expanded the series to include the removal of RX FIFO overflow logic in hal_com.c.

Please don't send multiple versions of a patch on the same day.

Anyway, kbuild bot complained so at least I don't have to review this now.

regards,
dan carpenter