Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Luka Gejak" <luka.gejak@linux.dev>
To: "Zhao Li" <enderaoelyther@gmail.com>,
	"Ping-Ke Shih" <pkshih@realtek.com>
Cc: "neo_jou" <neo_jou@realtek.com>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Kalle Valo" <kvalo@kernel.org>,
	"Hans Ulli Kroll" <linux@ulli-kroll.de>,
	"Bitterblue Smith" <rtl8821cerfe2@gmail.com>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] wifi: rtw88: usb: stop RX work before unregistering hardware
Date: Fri, 30 Oct 2026 14:51:43 +0000	[thread overview]
Message-ID: <4a555879477e2c5b8eb2f2cd430157adef580461@linux.dev> (raw)
In-Reply-To: <20261028141904.8707-1-enderaoelyther@gmail.com>

Hi Zhao,

Thanks for the fix. One comment below.

October 28, 2026 at 3:19 PM, "Zhao Li" <enderaoelyther@gmail.com> wrote:

> diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
> index 64e1c3420e0a..1d2759eb96bf 100644
> --- a/drivers/net/wireless/realtek/rtw88/usb.c
> +++ b/drivers/net/wireless/realtek/rtw88/usb.c
> @@ -1370,7 +1370,10 @@ void rtw_usb_disconnect(struct usb_interface *intf)
>       rtwdev = hw->priv;
>       rtwusb = rtw_get_usb_priv(rtwdev);
>
> +     /* Stop deferred resubmission before killing the active RX URBs. */
> +     disable_work_sync(&rtwusb->rx_urb_work);

As far as I can see, rx_urb_work can't bring an URB back at this point.
rtw88 doesn't set soft_unbind, so the USB core disables the endpoints
before it calls the driver:

        usb_unbind_interface()
          usb_disable_interface()
            usb_disable_endpoint()
              ep->enabled = 0;
          driver->disconnect()
            rtw_usb_disconnect()

After that usb_submit_urb() on the RX pipe fails for the rest of the RX
teardown, and a failed submit only queues the work again on -ENOMEM. So I
think cancel_work_sync() on rx_work alone already closes the race, and
the same change would then work for the older stable trees too.

Keeping disable_work_sync() doesn't hurt, but then the commit message
shouldn't say the work can restart a killed URB. Or did I miss a path
where we get here with the endpoints still enabled?

Best regards,
Luka Gejak

      reply	other threads:[~2026-10-30 14:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 14:19 [PATCH] wifi: rtw88: usb: stop RX work before unregistering hardware Zhao Li
2026-10-30 14:51 ` Luka Gejak [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=4a555879477e2c5b8eb2f2cd430157adef580461@linux.dev \
    --to=luka.gejak@linux.dev \
    --cc=enderaoelyther@gmail.com \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@ulli-kroll.de \
    --cc=neo_jou@realtek.com \
    --cc=pkshih@realtek.com \
    --cc=rtl8821cerfe2@gmail.com \
    --cc=s.hauer@pengutronix.de \
    --cc=stable@vger.kernel.org \
    /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