All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: petter@technux.se
Cc: linux-wireless@vger.kernel.org, s.hauer@pengutronix.de,
	Larry.Finger@lwfinger.net, andreas@fatal.se, g0000ga@gmail.com,
	iam@valdikss.org.ru, kernel@pengutronix.de, linux@ulli-kroll.de,
	morrownr@gmail.com, mr.nuke.me@gmail.com, pkshih@realtek.com,
	tpkuester@gmail.com, Petter Mabacker <petter.mabacker@esab.se>
Subject: Re: [PATCH] wifi: rtw88: usb: Make work queues high prio
Date: Tue, 30 May 2023 13:25:39 +0300	[thread overview]
Message-ID: <87zg5mjeu4.fsf@kernel.org> (raw)
In-Reply-To: <20230530091532.2711675-1-petter@technux.se> (petter's message of "Tue, 30 May 2023 11:15:32 +0200")

petter@technux.se writes:

> From: Petter Mabacker <petter.mabacker@esab.se>
>
> The rtw8822cu driver have problem to handle high rx or tx rates compared
> with high load (such as high I/O) on slower systems, such as for example
> i.MX6 SoloX and similar platforms.
>
> The problems are more frequent when having the access point close to the
> device. On slower systems it's often enough to download a large file,
> combined with generating I/O load to trigger:
>
> [  374.763424] rtw_8822cu 1-1.2:1.2: failed to get tx report from firmware
> [  377.771790] rtw_8822cu 1-1.2:1.2: failed to send h2c command
> [  407.813460] rtw_8822cu 1-1.2:1.2: firmware failed to report density after scan
> [  414.965826] rtw_8822cu 1-1.2:1.2: failed to send h2c command
> [  444.993462] rtw_8822cu 1-1.2:1.2: firmware failed to report density after scan
> [  452.144551] rtw_8822cu 1-1.2:1.2: failed to send h2c command
> [  482.183445] rtw_8822cu 1-1.2:1.2: firmware failed to report density after scan
> [  489.426263] rtw_8822cu 1-1.2:1.2: failed to send h2c command
>
> Another way is to simply perform a wifi rescan.
>
> Benchmarking shows that setting a high prio workqueue for tx/rx will
> significally improve things. Also compared alloc_workqueue with
> alloc_ordered_workqueue, but even thou the later seems to slightly
> improve things it's still quite easy to reproduce the above issues. So
> that leads to the decision to go for alloc_workqueue.
>
> Thanks to Ping-Ke Shih <pkshih@realtek.com> that came up with the idea
> of exploring tweaking of the work queue's within a similar discussion.
>
> Fixes: a82dfd33d1237 ("wifi: rtw88: Add common USB chip support")
> Signed-off-by: Petter Mabacker <petter.mabacker@esab.se>
> ---
>  drivers/net/wireless/realtek/rtw88/usb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
> index 44a5fafb9905..bfe0845528ec 100644
> --- a/drivers/net/wireless/realtek/rtw88/usb.c
> +++ b/drivers/net/wireless/realtek/rtw88/usb.c
> @@ -716,7 +716,7 @@ static int rtw_usb_init_rx(struct rtw_dev *rtwdev)
>  	struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev);
>  	int i;
>  
> -	rtwusb->rxwq = create_singlethread_workqueue("rtw88_usb: rx wq");
> +	rtwusb->rxwq = alloc_workqueue("rtw88_usb: rx wq", WQ_UNBOUND | WQ_HIGHPRI, 0);
>  	if (!rtwusb->rxwq) {
>  		rtw_err(rtwdev, "failed to create RX work queue\n");
>  		return -ENOMEM;
> @@ -750,7 +750,7 @@ static int rtw_usb_init_tx(struct rtw_dev *rtwdev)
>  	struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev);
>  	int i;
>  
> -	rtwusb->txwq = create_singlethread_workqueue("rtw88_usb: tx wq");
> +	rtwusb->txwq = alloc_workqueue("rtw88_usb: tx wq", WQ_UNBOUND | WQ_HIGHPRI, 0);
>  	if (!rtwusb->txwq) {
>  		rtw_err(rtwdev, "failed to create TX work queue\n");
>  		return -ENOMEM;

Should this workqueue be ordered or not? Please check Tejun's patchset
about using ordered queues:

https://lore.kernel.org/lkml/20230421025046.4008499-1-tj@kernel.org/

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

  reply	other threads:[~2023-05-30 10:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30  9:15 [PATCH] wifi: rtw88: usb: Make work queues high prio petter
2023-05-30 10:25 ` Kalle Valo [this message]
2023-05-30 13:09   ` petter
2023-05-31  0:44     ` Ping-Ke Shih
2023-06-12 13:40     ` petter

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=87zg5mjeu4.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=andreas@fatal.se \
    --cc=g0000ga@gmail.com \
    --cc=iam@valdikss.org.ru \
    --cc=kernel@pengutronix.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@ulli-kroll.de \
    --cc=morrownr@gmail.com \
    --cc=mr.nuke.me@gmail.com \
    --cc=petter.mabacker@esab.se \
    --cc=petter@technux.se \
    --cc=pkshih@realtek.com \
    --cc=s.hauer@pengutronix.de \
    --cc=tpkuester@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.