Page MenuHomeFreeBSD

rtwn: ensure TX work isn't scheduled during reset / abort
ClosedPublic

Authored by adrian on Nov 7 2024, 10:53 PM.
Referenced Files
F106199112: D47479.id146147.diff
Fri, Dec 27, 1:01 AM
Unknown Object (File)
Thu, Dec 12, 2:15 PM
Unknown Object (File)
Fri, Dec 6, 1:26 PM
Unknown Object (File)
Mon, Dec 2, 9:39 AM
Unknown Object (File)
Thu, Nov 28, 8:09 PM
Unknown Object (File)
Nov 19 2024, 3:43 AM
Unknown Object (File)
Nov 18 2024, 11:38 AM
Unknown Object (File)
Nov 16 2024, 1:29 AM
Subscribers

Details

Summary

Don't schedule work during reset / abort. For USB NICs, work
must not be scheduled during a call to rtwn_usb_abort_xfers(),
as then it'll cause the call to usbd_transfer_drain() to hang.

This fixes a hang I've been seeing where the NIC hits a TX timeout
and then the reset/re-init path is called. If data is scheduled
to be transmitted in that window, the call to usbd_transfer_drain()
would hang and require a hard reboot to recover.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 60441
Build 57325: arc lint + arc unit

Event Timeline

Could this also be relevant to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268687 (and possibly others if you search for rtwn on bugzilla)?

sys/dev/rtwn/if_rtwn_tx.c
270

No need for {}

In D47479#1082886, @bz wrote:

Could this also be relevant to https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268687 (and possibly others if you search for rtwn on bugzilla)?

Maybe? This would seem to be a hard hang though. it's possible some other versions of this somehow make SOME forward progress.

I've been debugging WHY the timeouts occur, and it looks like it's something to do with traffic going to multiple TIDs/ACs (and thus queues) at the same time. If I redirect all the output to a single TX queue to the NIC? Everything is stable.
The TX USB code doesn't look like it's at all handling multi-queue transmit right, I'm going to work on a short-term workaround and then try re-doing the USB TX path and see if it improves things.
(But not in this diff. :-) )

This revision is now accepted and ready to land.Nov 8 2024, 1:06 PM