Bug 790810 - ath5k port gets "hard blocked" when Wireless is disabled via NetworkManager
Summary: ath5k port gets "hard blocked" when Wireless is disabled via NetworkManager
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 16
Hardware: x86_64
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: John W. Linville
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-15 13:27 UTC by Martin Wilck
Modified: 2013-01-10 08:27 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-23 14:56:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
boot.log Fujitsu ESPRIMO MOBILE 9400 (6.82 KB, text/plain)
2012-02-15 13:29 UTC, Martin Wilck
no flags Details
lspci -vv (9.23 KB, text/plain)
2012-02-15 13:30 UTC, Martin Wilck
no flags Details

Description Martin Wilck 2012-02-15 13:27:04 UTC
Description of problem:
When Wifi is disabled using NetworkManager ("Wireless: Off" button in GNOME3), the WLAN port enters "soft blocked" state. When trying to re-enable it with the same button, it enters "hard blocked" state and will remain in this state. Only a system power cycle remedies this situation.

unloading ath5k and reloading it with the parameter "nohwcrypt=1", as suggested on some web pages, doesn't solve the problem.

Version-Release number of selected component (if applicable):
3.1.9-1.fc16

How reproducible:
always


Steps to Reproduce:
1. connect wireless
2. disconnect wireless using Off switch in NM
3. try to reenable wireless
  
Actual results:
See above

Expected results:
Wireless can be re-enabled

Additional info:

- While Wireless is ON:

[root@cooper os3]# rfkill list
0: phy0: Wireless LAN
	Soft blocked: yes
	Hard blocked: no

- after disabling wireless with NM:
[root@cooper os3]# rfkill list
0: phy0: Wireless LAN
	Soft blocked: yes
	Hard blocked: no

- after trying to re-enable it via NM:
[root@cooper os3]# rfkill list
0: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: yes

[root@cooper os3]# rmmod ath5k
[root@cooper os3]# modprobe -v ath5k nohwcrypt=1
insmod /lib/modules/3.1.9-1.fc16.x86_64/backports/drivers/net/wireless/ath/ath5k/ath5k.ko nohwcrypt=1
[root@cooper os3]# rfkill list
2: phy2: Wireless LAN
	Soft blocked: no
	Hard blocked: yes

This dmesg is the protocol of activating WLAN and deactivating it, trying to re-enable it, and unloading ath5k.

[165937.409795] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[166061.436081] wlan0: direct probe to 00:18:74:d1:fe:01 (try 1/3)
[166061.636044] wlan0: direct probe to 00:18:74:d1:fe:01 (try 2/3)
[166061.836036] wlan0: direct probe to 00:18:74:d1:fe:01 (try 3/3)
[166062.036048] wlan0: direct probe to 00:18:74:d1:fe:01 timed out
[166067.989516] wlan0: authenticate with 00:18:74:d1:fb:b1 (try 1)
[166067.991014] wlan0: authenticated
[166067.997531] wlan0: associate with 00:18:74:d1:fb:b1 (try 1)
[166067.999860] wlan0: RX AssocResp from 00:18:74:d1:fb:b1 (capab=0x431 status=0 aid=6)
[166067.999865] wlan0: associated
[166068.000832] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[166068.000955] cfg80211: Calling CRDA for country: DE
[166068.207462] cfg80211: Regulatory domain changed to country: DE
[166068.207466] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[166068.207471] cfg80211:     (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm)
[166068.207474] cfg80211:     (5150000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[166068.207478] cfg80211:     (5250000 KHz - 5350000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[166068.207481] cfg80211:     (5470000 KHz - 5725000 KHz @ 40000 KHz), (N/A, 2698 mBm)
[166078.946035] wlan0: no IPv6 routers present

[166303.225685] wlan0: authenticate with 00:18:74:d1:b1:c1 (try 1)
[166303.227173] wlan0: authenticated
[166303.239296] wlan0: associate with 00:18:74:d1:b1:c1 (try 1)
[166303.243847] wlan0: RX ReassocResp from 00:18:74:d1:b1:c1 (capab=0x431 status=0 aid=7)
[166303.243854] wlan0: associated
[166406.325885] wlan0: deauthenticating from 00:18:74:d1:b1:c1 by local choice (reason=3)
[166406.333698] cfg80211: Calling CRDA to update world regulatory domain
[166406.343261] cfg80211: World regulatory domain updated:
[166406.343265] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[166406.343270] cfg80211:     (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[166406.343274] cfg80211:     (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[166406.343278] cfg80211:     (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[166406.343281] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[166406.343285] cfg80211:     (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[166406.343307] cfg80211: Calling CRDA for country: DE
[166406.347734] cfg80211: Regulatory domain changed to country: DE
[166406.347737] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[166406.347741] cfg80211:     (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm)
[166406.347743] cfg80211:     (5150000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[166406.347746] cfg80211:     (5250000 KHz - 5350000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[166406.347749] cfg80211:     (5470000 KHz - 5725000 KHz @ 40000 KHz), (N/A, 2698 mBm)
[166416.631478] ADDRCONF(NETDEV_UP): wlan0: link is not ready
[166503.543762] ath5k 0000:06:00.0: PCI INT A disabled


reloading ath5k yields:


[166525.250150] ath5k 0000:06:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
[166525.250166] ath5k 0000:06:00.0: setting latency timer to 64
[166525.250264] ath5k 0000:06:00.0: registered as 'phy2'
[166525.767790] ath: EEPROM regdomain: 0x30
[166525.767794] ath: EEPROM indicates we should expect a direct regpair map
[166525.767797] ath: Country alpha2 being used: AM
[166525.767799] ath: Regpair used: 0x30
[166525.768157] ieee80211 phy2: Selected rate control algorithm 'minstrel_ht'
[166525.768511] ath5k phy2: Atheros AR5414 chip found (MAC: 0xa0, PHY: 0x61)
[166525.769231] cfg80211: Calling CRDA for country: AM
[166525.784934] cfg80211: Current regulatory domain intersected:
[166525.784937] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[166525.784941] cfg80211:     (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)
[166525.784944] cfg80211:     (5170000 KHz - 5250000 KHz @ 20000 KHz), (N/A, 1800 mBm)
[166525.784947] cfg80211:     (5250000 KHz - 5330000 KHz @ 20000 KHz), (N/A, 1800 mBm)
[166525.986622] ADDRCONF(NETDEV_UP): wlan0: link is not ready

Comment 1 Martin Wilck 2012-02-15 13:29:28 UTC
Created attachment 562212 [details]
boot.log Fujitsu ESPRIMO MOBILE 9400

Comment 2 Martin Wilck 2012-02-15 13:30:03 UTC
Created attachment 562213 [details]
lspci -vv

Comment 3 John W. Linville 2012-02-15 16:52:01 UTC
Sounds like a platform driver issue to me...I Cc'ed the expert, Matthew.

Comment 4 Matthew Garrett 2012-02-15 17:03:50 UTC
There's no platform driver involved here. ath5k is misreporting state itself - how can it be soft blocked but still be working?

Comment 5 John W. Linville 2012-02-15 18:23:50 UTC
I didn't read it that way.  Martin, is the ath5k device actually working while rfkill is reporting it as either hard or soft blocked?

Comment 6 John W. Linville 2012-02-15 19:08:17 UTC
Also, please create a file named /etc/modprobe.d/ath5k.conf with a line like this in it:

options ath5k no_hw_rfkill_switch=1

Then either reboot or do 'modprobe -r ath5k ; modprobe ath5k' as root.  Does this change the situation you are experiencing?

Comment 7 Martin Wilck 2012-02-16 16:47:45 UTC
(In reply to comment #5/#6)
> I didn't read it that way.  Martin, is the ath5k device actually working while
> rfkill is reporting it as either hard or soft blocked?

I'm not sure what you mean with "working". While it's "soft blocked", the wireless interface is not active, but my guess is is still "working" low level. When it's "hard blocked" it definitely doesn't work any more. As I tried to convey, nothing except AC off can bring the device back to working state once this happens.

> options ath5k no_hw_rfkill_switch=1

ath5k in F16 (3.1.9-1) doesn't support this parameter. Do I need to upgrade?

modinfo ath5k
...
vermagic:       3.1.9-1.fc16.x86_64 SMP mod_unload 
parm:           nohwcrypt:Disable hardware encryption. (bool)
parm:           all_channels:Expose all channels the device can use. (bool)
parm:           fastchanswitch:Enable fast channel switching for AR2413/AR5413 radios. (bool)


I might add that I observed this faulty behavior for some time already before I got down to opening a BZ. The behavior was the same in F15, for sure.

Comment 8 Matthew Garrett 2012-02-16 16:59:45 UTC
At the point where you get:

"- While Wireless is ON:

[root@cooper os3]# rfkill list
0: phy0: Wireless LAN
 Soft blocked: yes
 Hard blocked: no"

is your wireless working? You say "Connect to wireless" - does that mean you successfully associate, get an address and can send and receive packets? And while doing that, rfkill list says that you're soft blocked?

Comment 9 John W. Linville 2012-02-16 18:37:37 UTC
Also, could you try an updated kernel (e.g. kernel-3.2.5-3.fc16 or later)?

Comment 10 Martin Wilck 2012-03-07 14:11:26 UTC
(In reply to comment #8)

> [root@cooper os3]# rfkill list
> 0: phy0: Wireless LAN
>  Soft blocked: yes
>  Hard blocked: no"
> 
> is your wireless working? You say "Connect to wireless" - does that mean you
> successfully associate, get an address and can send and receive packets?

No, that would require un-softblocking the device first, and when I try to do that, it gets hard blocked. What I need to do is try to unblock with rfkill rather than NetworkManager. I will do so at the next opportunity. I'll also try the update kernel ASAP.

Comment 11 Martin Wilck 2012-03-15 10:30:30 UTC
Retest with kernel 3.2.9-2.fc16  and "options ath5k no_hw_rfkill_switch=1" was successful. 

This would be acceptable as a workaround for this bug. But I don't think it's a real solution. Somehow the driver seems to mess around with the GPIO pin when the user attempts to soft-block the device.

The comments for http://answerpot.com/showthread.php?3197032-ath5k%3A+Add+a+module+parameter+to+disable+hw+rf+kill+switch (the patch that introduces no_hw_rfkill_switch) doesn't give me a clue, either. The description doesn't fit my problem. in my case it's an on board device, so the "card" *did* come with the laptop.

Comment 12 Dave Jones 2012-03-22 16:42:33 UTC
[mass update]
kernel-3.3.0-4.fc16 has been pushed to the Fedora 16 stable repository.
Please retest with this update.

Comment 13 Dave Jones 2012-03-22 16:47:00 UTC
[mass update]
kernel-3.3.0-4.fc16 has been pushed to the Fedora 16 stable repository.
Please retest with this update.

Comment 14 Dave Jones 2012-03-22 16:56:32 UTC
[mass update]
kernel-3.3.0-4.fc16 has been pushed to the Fedora 16 stable repository.
Please retest with this update.

Comment 15 Martin Wilck 2012-03-23 13:54:06 UTC
This was already fixed in the previous kernel.

Comment 16 Paulo Roma Cavalcanti 2012-07-26 17:14:56 UTC
I have a similar problem.
My notebook does not have a physical switch 
for enabling my wireless network. I have to use Fn+F3.
After a power down, it always OFF.

However, since I upgrade to F17 this does not work anymore,
and I have to boot in an old Fedora using a pen drive (e.g,F11)
to activate the wireless network and then reboot to F17.

I am also using ath5k, which works very well when the wireless network is active.

rfkill list 
1: phy0: Wireless LAN
        Soft blocked: no
        Hard: blocked yes


Is there anyway to activate my wireless? The Bios does not offer
any help, also...
Maybe acpid is mapping Fn+F3 to another action?

Thanks.

Comment 17 Nick Kossifidis 2012-07-26 18:17:38 UTC
no_hw_rfkill_switch just tells the driver to ignore settings on EEPROM and don't use hw rf-kill (sw rf-kill still works). The fact that your card came with the laptop doesn't nesecary mean that it's being configured propertly, maybe your laptop vendor tweaked the windows (In reply to comment #11)
> Retest with kernel 3.2.9-2.fc16  and "options ath5k no_hw_rfkill_switch=1"
> was successful. 
> 
> This would be acceptable as a workaround for this bug. But I don't think
> it's a real solution. Somehow the driver seems to mess around with the GPIO
> pin when the user attempts to soft-block the device.
> 
> The comments for
> http://answerpot.com/showthread.php?3197032-
> ath5k%3A+Add+a+module+parameter+to+disable+hw+rf+kill+switch (the patch that
> introduces no_hw_rfkill_switch) doesn't give me a clue, either. The
> description doesn't fit my problem. in my case it's an on board device, so
> the "card" *did* come with the laptop.

Well maybe your laptop vendor didn't tweak EEPROM settings, left the defaults and instead tweaked the vendor-provided driver to do the same thing we do with no_hw_rfkill_switch, ignore the hw switch. We could do a mapping for gpio pins the same way we do for the LEDs and have a "database" of valid pin/polarity settings to override EEPROM defaults but that requires some effort from the users for testing etc and to introduce an easy way to debug (through debugfs, or a module parameter).

I think just using no_hw_rfkill is the easiest approach and after all we have the software rf-kill to work with, that triggers the same mechanism to disable rf. We don't miss any functionality like we did with LEDs not working.

Comment 18 Nick Kossifidis 2012-07-26 18:20:23 UTC
(In reply to comment #16)
> I have a similar problem.
> My notebook does not have a physical switch 
> for enabling my wireless network. I have to use Fn+F3.
> After a power down, it always OFF.
> 
> However, since I upgrade to F17 this does not work anymore,
> and I have to boot in an old Fedora using a pen drive (e.g,F11)
> to activate the wireless network and then reboot to F17.
> 
> I am also using ath5k, which works very well when the wireless network is
> active.
> 
> rfkill list 
> 1: phy0: Wireless LAN
>         Soft blocked: no
>         Hard: blocked yes
> 
> 
> Is there anyway to activate my wireless? The Bios does not offer
> any help, also...
> Maybe acpid is mapping Fn+F3 to another action?
> 
> Thanks.

ath5k doesn't deal with acpi key combinations, it only manages the hw rf-kill switches available on some laptops, you should check acpi support/drivers for your laptop and report this problem there.

Comment 19 Paulo Roma Cavalcanti 2012-07-27 00:18:53 UTC
In fact, I just did:

/sbin/rmmod -f ath5k
/sbin/rfkill unblock all
/sbin/modprobe ath5k


and now my wireless network is enabled all of the time, even after shutdown.
This is exactly what I was looking for. 
Could it be a module option?

Thanks.

Comment 20 John W. Linville 2012-07-27 14:47:42 UTC
If you were able to unblock it with ath5k unloaded, it doesn't seem like ath5k is really involved at all.  In any case, perhaps you should open a new bug?

Comment 21 Martin Wilck 2012-10-17 08:48:54 UTC
Just for the record, 3.6.1-1.fc17.x86_64 still requires "no_hw_rfkill_switch=1".


Note You need to log in before you can comment on or make changes to this bug.