linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] wifi: rtw89: 8852b: change debug mask of message of no TX resource
@ 2022-11-08  1:42 Ping-Ke Shih
  2022-11-08  1:51 ` Ping-Ke Shih
  2022-11-09  7:01 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Ping-Ke Shih @ 2022-11-08  1:42 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless

8852B has smaller TX FIFO than others in WiFi chip, so it would be buffer
full frequently, but it doesn't affect TX performance. However, it shows
verbose debug messages with RTW89_DBG_UNEXP mask that is used to indicate
abnormal behavior, so change debug mask to RTW89_DBG_TXRX for 8852B.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/pci.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c
index 07a2e23759f0b..7aa0af18cdd50 100644
--- a/drivers/net/wireless/realtek/rtw89/pci.c
+++ b/drivers/net/wireless/realtek/rtw89/pci.c
@@ -971,8 +971,10 @@ static u32 __rtw89_pci_check_and_reclaim_tx_resource(struct rtw89_dev *rtwdev,
 	struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv;
 	struct rtw89_pci_tx_ring *tx_ring = &rtwpci->tx_rings[txch];
 	struct rtw89_pci_tx_wd_ring *wd_ring = &tx_ring->wd_ring;
+	const struct rtw89_chip_info *chip = rtwdev->chip;
 	u32 bd_cnt, wd_cnt, min_cnt = 0;
 	struct rtw89_pci_rx_ring *rx_ring;
+	enum rtw89_debug_mask debug_mask;
 	u32 cnt;
 
 	rx_ring = &rtwpci->rx_rings[RTW89_RXCH_RPQ];
@@ -996,10 +998,20 @@ static u32 __rtw89_pci_check_and_reclaim_tx_resource(struct rtw89_dev *rtwdev,
 	bd_cnt = rtw89_pci_get_avail_txbd_num(tx_ring);
 	wd_cnt = wd_ring->curr_num;
 	min_cnt = min(bd_cnt, wd_cnt);
-	if (min_cnt == 0)
-		rtw89_debug(rtwdev, rtwpci->low_power ? RTW89_DBG_TXRX : RTW89_DBG_UNEXP,
+	if (min_cnt == 0) {
+		/* This message can be frequently shown in low power mode or
+		 * high traffic with 8852B, and we have recognized it as normal
+		 * behavior, so print with mask RTW89_DBG_TXRX in these situations.
+		 */
+		if (rtwpci->low_power || chip->chip_id == RTL8852B)
+			debug_mask = RTW89_DBG_TXRX;
+		else
+			debug_mask = RTW89_DBG_UNEXP;
+
+		rtw89_debug(rtwdev, debug_mask,
 			    "still no tx resource after reclaim: wd_cnt=%d bd_cnt=%d\n",
 			    wd_cnt, bd_cnt);
+	}
 
 out_unlock:
 	spin_unlock_bh(&rtwpci->trx_lock);
-- 
2.25.1


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

* RE: [PATCH v2] wifi: rtw89: 8852b: change debug mask of message of no TX resource
  2022-11-08  1:42 [PATCH v2] wifi: rtw89: 8852b: change debug mask of message of no TX resource Ping-Ke Shih
@ 2022-11-08  1:51 ` Ping-Ke Shih
  2022-11-09  7:01 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Ping-Ke Shih @ 2022-11-08  1:51 UTC (permalink / raw)
  To: Ping-Ke Shih, kvalo@kernel.org; +Cc: linux-wireless@vger.kernel.org



> -----Original Message-----
> From: Ping-Ke Shih <pkshih@realtek.com>
> Sent: Tuesday, November 8, 2022 9:43 AM
> To: kvalo@kernel.org
> Cc: linux-wireless@vger.kernel.org
> Subject: [PATCH v2] wifi: rtw89: 8852b: change debug mask of message of no TX resource
> 
> 8852B has smaller TX FIFO than others in WiFi chip, so it would be buffer
> full frequently, but it doesn't affect TX performance. However, it shows
> verbose debug messages with RTW89_DBG_UNEXP mask that is used to indicate
> abnormal behavior, so change debug mask to RTW89_DBG_TXRX for 8852B.
> 
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

Sorry, I forget to add changelog of v2.

v2: add comment to explain why we change debug mask for certain situations.

> ---
>  drivers/net/wireless/realtek/rtw89/pci.c | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c
> index 07a2e23759f0b..7aa0af18cdd50 100644
> --- a/drivers/net/wireless/realtek/rtw89/pci.c
> +++ b/drivers/net/wireless/realtek/rtw89/pci.c
> @@ -971,8 +971,10 @@ static u32 __rtw89_pci_check_and_reclaim_tx_resource(struct rtw89_dev *rtwdev,
>  	struct rtw89_pci *rtwpci = (struct rtw89_pci *)rtwdev->priv;
>  	struct rtw89_pci_tx_ring *tx_ring = &rtwpci->tx_rings[txch];
>  	struct rtw89_pci_tx_wd_ring *wd_ring = &tx_ring->wd_ring;
> +	const struct rtw89_chip_info *chip = rtwdev->chip;
>  	u32 bd_cnt, wd_cnt, min_cnt = 0;
>  	struct rtw89_pci_rx_ring *rx_ring;
> +	enum rtw89_debug_mask debug_mask;
>  	u32 cnt;
> 
>  	rx_ring = &rtwpci->rx_rings[RTW89_RXCH_RPQ];
> @@ -996,10 +998,20 @@ static u32 __rtw89_pci_check_and_reclaim_tx_resource(struct rtw89_dev *rtwdev,
>  	bd_cnt = rtw89_pci_get_avail_txbd_num(tx_ring);
>  	wd_cnt = wd_ring->curr_num;
>  	min_cnt = min(bd_cnt, wd_cnt);
> -	if (min_cnt == 0)
> -		rtw89_debug(rtwdev, rtwpci->low_power ? RTW89_DBG_TXRX : RTW89_DBG_UNEXP,
> +	if (min_cnt == 0) {
> +		/* This message can be frequently shown in low power mode or
> +		 * high traffic with 8852B, and we have recognized it as normal
> +		 * behavior, so print with mask RTW89_DBG_TXRX in these situations.
> +		 */
> +		if (rtwpci->low_power || chip->chip_id == RTL8852B)
> +			debug_mask = RTW89_DBG_TXRX;
> +		else
> +			debug_mask = RTW89_DBG_UNEXP;
> +
> +		rtw89_debug(rtwdev, debug_mask,
>  			    "still no tx resource after reclaim: wd_cnt=%d bd_cnt=%d\n",
>  			    wd_cnt, bd_cnt);
> +	}
> 
>  out_unlock:
>  	spin_unlock_bh(&rtwpci->trx_lock);
> --
> 2.25.1
> 
> 
> ------Please consider the environment before printing this e-mail.

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

* Re: [PATCH v2] wifi: rtw89: 8852b: change debug mask of message of no TX resource
  2022-11-08  1:42 [PATCH v2] wifi: rtw89: 8852b: change debug mask of message of no TX resource Ping-Ke Shih
  2022-11-08  1:51 ` Ping-Ke Shih
@ 2022-11-09  7:01 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2022-11-09  7:01 UTC (permalink / raw)
  To: Ping-Ke Shih; +Cc: linux-wireless

Ping-Ke Shih <pkshih@realtek.com> wrote:

> 8852B has smaller TX FIFO than others in WiFi chip, so it would be buffer
> full frequently, but it doesn't affect TX performance. However, it shows
> verbose debug messages with RTW89_DBG_UNEXP mask that is used to indicate
> abnormal behavior, so change debug mask to RTW89_DBG_TXRX for 8852B.
> 
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

Patch applied to wireless-next.git, thanks.

901c247f9687 wifi: rtw89: 8852b: change debug mask of message of no TX resource

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20221108014230.11068-1-pkshih@realtek.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2022-11-09  7:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-08  1:42 [PATCH v2] wifi: rtw89: 8852b: change debug mask of message of no TX resource Ping-Ke Shih
2022-11-08  1:51 ` Ping-Ke Shih
2022-11-09  7:01 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).