On Wed, Feb 17, 2021 at 01:56:40PM +0100, Grégoire Jadi wrote: > On my X201 I've a physical switch to turn the WiFi on and off. When I > do it, I've this logs: > > iwn0: RF switch: radio disabled > iwn0: RF switch: radio disabled > iwn0: RF switch: radio enabled > > Would that work to test the iwn detach code? Or is it the case you're > were referring to: "powered down but attached on the PCI bus"?
> Moreover, when the device is "detached", I can't bring it back online > with that switch. Is there a way to do it? The radio switch is unrelated. It still requires an operational device on the PCI bus. The chip and driver keep running while the radio is switched off. When the device detaches it no longer "exists" in the system, meaning even basic device register access over the PCI bus no longer works. In this situation the driver may cause memory access violations in memory regions where the driver expects the device registers to be mapped by PCI (this mapping is established when the driver first attaches at boot time). As far as I can tell this is what happened when your kernel started to panic.
