Page MenuHomeFreeBSD

iwx: fix kernel panic on module unload with assertions enabled
ClosedPublic

Authored by avos on Sun, Sep 13, 12:49 AM.

Details

Summary

When interface is up and running 'kldunload if_iwx' stops the device and executes RUN -> INIT state transition.
Since the device is already stopped iwx_run_stop fails to stop the device again and returns non-zero exit code from iv_newstate callback which triggers 'INIT state change failed' assertion.

I reused IWX_FLAG_SHUTDOWN flag to:
a) set it in iwx_detach
b) check it in iwx_newstate_sub - when it is set all custom state transition logic is skipped

Accidentally found while experimenting with iwlwifi / iwx drivers

Test Plan

Tested with Intel AX211, STA mode

Diff Detail

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

Event Timeline

avos requested review of this revision.Sun, Sep 13, 12:49 AM

Entirely forgot about locking

adrian added a subscriber: adrian.

oh i hit this today! good catch.

This revision is now accepted and ready to land.Sun, Sep 13, 1:14 AM

@adrian may I ask to commit this change? I'm still catching up with changes and did not ask to restore write access yet.

of course! i'll do it shortly.