Bug 13271

Summary: ath9k stop working since 2.6.29
Product: Networking Reporter: lyman (lymanrb)
Component: WirelessAssignee: networking_wireless (networking_wireless)
Status: CLOSED INVALID    
Severity: blocking CC: linville, lymanrb, mcgrof, rjw, sujith, vkthiagu
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.29 Subsystem:
Regression: Yes Bisected commit-id:
Bug Depends on:    
Bug Blocks: 12398    
Attachments: dmesg output
iw list
dmesg -c
enable ath9k debug on 2.6.29
dmesg without encryption, before applying debug patch
dmesg without encryption, applied debug patch
n8 level dmesg
interrupts
interrupts
interrupts with printk

Description lyman 2009-05-10 01:58:00 UTC
The wireless adapter inside my laptop is using ath9k and it works well with 2.6.28.x

0c:00.0 Network controller: Atheros Communications Inc. AR5008 Wireless Network Adapter (rev 01)
        Subsystem: Fujitsu Limited. Device 13c0
        Flags: bus master, fast devsel, latency 0, IRQ 18
        Memory at fc200000 (64-bit, non-prefetchable) [size=64K]
        Capabilities: [40] Power Management version 2
        Capabilities: [50] MSI: Mask- 64bit- Count=1/1 Enable-
        Capabilities: [60] Express Legacy Endpoint, MSI 00
        Capabilities: [90] MSI-X: Enable- Mask- TabSize=1
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Virtual Channel <?>
        Kernel driver in use: ath9k
        Kernel modules: ath9k

and since 2.6.29, it does not work any longer. Networkmanager shows no available wireless connection. I disable Networkmanager, "ifconfig wlan0 up" and "iwlist scan wlan0" says "no scan results".

I installed and configured crda and wireless-regdb, no change.

2.6.29.{1,2,3} came out, no change.

I tried compiling the latest compat-wireless manually several times, no change.

I tried my friend's pcmcia wireless adapter (ath5k) with 2.6.29.1 and it works fine. I am out of ammo now and I think it could be a bug of ath9k.
Comment 1 John W. Linville 2009-05-13 13:52:45 UTC
Have you tried a current pull of linux-2.6 (i.e. 2.6.30-rc5 or later)?
Comment 2 lyman 2009-05-14 04:02:44 UTC
I just tried 2.6.30-rc5, unfortunately, all wireless part seems not functioning. the menu item "enable wireless" in networkmanager is gray.

disable networkmanager, "ifconfig wlan0 up", and "iwlist wlan0 scan" still report "no scan results".
Comment 3 lyman 2009-05-14 05:51:59 UTC
I compiled 2.6.30-rc5 again, leave all new config parameter default value. It is same to 2.6.29 on my issue, nothing changed.
Comment 4 Luis Chamberlain 2009-05-16 23:30:42 UTC
You must not only stop network manager you must pkill wpa_supplicant. Please check:

http://wireless.kernel.org/en/users/Documentation/Reporting_bugs

Then please verify neither network manager is running nor is wpa_supplicant in the background. Please post the output of dmesg after bootup.
Comment 5 lyman 2009-05-17 02:21:33 UTC
Created attachment 21377 [details]
dmesg output
Comment 6 lyman 2009-05-17 02:34:11 UTC
confirmed with both networkmanager and wpa_supplicant down with 2.6.29.3
Comment 7 Luis Chamberlain 2009-05-17 04:03:37 UTC
I see no issues with the output. Can you please provide the output of:

rmmod ath9k
dmesg -c > /dev/null
modprobe debug=0xffffffff
ip link set wlan0 up
iwconfig wlan0 essid foobar
dmesg -c > log

Please also install iw and then provide the ouput of:

iw list

http://wireless.kernel.org/en/users/Documentation/iw
Comment 8 Luis Chamberlain 2009-05-17 04:04:09 UTC
I mean give me the log of the 'dmesg -c > log' part.
Comment 9 lyman 2009-05-17 10:17:07 UTC
I guess you missed ath9k in "modprobe debug=0xffffffff" :) however, there seems no debug parameter in ath9k module :(

FATAL: Error inserting ath9k (/lib/modules/2.6.29-ARCH/kernel/drivers/net/wireless/ath9k/ath9k.ko): Unknown symbol in module, or unknown parameter (see dmesg)
Comment 10 lyman 2009-05-17 10:17:39 UTC
Created attachment 21387 [details]
iw list
Comment 11 lyman 2009-05-17 10:18:32 UTC
Created attachment 21388 [details]
dmesg -c
Comment 12 Luis Chamberlain 2009-05-17 20:43:03 UTC
Yes I missed 'ath9k' in the command line I gave you.

OK so 2.6.29 didn't get the debug module parameter. To enable that you would have to apply a patch and recompile the kernel then. But anyway before you do that I'd like to ask you a few things and also ask you to try a few things because so far from the logs I see no issue what so ever and I suspect this is just might be a misconfiguration somewhere.

  * What AP do you have?
  * Is your AP 802.11n capable, if so do you have 802.11n enabled?
  * What channel and band (2.4 GHz or 5 GHz) is your AP on?
  * What channel is your AP on?
  * Are you using:
     * WPA
     * WPA2 (uses AES)
     * WEP
     * No encryption
  * What is your APs SSID?

If you are using encryption please disable it for now to first confirm we can establish an association with your AP.

Please provide the log of (before applying the patch):

rmmod ath9k
dmesg -c > /dev/null
modprobe ath9k
ip link set wlan0 up
iwlist wlan0 scan
iwconfig wlan0 essid foobar
dmesg -c > log

Then if you have enabled 802.11n please disable that and try the above again and provide the log of that as well.

Then repeat this with debug enabled by applying the patch I am attaching.
Comment 13 Luis Chamberlain 2009-05-17 21:43:09 UTC
Created attachment 21394 [details]
enable ath9k debug on 2.6.29

You can use this patch to enable debug for all messages for ath9k on 2.6.29.
Comment 14 lyman 2009-05-18 03:32:49 UTC
* What AP do you have?
  dlink di-524m

* Is your AP 802.11n capable, if so do you have 802.11n enabled?
  no, di-524m is a 802.11bg wireless router

* What channel and band (2.4 GHz or 5 GHz) is your AP on?
  here's the iwconfig result of my friend's pcmcia adapter (ath5k)
  wlan1     IEEE 802.11bg  ESSID:"link"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:22:B0:F7:F3:50   
          Bit Rate=24 Mb/s   Tx-Power=20 dBm   
          Retry min limit:7   RTS thr:off   Fragment thr=2352 B   
          Power Management:off
          Link Quality=14/100  Signal level:-85 dBm  Noise level=-90 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

* What channel is your AP on?
  2.412Ghz should be channel 1, I guess

* Are you using:
  yeah, I am using WPA2 (actually, there are WPA2 and WPA2-Auto in my router's admin page, I am using the latter one).

* What is your APs SSID?
  SSID is "link"

I'll disable the encryption and try again later.
Comment 15 lyman 2009-05-18 04:12:12 UTC
Created attachment 21396 [details]
dmesg without encryption, before applying debug patch

iwlist still says "wlan0 No scan results".
Comment 16 lyman 2009-05-18 06:28:59 UTC
Created attachment 21397 [details]
dmesg without encryption, applied debug patch

no more debug info is shown as expected, iwscan wlan0 scan says "wlan0 No scan results".
Comment 17 lyman 2009-05-18 06:33:02 UTC
if this is a misconfiguration issue, how can a pcmcia adapter (ath5k) work while the internal one (ath9k) can not?
Comment 18 vasanthakumar 2009-05-18 12:00:18 UTC
Can you please set the console message log level to 8 (dmesg -n 8) and take the dmesg out put with the patch which enables all debugs in ath9k?.
Comment 19 lyman 2009-05-18 15:39:58 UTC
Created attachment 21412 [details]
n8 level dmesg

no more logs.

I thought the "link" in the last line is my SSID, but it actually is not. It seems my adapter is not activated properly.
Comment 20 Luis Chamberlain 2009-05-18 17:42:39 UTC
Can you please post the output of

cat /proc/interrupts

What other wireless cards do you have? I see you had a wlan1.
Comment 21 Luis Chamberlain 2009-05-18 18:35:29 UTC
BTW please post the output of /proc/interrupts before your modprobe ath9k, after you modprobe ath9k, and then after you try to run 'ip link set wlan0 up' (please ensure wlan# matches the wlan# of ath9k, I noticed you have another wlan#...), then please also post the same /proc/interrupts after you've tried scanning.

What we should see is the interrupt count moving! Of course if its a shared interrupt then the counter is going to move without ath9k even so if possible remove those devices if you have any there so we can keep a local counter of just ath9k interrupts.

  Luis
Comment 22 lyman 2009-05-19 01:53:14 UTC
don't worry, wlan0 has always been ath9k. wlan1 is my friend's pcmcia adapter, it will be very troublesome for me to post here without it.

1d:00.0 Ethernet controller: Atheros Communications Inc. AR2413 802.11bg NIC (rev 01)
	Subsystem: Atheros Communications Inc. TP-Link TL-WN510G Wireless CardBus Adapter
	Flags: bus master, medium devsel, latency 168, IRQ 16
	Memory at dc000000 (32-bit, non-prefetchable) [size=64K]
	Capabilities: [44] Power Management version 2
	Kernel driver in use: ath5k
	Kernel modules: ath5k
Comment 23 lyman 2009-05-19 01:56:35 UTC
Created attachment 21419 [details]
interrupts

to avoid confusion, this is the output of a clean boot environment without any pcmcia adapter inserted.
Comment 24 lyman 2009-05-19 02:04:56 UTC
Created attachment 21420 [details]
interrupts

to avoid confusion, this is the output of a clean boot environment without any
pcmcia adapter inserted.
Comment 25 Luis Chamberlain 2009-05-19 02:40:03 UTC
OK good we have progress, I see interrupts hitting the card at least. Now lets debug that.

Please do the same with (dmesg logs and /proc/interrupts) with:

modprobe ath9k debug=0x00000010

this is the mask for debugging ath9k's interrupts. Here is a list just so you know:



        ATH_DBG_RESET           = 0x00000001,
        ATH_DBG_QUEUE           = 0x00000002,
        ATH_DBG_EEPROM          = 0x00000004,
        ATH_DBG_CALIBRATE       = 0x00000008,
        ATH_DBG_INTERRUPT       = 0x00000010,
        ATH_DBG_REGULATORY      = 0x00000020,
        ATH_DBG_ANI             = 0x00000040,
        ATH_DBG_XMIT            = 0x00000080,
        ATH_DBG_BEACON          = 0x00000100,
        ATH_DBG_CONFIG          = 0x00000200,
        ATH_DBG_FATAL           = 0x00000400,
        ATH_DBG_PS              = 0x00000800,
        ATH_DBG_ANY             = 0xffffffff

You can OR these together to get more stuff. If we see no outputs please change ath9k's main.c ath_isr(), to print stuff out for you for this check:

        /*
         * If there are no status bits set, then this interrupt was not
         * for me (should have been caught above).
         */
        if (!status)
                return IRQ_NONE;


Add a printk, like:

        /*
         * If there are no status bits set, then this interrupt was not
         * for me (should have been caught above).
         */
        if (!status) {
                printk("IRQ is ours but something cleared it!\n");
                return IRQ_NONE;
        }
Comment 26 lyman 2009-05-19 05:50:49 UTC
I am compiling kernel, it is so slow ... is there a way to compile ath9k.ko only?
Comment 27 Luis Chamberlain 2009-05-19 06:40:08 UTC
if on 2.6.29 or 2.6.30

make M=drivers/net/wireless/ath9k

if on wireless-testing

make M=drivers/net/wireless/ath/ath9k/
Comment 28 lyman 2009-05-19 07:35:52 UTC
Created attachment 21423 [details]
interrupts with printk

ath9k does not accept debug parameter, I've applied the enable debug patch.

I didn't see much difference between this one and last one. New added printk line seems not being triggered.
Comment 29 lyman 2009-05-24 11:31:15 UTC
Hi, Luis

I think I've found out the reason.

There's a switch on my laptop which controls only bluetooth before 2.6.29. However, things changed since 2.6.29. It controls both bluetooth and wifi now. I'll have to turn the switch on to make ath9k work. I checked the laptop manual, the switch is named "wireless switch". So, this should be my stupid mistake other than any kind of bug.

Sorry for bother you so long.