From: Ping-Ke Shih <pkshih@realtek.com>
To: Ladislav Michl <oss-lists@triops.cz>
Cc: "johannes@sipsolutions.net" <johannes@sipsolutions.net>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"pbrobinson@gmail.com" <pbrobinson@gmail.com>
Subject: RE: [PATCH v2 2/2] wifi: rtw88: use ieee80211_purge_tx_queue() to purge TX skb
Date: Thu, 7 Nov 2024 00:17:14 +0000 [thread overview]
Message-ID: <5e49875a73214c89bb6220ddb54a1c15@realtek.com> (raw)
In-Reply-To: <Zys33cLsOuMGaRek@lenoch>
Ladislav Michl <oss-lists@triops.cz> wrote:
> On Wed, Nov 06, 2024 at 03:43:24AM +0000, Ping-Ke Shih wrote:
> > Ladislav Michl <oss-lists@triops.cz> wrote:
> > > On Thu, Aug 22, 2024 at 09:42:55AM +0800, Ping-Ke Shih wrote:
> > > > When removing kernel modules by:
> > > > rmmod rtw88_8723cs rtw88_8703b rtw88_8723x rtw88_sdio rtw88_core
> > > >
> > > > Driver uses skb_queue_purge() to purge TX skb, but not report tx status
> > > > causing "Have pending ack frames!" warning. Use ieee80211_purge_tx_queue()
> > > > to correct this.
> > > >
> > > > Since ieee80211_purge_tx_queue() doesn't take locks, to prevent racing
> > > > between TX work and purge TX queue, flush and destroy TX work in advance.
> > >
> > > A the very same problem exists in 6.1 kernel series, where this patch
> > > becomes oneliner:
> >
> > linux-6.1.y branch doesn't have patch that exports ieee80211_purge_tx_queue().
>
> Sure, but that one applies with a little fuzz.
>
> > > ---
> > > drivers/net/wireless/realtek/rtw88/main.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
> > > index 81f3112923f1..d7d4b0f05da9 100644
> > > --- a/drivers/net/wireless/realtek/rtw88/main.c
> > > +++ b/drivers/net/wireless/realtek/rtw88/main.c
> > > @@ -2145,7 +2145,7 @@ void rtw_core_deinit(struct rtw_dev *rtwdev)
> > >
> > > destroy_workqueue(rtwdev->tx_wq);
> > > spin_lock_irqsave(&rtwdev->tx_report.q_lock, flags);
> > > - skb_queue_purge(&rtwdev->tx_report.queue);
> > > + ieee80211_purge_tx_queue(rtwdev->hw, &rtwdev->tx_report.queue);
> > > skb_queue_purge(&rtwdev->coex.queue);
> > > spin_unlock_irqrestore(&rtwdev->tx_report.q_lock, flags);
> > >
> >
> > Seemingly, we need below also?
>
> Perhaps I was lucky enough I never hit it here, but for a sake of completeness
> it should be there as well.
>
> > diff --git a/drivers/net/wireless/realtek/rtw88/tx.c b/drivers/net/wireless/realtek/rtw88/tx.c
> > index 6ed470dd6f22..224678b9c38b 100644
> > --- a/drivers/net/wireless/realtek/rtw88/tx.c
> > +++ b/drivers/net/wireless/realtek/rtw88/tx.c
> > @@ -188,7 +188,7 @@ void rtw_tx_report_purge_timer(struct timer_list *t)
> > rtw_warn(rtwdev, "failed to get tx report from firmware\n");
> >
> > spin_lock_irqsave(&tx_report->q_lock, flags);
> > - skb_queue_purge(&tx_report->queue);
> > + ieee80211_purge_tx_queue(&tx_report->queue);
> > spin_unlock_irqrestore(&tx_report->q_lock, flags);
> > }
> >
> > Have you seen "Have pending ack frames!" in your side?
>
> Yes.
>
> > If so, use above changes to verify again on the latest kernel, and send a patch?
>
> Do you mean to send a patch against linux-6.1.y stable tree? I can see your
> patch in wireless-next only, so I do not think sending it to stable now would
> work. But in general, having this fix in the stable trees is a good idea.
I meant to send a patch to wireless-next. After it gets merged, send another
backport patchset related to the warning to 6.1 and 6.6.
prev parent reply other threads:[~2024-11-07 0:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-22 1:42 [PATCH v2 1/2] wifi: mac80211: export ieee80211_purge_tx_queue() for drivers Ping-Ke Shih
2024-08-22 1:42 ` [PATCH v2 2/2] wifi: rtw88: use ieee80211_purge_tx_queue() to purge TX skb Ping-Ke Shih
2024-08-22 1:48 ` Ping-Ke Shih
2024-09-20 6:27 ` Ping-Ke Shih
2024-09-20 6:33 ` Ping-Ke Shih
2024-09-20 12:58 ` Bitterblue Smith
2024-09-20 13:11 ` Ping-Ke Shih
2024-09-20 14:44 ` Bitterblue Smith
2024-11-05 10:54 ` Ladislav Michl
2024-11-06 3:43 ` Ping-Ke Shih
2024-11-06 9:33 ` Ladislav Michl
2024-11-07 0:17 ` Ping-Ke Shih [this message]
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=5e49875a73214c89bb6220ddb54a1c15@realtek.com \
--to=pkshih@realtek.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=oss-lists@triops.cz \
--cc=pbrobinson@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 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).