Search Linux Wireless

Re: [PATCH v2 2/2] wifi: rtw88: use ieee80211_purge_tx_queue() to purge TX skb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 06, 2024 at 03:43:24AM +0000, Ping-Ke Shih wrote:
> Ladislav Michl <oss-lists@xxxxxxxxx> 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.

	ladis




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux