2009-06-26 11:36:41

by Frans Pop

[permalink] [raw]
Subject: [2.6.31-rc1] iwlagn (4965): no wireless due to RFKILL problem

I've tried .31-rc1 on my HP 2510p notebook and the only problem I found
was that wireless no longer works. The cause looks to be related to
RFKILL.

Initially when I booted all I got in dmesg was:
cfg80211: Using static regulatory domain info
cfg80211: Regulatory domain: EU
(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
(2402000 KHz - 2482000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
(5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
(5490000 KHz - 5710000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
cfg80211: Calling CRDA for country: EU
iwlagn: Intel(R) Wireless WiFi Link AGN driver for Linux, 1.3.27kd
iwlagn: Copyright(c) 2003-2009 Intel Corporation
iwlagn 0000:10:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
iwlagn 0000:10:00.0: setting latency timer to 64
iwlagn 0000:10:00.0: Detected Intel Wireless WiFi Link 4965AGN REV=0x4
iwlagn 0000:10:00.0: Tunable channels: 11 802.11bg, 13 802.11a channels
iwlagn 0000:10:00.0: irq 27 for MSI/MSI-X
phy0: Selected rate control algorithm 'iwl-agn-rs'

Normally I'd expect to see the following after that (from .30):
iwlagn 0000:10:00.0: firmware: requesting iwlwifi-4965-2.ucode
iwlagn 0000:10:00.0: loaded firmware version 228.57.2.23
Registered led device: iwl-phy0::radio
Registered led device: iwl-phy0::assoc
Registered led device: iwl-phy0::RX
Registered led device: iwl-phy0::TX
wlan0: authenticate with AP 00:14:c1:38:e5:15
wlan0: authenticated
wlan0: associate with AP 00:14:c1:38:e5:15
wlan0: RX AssocResp from 00:14:c1:38:e5:15 (capab=0x411 status=0 aid=1)
wlan0: associated

So it did not even try to load the firmware...


After the boot completed I tried unloading and reloading iwlagn, and then
I suddenly got:
iwlagn 0000:10:00.0: PCI INT A disabled
cfg80211: Using static regulatory domain info
cfg80211: Regulatory domain: EU
(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
(2402000 KHz - 2482000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
(5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
(5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2000 mBm)
(5490000 KHz - 5710000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
cfg80211: Calling CRDA for country: EU
iwlagn: Intel(R) Wireless WiFi Link AGN driver for Linux, 1.3.27kd
iwlagn: Copyright(c) 2003-2009 Intel Corporation
iwlagn 0000:10:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
iwlagn 0000:10:00.0: setting latency timer to 64
iwlagn 0000:10:00.0: Detected Intel Wireless WiFi Link 4965AGN REV=0x4
iwlagn 0000:10:00.0: Tunable channels: 11 802.11bg, 13 802.11a channels
iwlagn 0000:10:00.0: irq 27 for MSI/MSI-X
phy0: Selected rate control algorithm 'iwl-agn-rs'
iwlagn 0000:10:00.0: firmware: requesting iwlwifi-4965-2.ucode
iwlagn 0000:10:00.0: loaded firmware version 228.57.2.23
iwlagn 0000:10:00.0: Radio disabled by HW RF Kill switch

I then noticed that the wireless led on the notbook was indeed off, but it
was totally unresponsive to any attempts to turn it on.

I also compared loaded modules; for .30:
cfg80211 65944 3 iwlagn,iwlcore,mac80211
iwlagn 113236 0
iwlcore 159172 1 iwlagn
led_class 5080 3 iwlcore,hp_accel,sdhci
lib80211 7520 1 iwlcore
mac80211 164744 2 iwlagn,iwlcore
rfkill 12276 5 hp_wmi,iwlcore
and for .31-rc1:
cfg80211 90808 3 iwlagn,iwlcore,mac80211
iwlagn 107856 0
iwlcore 167908 1 iwlagn
led_class 5064 3 iwlcore,hp_accel,sdhci
mac80211 167024 2 iwlagn,iwlcore
rfkill 20640 2 hp_wmi,cfg80211

Note that lib80211 no longer gets loaded.

After rebooting into .30 wireless worked again.

Cheers,
FJP

Relevant part of config (diff between .30 and .31-rc1):
CONFIG_WIRELESS=y
CONFIG_CFG80211=m
# CONFIG_CFG80211_REG_DEBUG is not set
+# CONFIG_CFG80211_DEBUGFS is not set
CONFIG_WIRELESS_OLD_REGULATORY=y
CONFIG_WIRELESS_EXT=y
CONFIG_WIRELESS_EXT_SYSFS=y
CONFIG_LIB80211=m
# CONFIG_LIB80211_DEBUG is not set
CONFIG_MAC80211=m
+# CONFIG_MAC80211_DEFAULT_PS is not set
+CONFIG_MAC80211_DEFAULT_PS_VALUE=1

#
# Rate control algorithm selection
#
CONFIG_MAC80211_RC_MINSTREL=y
# CONFIG_MAC80211_RC_DEFAULT_PID is not set
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel"
CONFIG_MAC80211_MESH=y
CONFIG_MAC80211_LEDS=y
# CONFIG_MAC80211_DEBUGFS is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
# CONFIG_WIMAX is not set
CONFIG_RFKILL=m
-CONFIG_RFKILL_INPUT=m
CONFIG_RFKILL_LEDS=y
+CONFIG_RFKILL_INPUT=y
# CONFIG_NET_9P is not set
[...]
CONFIG_IWLWIFI=m
CONFIG_IWLWIFI_LEDS=y
-CONFIG_IWLWIFI_RFKILL=y
# CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT is not set
CONFIG_IWLWIFI_DEBUG=y
CONFIG_IWLAGN=m
CONFIG_IWL4965=y
# CONFIG_IWL5000 is not set
# CONFIG_IWL3945 is not set
# CONFIG_HOSTAP is not set
# CONFIG_B43 is not set
# CONFIG_B43LEGACY is not set
# CONFIG_ZD1211RW is not set
# CONFIG_RT2X00 is not set
# CONFIG_HERMES is not set
+# CONFIG_IWM is not set


2009-06-26 11:59:22

by Maciej Rutecki

[permalink] [raw]
Subject: Re: [2.6.31-rc1] iwlagn (4965): no wireless due to RFKILL problem

2009/6/26 Frans Pop <[email protected]>:
> I've tried .31-rc1 on my HP 2510p notebook and the only problem I found
> was that wireless no longer works. The cause looks to be related to
> RFKILL.
>

Same on HP/Compaq nx6310, caused by hp-wmi module. It's disable
bluetooth and wireless. I must turn it on in Windows XP (in HP tools).
Workaround: don't load hp-wmi. Already I try find how enable it via
/sys like in Windows.

--
Maciej Rutecki
http://www.maciek.unixy.pl

2009-06-26 12:15:42

by Frans Pop

[permalink] [raw]
Subject: Re: [2.6.31-rc1] iwlagn (4965): no wireless due to RFKILL problem

On Friday 26 June 2009, Maciej Rutecki wrote:
> 2009/6/26 Frans Pop <[email protected]>:
> > I've tried .31-rc1 on my HP 2510p notebook and the only problem I
> > found was that wireless no longer works. The cause looks to be
> > related to RFKILL.
>
> Same on HP/Compaq nx6310, caused by hp-wmi module. It's disable
> bluetooth and wireless. I must turn it on in Windows XP (in HP tools).
> Workaround: don't load hp-wmi. Already I try find how enable it via
> /sys like in Windows.

Thanks for narrowing it down.

Well, with 2.6.30 hp-wmi worked together with rfkill without problems.
Looking at the commit logs, it looks like the rfkill rewrite by Johannes
and Alan is the cause here. CCs added.

2009-06-27 08:17:07

by Johannes Berg

[permalink] [raw]
Subject: Re: [2.6.31-rc1] iwlagn (4965): no wireless due to RFKILL problem

On Fri, 2009-06-26 at 14:10 +0200, Frans Pop wrote:

> Well, with 2.6.30 hp-wmi worked together with rfkill without problems.
> Looking at the commit logs, it looks like the rfkill rewrite by Johannes
> and Alan is the cause here. CCs added.

Hmm, looks like there might be another polarity error, try this:
- int query = BIT(b + 8) | ((!!blocked) << b);
+ int query = BIT(b + 8) | ((!blocked) << b);


johannes


Attachments:
signature.asc (801.00 B)
This is a digitally signed message part

2009-06-27 09:49:37

by Maciej Rutecki

[permalink] [raw]
Subject: Re: [2.6.31-rc1] iwlagn (4965): no wireless due to RFKILL problem

2009/6/26 Johannes Berg <[email protected]>:

> Hmm, looks like there might be another polarity error, try this:
> -       int query = BIT(b + 8) | ((!!blocked) << b);
> +       int query = BIT(b + 8) | ((!blocked) << b);
>

This helps. hp-wmi works without any problems.

Tested-by Maciej Rutecki <[email protected]>

Thanks
--
Maciej Rutecki
http://www.maciek.unixy.pl

2009-06-27 09:50:10

by Frans Pop

[permalink] [raw]
Subject: Re: [2.6.31-rc1] iwlagn (4965): no wireless due to RFKILL problem

On Friday 26 June 2009, Johannes Berg wrote:
> On Fri, 2009-06-26 at 14:10 +0200, Frans Pop wrote:
> > Well, with 2.6.30 hp-wmi worked together with rfkill without
> > problems. Looking at the commit logs, it looks like the rfkill
> > rewrite by Johannes and Alan is the cause here. CCs added.
>
> Hmm, looks like there might be another polarity error, try this:
> - int query = BIT(b + 8) | ((!!blocked) << b);
> + int query = BIT(b + 8) | ((!blocked) << b);

Thanks Johannes, that makes wireless work again.

However, I just saw another possible issue.

When I disable wireless using the hardware switch and the enable it again
almost immediately after on 2.6.30, I get:
[disable]
iwlagn 0000:10:00.0: Radio Frequency Kill Switch is On:
Kill switch must be turned off for wireless networking to work.
usb 3-1: USB disconnect, address 2
[enable]
Registered led device: iwl-phy0::radio
Registered led device: iwl-phy0::assoc
Registered led device: iwl-phy0::RX
Registered led device: iwl-phy0::TX
usb 3-1: new full speed USB device using uhci_hcd and address 3
usb 3-1: configuration #1 chosen from 1 choice
wlan0: no probe response from AP 00:14:c1:38:e5:15 - disassociating
iwlagn 0000:10:00.0: index 0 not used in uCode key table.
wlan0: authenticate with AP 00:14:c1:38:e5:15
wlan0: authenticate with AP 00:14:c1:38:e5:15
wlan0: authenticated
wlan0: associate with AP 00:14:c1:38:e5:15
wlan0: RX ReassocResp from 00:14:c1:38:e5:15 (capab=0x411 status=0 aid=1)
wlan0: associated

And without any other action networking is up again.

With 2.6.31 I get this:
[disable]
wlan0: deauthenticating by local choice (reason=3)
iwlagn 0000:10:00.0: Error sending REPLY_ADD_STA: enqueue_hcmd failed: -5
mac80211-phy0: failed to remove key (0, 00:14:c1:38:e5:15) from hardware (-5)
iwlagn 0000:10:00.0: Error sending REPLY_ADD_STA: enqueue_hcmd failed: -5
mac80211-phy0: failed to remove key (1, ff:ff:ff:ff:ff:ff) from hardware (-5)
usb 3-1: USB disconnect, address 2
[enable]
usb 3-1: new full speed USB device using uhci_hcd and address 3
usb 3-1: configuration #1 chosen from 1 choice

A lot uglier with those errors. And after that I have to run ifdown/ifup
before networking is up again (ifup only does not work as it will complain
"interface already configured"):

[ifdown wlan0]
Registered led device: iwl-phy0::radio
Registered led device: iwl-phy0::assoc
Registered led device: iwl-phy0::RX
Registered led device: iwl-phy0::TX
ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ifup wlan 0]
Registered led device: iwl-phy0::radio
Registered led device: iwl-phy0::assoc
Registered led device: iwl-phy0::RX
Registered led device: iwl-phy0::TX
ADDRCONF(NETDEV_UP): wlan0: link is not ready
wlan0: authenticate with AP 00:14:c1:38:e5:15
wlan0: authenticated
wlan0: associate with AP 00:14:c1:38:e5:15
wlan0: RX AssocResp from 00:14:c1:38:e5:15 (capab=0x411 status=0 aid=1)
wlan0: associated
ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

BTW, would it make sense to bring back the first two lines shown with .30
(or at least the first one):
iwlagn 0000:10:00.0: Radio Frequency Kill Switch is On:
Kill switch must be turned off for wireless networking to work.
IMHO it's good to register the reason for the disconnect.

Cheers,
FJP