# WLAN (ath9k) turned off after resume from hibernate [SOLVED]

## larophel

Hello,

My ath9k wlan adapter (AR928X according to lspci) does not come back up after resuming from hibernate (using the hibernate script with or without tuxonice enabled). 

The LED that is normally on turns off as soon as the resume process starts and even the hardware switch cannot turn it back on (in fact, it seems just like someone had switched the hardware switch to "off". In both cases, "cat /sys/devices/pci0000:00/0000:00:06.0/0000:0e:00.0/rfkill/rfkill0/operstate" says "2", while when it is working correctly it displays "1"). 

The card is still recognized by iwconfig but connecting or searching does not work at all. 

I tried reloading the ath9k module before and after suspending but it does not work, the LED stays off and no connections are possible. 

The only solution I have found so far for this problem is to shutdown the laptop and start it back up again (rebooting does not work). 

I am using 2.6.30-r4 gentoo sources (but this problem also happened with 2.6.29 kernels). 

Any hints would be greatly appreciated!Last edited by larophel on Mon Dec 28, 2009 5:10 pm; edited 1 time in total

----------

## larophel

Do you need more information? I will be happy to provide logs and config if necessary. I did not include any because I was not sure what would be helpful.

----------

## boerKrelis

You could build a new kernel without rfkill. If that solves your problem it could mean that hibernation is using the rfkill functionality and your quest would then be to prevent your hibernation system from calling rfkill.

Does 'dmesg' tell you anything?

----------

## larophel

I have recompiled my kernel without rfkill support but it did not make any difference, the wlan device stays turned off. 

I looked at /var/log/messages after resuming from hibernate and unloading and reloading the ath9k module and I get the following:

```

Aug  1 14:10:38 satellite [  471.620635] ath9k 0000:0e:00.0: PCI INT A disabled

Aug  1 14:10:38 satellite [  471.621169] ath9k: Driver unloaded

Aug  1 14:10:40 satellite /etc/init.d/net.wlan0[3737]: net.wlan0: not allowed to be hotplugged

Aug  1 14:10:58 satellite [  491.140608] ath9k 0000:0e:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18

Aug  1 14:10:58 satellite [  491.140639] ath9k 0000:0e:00.0: setting latency timer to 64

Aug  1 14:10:58 satellite [  491.581437] phy2: Selected rate control algorithm 'ath9k_rate_control'

Aug  1 14:10:58 satellite [  491.596929] Registered led device: ath9k-phy2::radio

Aug  1 14:10:58 satellite [  491.597014] Registered led device: ath9k-phy2::assoc

Aug  1 14:10:58 satellite [  491.597091] Registered led device: ath9k-phy2::tx

Aug  1 14:10:58 satellite [  491.597176] Registered led device: ath9k-phy2::rx

Aug  1 14:10:58 satellite [  491.597209] phy2: Atheros AR9280 MAC/BB Rev:2 AR5133 RF Rev:d0: mem=0xffffc200042a0000, irq=18

Aug  1 14:10:58 satellite [  491.619249] ADDRCONF(NETDEV_UP): wlan0: link is not ready

Aug  1 14:10:58 satellite /etc/init.d/net.wlan0[3749]: net.wlan0: not allowed to be hotpluggeg

```

The only thing I can see in dmesg that I think is related to this problem is this:

```

[  375.144470] ADDRCONF(NETDEV_UP): wlan0: link is not ready

```

and maybe this?

```

[    0.134477] ACPI Error (evregion-0319): No handler for Region [ERAM] (ffff880131a2ba68) [EmbeddedControl] [20090320]

[    0.134876] ACPI Error (exfldio-0286): Region EmbeddedControl(3) has no handler [20090320]

[    0.135138] ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.HTEV] (Node ffff880131a26920), AE_NOT_EXIST

[    0.135558] ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0.LPC0.EC0_._REG] (Node ffff880131a2ec80), AE_NOT_EXIST

```

I have uploaded the whole output of dmesg to http://pastebin.com/m648ce12a so you can look at it, maybe you will see something I don't? 

Maybe also worth mentioning is that after resuming from hibernate, the automounter does not work anymore. Could that be related?

----------

## boerKrelis

Sorry, I'm out of ideas. Almost. It could be a firmware problem. I bet tuxonice can't restore the internal state of your adapters firmware, and it could well be the case that upon restoring kernel state there is no corresponding device state. It's a guess.

You might try to completely unload the driver module and maybe even the complete kernel wifi stack (if possible, build them as modules) to prevent tuxonice from storing the stacks' state. Then, after resuming, you can start with a clean slate.

But I hope someone with more specific knowledge jumps in on this thread.

----------

## larophel

Thanks for your suggestion, but sadly it did not help either. 

It is an interesting point though, how does tuxonice save the hardware states? Is it maybe possible to stop it from sending my WLAN card into sleep mode?

----------

## cach0rr0

I too use the ath9k, but I never really hit this as an issue, since I use wicd for managing my wireless stuff rather than the init scripts. 

I don't know if this is doable for you or not, but it works for me quite nicely using wicd

----------

## larophel

Sorry for taking so long to reply, I was on vacation.

I am not sure if using wicd will make any difference as the card seems to be disabled hardware-wise but I will of course try. Emerging now, I will report back with the results.

Thanks!

----------

## larophel

I just tried it but it did not work   :Sad: 

Anyway, thanks for suggesting to try wicd, I quite like it and I think I may continue using it!

----------

## jquinte

Did you find any solution to this problem? Because I have a very similar one. After resume, I must unload and reload the ath9k module. After that I need sometimes to restart wicd.

I'd appreciate some help or tip from any of you.

Cheers!

----------

## larophel

Well, the problem I had (I don't have that laptop anymore, sadly) was not solved by reloading the ath9k module.

What I did was emerge the omnibook module and load it with "ectype=12", IIRC, depends on the laptop you got, then I could do "echo 1 > /proc/omnibook/wifi" to activate the wireless again.

If your problem is simply solved by reloading the ath9k module, and you use the "hibernate-script" package to hibernate, have you tried uncommenting

UnloadAllModules yes

LoadModules auto

in /etc/hibernate/common.conf?

Hoffe das hilft!

----------

## overkll

I've never used tuxonice, but I've been using ath9k as a module for over a year now.  I only had issues with specific kernels not resuming (nvidia related)... AT ALL.  The best kernels for ath9k so far have been 2.6.29 and 2.6.32.  Don't even bother using the other ones as they are.... well, crap.

As far as power saving/suspend/hibernate is concerned, gentoo-sources works just fine.  I let gnome take care of it all.

laphorel,  I didn't see how you've configured ath9k kernel wise, or how you bring it up so no one can really help you until you do.

----------

## cach0rr0

 *overkll wrote:*   

> I've never used tuxonice, but I've been using ath9k as a module for over a year now.  I only had issues with specific kernels not resuming (nvidia related)... AT ALL.  The best kernels for ath9k so far have been 2.6.29 and 2.6.32.  Don't even bother using the other ones as they are.... well, crap.
> 
> As far as power saving/suspend/hibernate is concerned, gentoo-sources works just fine.  I let gnome take care of it all.
> 
> laphorel,  I didn't see how you've configured ath9k kernel wise, or how you bring it up so no one can really help you until you do.

 

FYI, this has been an ongoing thing for >=2.6.31

http://bugzilla.kernel.org/show_bug.cgi?id=13807

bloody annoying; I was using .30 back when I originally posted in this thread - now that I've moved ahead with some later releases, any time I put any significant load on this system, I lose my connection. And indeed resuming i have to rmmod and modprobe all over again...and even then it *feels* less stable than before (have to manually disconnect/reconnect periodically). Reboot fixes it.

----------

## jquinte

You are totally right, cachorro. Even when sometimes there is no apparent error at all, you can *feel* that things are not working OK (slow; micro-disconnections; etc.).

I've read the link that you posted and solution seems to be on its way. Hopefully it will come in one of the next kernel versions.

Thanks and cheers!

----------

## r3tep

I had a problem at my card (ath5k).

At some startup, it was powered off and didn't wake up.

I disabled some ACPI-settings in my BIOS, the card is always on.

At my system, the problem is not solved. It's a workaround.

----------

## larophel

 *overkll wrote:*   

> 
> 
> laphorel,  I didn't see how you've configured ath9k kernel wise, or how you bring it up so no one can really help you until you do.

 

I am not sure what you mean, I think my OP was pretty clear. Anyway, I had also mentioned in the post before yours that I do not have the laptop anymore and that I had solved the problem.

I will change the title to avoid further confusion.

----------

