2013-01-24 04:56:27

by Daniel Gnoutcheff

[permalink] [raw]
Subject: [ath5k] [bugreport] BIOS hang if wifi was connected before reboot

Hello all,

I have a Lenovo Thinkpad R61 7733A82 running Ubuntu 12.10 on kernel
3.7.4 with an Atheros AR5212 PCI-Express wireless card which is reported
in dmesg as:
ath5k: phy0: Atheros AR5414 chip found (MAC: 0xa3, PHY: 0x61)

If I connect this card to some network and then perform a warm reboot
without disconnecting from that network, then the system seems to lock
up in the middle of the BIOS self-test.

For example, if I stop NetworkManager and wpa_supplicant and issue the
commands:
iw dev wlan0 set type ibss
ip link set dev wlan0 up
iw wlan0 ibss join gnoutchd 2412
shutdown -r now
then the system appears to shut down correctly, and the screen blanks as
it normally does when rebooting, and I can even hear the CD-DVD drive
resetting itself, but then it locks up just before the point where I'd
expect the BIOS splash screen to appear.

However, if I issue 'ip link set dev wlan0 down' *before* I reboot, then
the system reboots perfectly. Omitting the 'iw wlan0 ibss join' step
also prevents the hang.

If I'm within range of a WPA network, I can also reproduce the hang with
something like
wpa_supplicant -c wpa_supplicant.conf -iwlan0 &
# wait for connection to complete
killall -SIGKILL wpa_supplicant
shutdown -r now
I also get the hang if I leave wpa_supplicant running and if my
initscripts never send it any signals (e.g. if its pid file is in
/run/sendsigs.omit.d).

However, if I give wpa_supplicant the chance to cleanup and disconnect
(i.e. if I or my initscripts send it a SIGINT or a SIGTERM or a 'wpa_cli
terminate'), then I don't get the hang.

These are just the examples I've looked into closely. I've also
observed the same hang if I reboot while connected to any of a variety
of wifi networks that I use, which include both open networks and WPA
networks.

This bug is present in a kernel v3.7.4 and wireless-testing commit
9d9540984a75ec4d0e59a33ce7d34581fd5b561b, but I've also seen in in
kernels as old as 2.6.31. I have installed the latest BIOS update
available for this machine.

Up until recently, it seems that NetworkManager would always disconnect
upon shutdown and thus avoided this bug, but this changed in Ubuntu
12.10. FWIW, I've attached the dmesg log for connecting to a WPA
network and then disconnecting from it cleanly. Please let me know if
there's anything I can do to help debug this.

Thanks!

Have a good one,
Daniel


Attachments:
dmesg-3.8.0-rc4-wl-wpa_supplicant_with_cleanup.txt (63.62 kB)

2013-01-24 06:45:31

by Julian Calaby

[permalink] [raw]
Subject: Re: [ath5k] [bugreport] BIOS hang if wifi was connected before reboot

Hi Daniel,

On Thu, Jan 24, 2013 at 3:56 PM, Daniel Gnoutcheff
<[email protected]> wrote:
> Hello all,
>
> I have a Lenovo Thinkpad R61 7733A82 running Ubuntu 12.10 on kernel 3.7.4
> with an Atheros AR5212 PCI-Express wireless card which is reported in dmesg
> as:
> ath5k: phy0: Atheros AR5414 chip found (MAC: 0xa3, PHY: 0x61)
>
> If I connect this card to some network and then perform a warm reboot
> without disconnecting from that network, then the system seems to lock up in
> the middle of the BIOS self-test.

My guess is that this is a bug in the BIOS itself, not an issue with
the Linux drivers, and I'd contact Lenovo support to see if this can
be fixed.

The obvious workaround is to have the shutdown scripts disconnect the
wireless network before the computer is rebooted, however, as you've
indicated below, this isn't the case any more.

> For example, if I stop NetworkManager and wpa_supplicant and issue the
> commands:
> iw dev wlan0 set type ibss
> ip link set dev wlan0 up
> iw wlan0 ibss join gnoutchd 2412
> shutdown -r now
> then the system appears to shut down correctly, and the screen blanks as it
> normally does when rebooting, and I can even hear the CD-DVD drive resetting
> itself, but then it locks up just before the point where I'd expect the BIOS
> splash screen to appear.

Ok.

> However, if I issue 'ip link set dev wlan0 down' *before* I reboot, then the
> system reboots perfectly. Omitting the 'iw wlan0 ibss join' step also
> prevents the hang.
>
> If I'm within range of a WPA network, I can also reproduce the hang with
> something like
> wpa_supplicant -c wpa_supplicant.conf -iwlan0 &
> # wait for connection to complete
> killall -SIGKILL wpa_supplicant
> shutdown -r now
> I also get the hang if I leave wpa_supplicant running and if my initscripts
> never send it any signals (e.g. if its pid file is in /run/sendsigs.omit.d).
>
> However, if I give wpa_supplicant the chance to cleanup and disconnect (i.e.
> if I or my initscripts send it a SIGINT or a SIGTERM or a 'wpa_cli
> terminate'), then I don't get the hang.
>
> These are just the examples I've looked into closely. I've also observed
> the same hang if I reboot while connected to any of a variety of wifi
> networks that I use, which include both open networks and WPA networks.
>
> This bug is present in a kernel v3.7.4 and wireless-testing commit
> 9d9540984a75ec4d0e59a33ce7d34581fd5b561b, but I've also seen in in kernels
> as old as 2.6.31. I have installed the latest BIOS update available for
> this machine.

It sounds like it's definitely a BIOS bug.

> Up until recently, it seems that NetworkManager would always disconnect upon
> shutdown and thus avoided this bug, but this changed in Ubuntu 12.10. FWIW,
> I've attached the dmesg log for connecting to a WPA network and then
> disconnecting from it cleanly. Please let me know if there's anything I can
> do to help debug this.

Have you raised a bug with Ubuntu's Network Manager maintainers about this?

Thanks,

--
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/

2013-02-14 04:45:27

by Julian Calaby

[permalink] [raw]
Subject: Re: [ath5k] [bugreport] BIOS hang if wifi was connected before reboot

Hi Daniel,

On Thu, Feb 14, 2013 at 3:20 PM, Daniel Gnoutcheff
<[email protected]> wrote:
> Hello Julian, thanks for your response and advice. (Sorry for my very
> slow reply.)
>
> On 01/24/2013 01:45 AM, Julian Calaby wrote:
>> On Thu, Jan 24, 2013 at 3:56 PM, Daniel Gnoutcheff
>> <[email protected]> wrote:
>>> Up until recently, it seems that NetworkManager would always disconnect upon
>>> shutdown and thus avoided this bug, but this changed in Ubuntu 12.10.
> <snip>
>>
>> Have you raised a bug with Ubuntu's Network Manager maintainers about this?
>
> I have now. Upon investigation, it appears that this is caused by a
> combination of (upstream) bugs in wpa_supplicant and NetworkManager.
> Fixing either of these bugs restores the intended behavior (and is an
> effective workaround for the BIOS bug). The NetworkManager bug has
> already been fixed in upstream's git. For the record, the relevant bug
> reports are:
>
> For NetworkManager:
> https://bugs.launchpad.net/network-manager/+bug/1124803
> https://bugzilla.gnome.org/show_bug.cgi?id=683932
> For wpa_supplicant:
> https://bugs.launchpad.net/ubuntu/+source/wpa/+bug/1124789
> http://w1.fi/bugz/show_bug.cgi?id=474

Good work, hopefully those fixes get pushed out soon.

Thanks,

--
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/

2013-02-14 04:20:06

by Daniel Gnoutcheff

[permalink] [raw]
Subject: Re: [ath5k] [bugreport] BIOS hang if wifi was connected before reboot

Hello Julian, thanks for your response and advice. (Sorry for my very
slow reply.)

On 01/24/2013 01:45 AM, Julian Calaby wrote:
> On Thu, Jan 24, 2013 at 3:56 PM, Daniel Gnoutcheff
> <[email protected]> wrote:
>> Hello all,
>>
>> I have a Lenovo Thinkpad R61 7733A82 running Ubuntu 12.10 on kernel 3.7.4
>> with an Atheros AR5212 PCI-Express wireless card which is reported in dmesg
>> as:
>> ath5k: phy0: Atheros AR5414 chip found (MAC: 0xa3, PHY: 0x61)
>>
>> If I connect this card to some network and then perform a warm reboot
>> without disconnecting from that network, then the system seems to lock up in
>> the middle of the BIOS self-test.
>
> My guess is that this is a bug in the BIOS itself, not an issue with
> the Linux drivers, and I'd contact Lenovo support to see if this can
> be fixed.

Yep, this looks like a BIOS bug to me too. Rebooting with kexec works fine.

About two and a half weeks ago, I gave Lenovo tech support a call, and
the representative I talked to indicated that he didn't have a good way
to contact the firmware/hardware engineers. He suggested that I report
this to Lenovo's forum, which I did at:


https://forums.lenovo.com/t5/Linux-Discussion/R61-w-Ubuntu-hangs-in-POST-if-rebooting-while-connected-to-wifi/td-p/1011759

I haven't gotten any response so far.

My support options are somewhat limited, as my warranty has long since
expired. Even if it hadn't, I'm not sure that Lenovo would care, given
that they're apparently neglecting other, much more annoying BIOS bugs
(like [1]).

>> Up until recently, it seems that NetworkManager would always disconnect upon
>> shutdown and thus avoided this bug, but this changed in Ubuntu 12.10.
<snip>
>
> Have you raised a bug with Ubuntu's Network Manager maintainers about this?

I have now. Upon investigation, it appears that this is caused by a
combination of (upstream) bugs in wpa_supplicant and NetworkManager.
Fixing either of these bugs restores the intended behavior (and is an
effective workaround for the BIOS bug). The NetworkManager bug has
already been fixed in upstream's git. For the record, the relevant bug
reports are:

For NetworkManager:
https://bugs.launchpad.net/network-manager/+bug/1124803
https://bugzilla.gnome.org/show_bug.cgi?id=683932
For wpa_supplicant:
https://bugs.launchpad.net/ubuntu/+source/wpa/+bug/1124789
http://w1.fi/bugz/show_bug.cgi?id=474

Thanks!

[1]
https://forums.lenovo.com/t5/Linux-Discussion/BIOS-Bug-Enabling-Fn-Ctrl-swap-breaks-Ctrl-Alt-Up/td-p/430663