Re: [PATCH] wifi: rt2x00: prevent txstatus_timer rearm during USB uninitialize

From: bin luo

Date: Wed Dec 02 2026 - 07:05:54 EST


On Wed, Dec 02, 2026 at 09:05:39AM +0100, Stanislaw Gruszka wrote:
> On Wed, Dec 02, 2026 at 02:06:52PM +0800, Bin Luo (University of Electronic Science and Technology of China) wrote:
> > I tested this on an unmodified v7.4-rc4 kernel in QEMU using dummy_hcd +
> > raw_gadget emulating an RT2872 USB device (with kprobe tracing), and
>
> Could you provide link to the qemu driver and tests ?

Hi Stanislaw,

Sure! There is no custom QEMU patch needed -- it runs on a standard QEMU
guest using the kernel's built-in dummy_hcd + raw_gadget subsystem to
emulate an RT2872 USB device in userspace. I put the test program, minimal
valid-CRC rt2870.bin stub generator, ftrace kprobe script, and instructions
here:

https://gist.github.com/1121984919/2193f0ccb5af3539e96d55e5d43728fb

> > Would you prefer that I send a v2 that also guards stop_reading: with
> > DEVICE_STATE_INITIALIZED and kills anchored URBs after stopping
>
> No, while related, this looks like different issue, I would prefer
> a separate patch with own description for it.
>
> > txdone_work/txstatus_timer, or would you also like rt2800lib_disable_radio() /
> > rt2800_txstatus_timeout() adjusted to flush pending TX entries faster?
>
> I think assuring that tx queues are drained at the point we are canceling
> work would be better fix for original problem presented.

Makes sense, thank you! I have tested and sent a 2-patch v2 series
following your suggestions:

- [PATCH v2 1/2] wifi: rt2x00: set DEVICE_STATE_FLUSHING in
rt2x00queue_flush_queues()
- [PATCH v2 2/2] wifi: rt2x00: prevent TX_STA_FIFO URB resubmission on
error and teardown

With both applied, Queue 0 drains within ~50 ms on both sysfs unbind and
USB disconnect with zero flush or URB warnings.

Best regards,
Bin Luo