Page MenuHomeFreeBSD

if_iwx: use net80211 suspend and resume methods
ClosedPublic

Authored by thj on May 22 2025, 2:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 1, 4:17 AM
Unknown Object (File)
Mon, Jun 30, 11:06 AM
Unknown Object (File)
Mon, Jun 30, 8:04 AM
Unknown Object (File)
Sun, Jun 29, 9:12 PM
Unknown Object (File)
Sun, Jun 29, 5:42 AM
Unknown Object (File)
Sat, Jun 28, 5:49 PM
Unknown Object (File)
Fri, Jun 27, 10:43 AM
Unknown Object (File)
Wed, Jun 25, 6:47 PM

Details

Summary

Use net80211 suspend and resume methods when entering and leaving
suspend. Move the resume action outside of the IWX_LOCK.

Re-assert disabling the PCI timeout, this is copied from OpenBSD, but it
doesn't seem to hurt.

Test Plan

This lets me suspend and resume successfully many times. On resume I have to
kick iwx sometimes and trick it into letting traffic through, but I see this
pre-suspend on the same hardware so it is probably a different issue.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

thj requested review of this revision.May 22 2025, 2:32 PM
adrian added a subscriber: adrian.
adrian added inline comments.
sys/dev/iwx/if_iwx.c
10679

I love how this keeps being copy/pasted from if_ath_pci.c :-)

This revision is now accepted and ready to land.May 22 2025, 2:36 PM
bz added inline comments.
sys/dev/iwx/if_iwx.c
10692

I wonder if you just want to call iwx_init here and also reset the watchdog?
I also wonder if you should, in suspend, disable it as it'll likely fire as you come back?

I'm finally updating my GE76 w/ AX210 to test iwx and iwlwifi in -head out, so I'll have to apply this to actually get it to pass a suspend/resume pass. stay tuned!

  • Use iwx_init on resume
This revision now requires review to proceed.May 26 2025, 1:12 PM
thj marked 2 inline comments as done.May 26 2025, 1:13 PM
thj added inline comments.
sys/dev/iwx/if_iwx.c
10679

I found one instance where the value was 0x40 rather than 0x41 in the comment. I'm happy to carry this incantation if someone else was.

This doesn't apply cleanly on -head, it requires D49827 first

sys/dev/iwx/if_iwx.c
10689–10690

You're missing an IWX_UNLOCK() here in the error path (after iwx_stop_device())

thj marked an inline comment as done.
  • iwx: unlock on error path
  • create a diff that can be applied on main (sorry)

It's better than the status quo in -HEAD, so let's get it in and then churn some more on making it recover better!

This revision is now accepted and ready to land.May 28 2025, 3:29 AM
This revision was automatically updated to reflect the committed changes.