Suspend / resume problems
Greetings,
I have a problem with ath9k on my ASUS X58L laptop. Basically wireless doesn't work after resuming from suspend. I described the full details here:
https://bugs.launchpad.net/ubuntu/+source/pm-utils/+bug/366741
Note that the pm-utils package was associated with the bug by launchpad staff incorrectly, as you will see in a moment.
As my bug hasn't received any attention on launchpad, and myself being a developer, I decided to take a look at it myself. I used the latest wireless- testing kernel sources.
So, this is what I've found out:
The problem comes from the treatment of the result of ath_is_rfkill_set(). If it returns true, it is considered a hardware block, which according to rfkill subsystem's documentation means it can't be overridden in software. It's definitely not the case with my hardware. When ath_rfkill_poll() sees that ath_is_rfkill_set() is true, it calls rfkill_force_state() with the SC_OP_RFKILL_HW_BLOCKED flag set. At this point there is no way that I am aware of for a userspace process to bring the driver back from that state. Not even by pressing the Wireless button, as in fact it works through
userspace: it's handled by the asus_laptop module, which reports it via acpi_bus_generate_proc_event(). Then it's picked up by some userspace process, which then communicates with the rfkill subsystem to toggle the wireless state. Because the rfkill subsystem sees the SC_OP_RFKILL_HW_BLOCKED flag, that request won't even reach the wireless driver. BTW, this laptop actually starts with wireless being turned off (ath_is_rfkill_set() returns true), but it's forced on by the asus_laptop module. That's why it even works at all, which I tested by blacklisting the asus_laptop module. BTW, asus_laptop forces the wireless on, but doesn't turn the LED on, so the LED shows wireless being off, while in fact it's on. ath9k doesn't try to turn the LED on on startup - it assumes the wireless is on and the LED is on as well. I don't think it's a good idea to assume that - just think about a manual rmmod + modprobe for example. Anyway, back to the main issue. I was able to fix the problem by treating the result of ath_is_rfkill_set() as a soft block. Now it works after resume, though it's necessary to press the Wireless button two times. It may be related to the fact that pm-suspend issues a wireless toggle request after resuming from suspend -- I am not sure why. Another unanswered question is what actually makes ath_is_rfkill_set() to return true? It looks like ath_radio_disable() does that, though if that is true, I don't understand how this driver works for anyone.
Thanks for your attention, and I hope this issue will soon be resolved. I am willing to do more research / testing if necessary.
Regards,
Joseph Artsimovich