As promised in my earlier mail, here's a diff that fixes seemless
operation with the hardware kill switch on resume after suspend.
Like the interrupt handler, the resume path needs to check the register
to update flags in order to propagate the hardware kill switch state,
otherwise the driver would still consider the switch to be off after
resume even though it may have changed while in S3.
The same idiom can be found in iwm_start_hw() already; it's pretty
obvious by now.
With that, the following works just fine:
UP and RUNNING
RF switch off
suspend
RF switch -> on
resume
UP and RUNNING again
OK?
Index: if_iwm.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_iwm.c,v
retrieving revision 1.237
diff -u -p -r1.237 if_iwm.c
--- if_iwm.c 27 Feb 2019 07:47:57 -0000 1.237
+++ if_iwm.c 1 Apr 2019 09:20:05 -0000
@@ -7892,6 +7889,9 @@ iwm_resume(struct iwm_softc *sc)
/* Clear device-specific "PCI retry timeout" register (41h). */
reg = pci_conf_read(sc->sc_pct, sc->sc_pcitag, 0x40);
pci_conf_write(sc->sc_pct, sc->sc_pcitag, 0x40, reg & ~0xff00);
+
+ iwm_enable_rfkill_int(sc);
+ iwm_check_rfkill(sc);
return iwm_prepare_card_hw(sc);
}