public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Su Hui <suhui@nfschina.com>,
	"Jes.Sorensen@gmail.com" <Jes.Sorensen@gmail.com>,
	"kvalo@kernel.org" <kvalo@kernel.org>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: RE: [PATCH] wifi: rtl8xxxu: correct the error value of 'timeout'
Date: Tue, 14 Nov 2023 06:42:50 +0000	[thread overview]
Message-ID: <e8b847437ab242d18108d9364360bb8a@realtek.com> (raw)
In-Reply-To: <20231113054917.96894-1-suhui@nfschina.com>



> -----Original Message-----
> From: Su Hui <suhui@nfschina.com>
> Sent: Monday, November 13, 2023 1:49 PM
> To: Jes.Sorensen@gmail.com; kvalo@kernel.org
> Cc: Su Hui <suhui@nfschina.com>; linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org;
> kernel-janitors@vger.kernel.org
> Subject: [PATCH] wifi: rtl8xxxu: correct the error value of 'timeout'
> 
> When 'rtl8xxxu_dma_agg_pages <= page_thresh', 'timeout' should equal to
> 'page_thresh' rather than '4'. Change the code order to fix this problem.
> 
> Fixes: 614e389f36a9 ("rtl8xxxu: gen1: Set aggregation timeout (REG_RXDMA_AGG_PG_TH + 1) as well")

I think this should fix
Fixes: fd83f1227826 ("rtl8xxxu: gen1: Add module parameters to adjust DMA aggregation parameters")

> Signed-off-by: Su Hui <suhui@nfschina.com>
> ---
>  .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c    | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> index 43ee7592bc6e..9cab8b1dc486 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> @@ -4757,6 +4757,12 @@ void rtl8xxxu_gen1_init_aggregation(struct rtl8xxxu_priv *priv)
>          *   RxAggPageTimeout = 4 or 6 (absolute time 34ms/(2^6))
>          */
> 
> +       /* REG_RXDMA_AGG_PG_TH + 1 seems to be the timeout register on
> +        * gen2 chips and rtl8188eu. The rtl8723au seems unhappy if we
> +        * don't set it, so better set both.
> +        */
> +       timeout = 4;
> +
>         page_thresh = (priv->fops->rx_agg_buf_size / 512);
>         if (rtl8xxxu_dma_agg_pages >= 0) {
>                 if (rtl8xxxu_dma_agg_pages <= page_thresh)

The logic here is:

	page_thresh = (priv->fops->rx_agg_buf_size / 512);
	if (rtl8xxxu_dma_agg_pages >= 0) {
		if (rtl8xxxu_dma_agg_pages <= page_thresh)
			timeout = page_thresh;

Do you know why 'timeout = page_thresh;'? Intuitively, units of 'timeout' and
'thresh' are different. Maybe, we should correct here instead?



  reply	other threads:[~2023-11-14  6:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13  5:49 [PATCH] wifi: rtl8xxxu: correct the error value of 'timeout' Su Hui
2023-11-14  6:42 ` Ping-Ke Shih [this message]
2023-11-14  9:17   ` Su Hui
2023-11-20 12:31   ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e8b847437ab242d18108d9364360bb8a@realtek.com \
    --to=pkshih@realtek.com \
    --cc=Jes.Sorensen@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=suhui@nfschina.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox