Bug 11570 - ath9k lose connection
Summary: ath9k lose connection
Status: CLOSED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: John W. Linville
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-15 01:50 UTC by Alexey Kuznetsov
Modified: 2008-09-24 07:25 UTC (History)
2 users (show)

See Also:
Kernel Version: last git (2.6.27-rc6+)
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Alexey Kuznetsov 2008-09-15 01:50:33 UTC
Latest working kernel version: never
Earliest failing kernel version: never
Distribution: fedora 9 + git kernel
Hardware Environment: macbook pro


I got strange state of my atheros wifi adapter.

After some time of work with wifi connection i got lose route to my lan network. That look like transmission are broken. I can see everything work fine: My wifi connection established, signal strength is good, wifi adapter responding, wifi router responding but i have no packets input/output.

Here the state:

[axet@axet-laptop ~]$ iwconfig  wlan0

wlan0     IEEE 802.11abgn  ESSID:"wifi.local"  

          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:1C:F0:BD:01:06   

          Bit Rate=1 Mb/s   Tx-Power=23 dBm   

          Retry min limit:7   RTS thr:off   Fragment thr=2352 B   

          Power Management:off

          Link Quality=39/100  Signal level:-70 dBm  Noise level=-95 dBm

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0



[axet@axet-laptop ~]$ 


[axet@axet-laptop ~]$ iwlist wlan0 scan

wlan0     Scan completed :

          Cell 01 - Address: 00:1C:F0:BD:01:06

                    ESSID:"wifi.local"

                    Mode:Master

                    Channel:1

                    Frequency:2.412 GHz (Channel 1)

                    Quality=54/100  Signal level:-60 dBm  Noise level=-95 dBm

                    Encryption key:on

                    IE: IEEE 802.11i/WPA2 Version 1

                        Group Cipher : CCMP

                        Pairwise Ciphers (1) : CCMP

                        Authentication Suites (1) : PSK

                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s

                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s

                              48 Mb/s; 54 Mb/s

                    Extra:tsf=0000002fcc69e1b1

                    Extra: Last beacon: 97ms ago



[axet@axet-laptop ~]$ 


[axet@axet-laptop ~]$ ifconfig  wlan0

wlan0     Link encap:Ethernet  HWaddr 00:19:E3:D3:7B:51  

          inet addr:192.168.54.5  Bcast:192.168.54.255  Mask:255.255.255.0

          inet6 addr: fe80::219:e3ff:fed3:7b51/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:221582 errors:0 dropped:0 overruns:0 frame:0

          TX packets:201102 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:261861750 (249.7 MiB)  TX bytes:22927461 (21.8 MiB)



[axet@axet-laptop ~]$ 



/var/log/messages at problem time:
Sep 15 12:34:50 localhost NetworkManager: <info>  (wlan0): supplicant connection state change: 7 -> 6

Sep 15 12:34:50 localhost NetworkManager: <info>  (wlan0): supplicant connection state change: 6 -> 7



[axet@axet-laptop ~]$ ps aux|grep wpa

root      2221  0.0  0.0   5452  1704 ?        S    10:10   0:00 /usr/sbin/wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf -u -f /var/log/wpa_supplicant.log

axet     11449  0.0  0.0   5040   700 pts/0    R+   12:44   0:00 grep wpa

[axet@axet-laptop ~]$ 



/var/log/wpa_supplicant.log


Associated with 00:1c:f0:bd:01:06

WPA: Key negotiation completed with 00:1c:f0:bd:01:06 [PTK=CCMP GTK=CCMP]

CTRL-EVENT-CONNECTED - Connection to 00:1c:f0:bd:01:06 completed (reauth) [id=0 id_str=]

WPA: Group rekeying completed with 00:1c:f0:bd:01:06 [GTK=CCMP]



but have no route to host:

[axet@axet-laptop ~]$ telnet 192.168.54.1

Trying 192.168.54.1...

telnet: connect to address 192.168.54.1: No route to host

[axet@axet-laptop ~]$ 


when i sequentially run ifconfig wlan0, i get only  TX packets increace counter, and static RX packets.


No errors on dmesg. Normal icon on NetworkManger (gnome) with signal strength. To fix that state i need reconnect to wifi adapter.
Comment 1 Alexey Kuznetsov 2008-09-16 03:00:39 UTC
happens again... can happens every 5 minutes or one time on week...

there is route table:
[axet@axet-laptop ~]$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.54.0    0.0.0.0         255.255.255.0   U     0      0        0 wlan0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
0.0.0.0         192.168.54.1    0.0.0.0         UG    0      0        0 wlan0
[axet@axet-laptop ~]$ 
Comment 2 Alexey Kuznetsov 2008-09-16 03:18:45 UTC
Probably that state related to other wifi devices. In most cases i got transmission lost when my second notebook (asus m3n old guy) turned on. 

I think that is not a router bug because i had never problems with my m3n connection, problem happens only with my macbook pro with ath9k driver. 

maybe ath9k do some wrong packet encryption or packet seq num is not same as ath9k except.
Comment 3 Senthil Balasubramanian 2008-09-17 00:20:22 UTC
The following patch submitted to linux wireless should fix this issue. I have verified this at my end.


[PATCH] ath9k: connectivity is lost after Group rekeying is done
Comment 5 Senthil Balasubramanian 2008-09-17 06:35:14 UTC
The fix is not yet into the linux wireless tree. I have submitted it to linux wireless mailing list. the linux wireless mailing list can be accessed from the following location

http://marc.info/?l=linux-wireless&r=1&b=200809&w=2
Comment 6 Alexey Kuznetsov 2008-09-18 06:17:13 UTC
One day done without accidents... Look like that patch solve problem.
Comment 7 Alexey Kuznetsov 2008-09-23 05:58:42 UTC
seems to be fixed, one week without accidents.

patch should be in git. thx Senthil!
Comment 8 John W. Linville 2008-09-23 10:17:51 UTC
Sent to Dave M, he has it queued for Linus...
Comment 9 John W. Linville 2008-09-24 07:25:47 UTC
commit d0be7cc7688d0cc2e4daf952c43b5ce86e5c8a1d
Author: Senthil Balasubramanian <senthilkumar@atheros.com>
Date:   Wed Sep 17 12:39:49 2008 +0530

    ath9k: connectivity is lost after Group rekeying is done

    Connectivtiy is lost after Group rekeying is done. The keytype
    maintained by ath9k is reset when group key is updated. Though
    sc_keytype can be reset only for broadcast key the proper fix
    would be to use mac80211 provided key type from txinfo during
    xmit and get rid of sc_keytype from ath9k ath_softc.

    Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
    Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
    Tested-by: Steven Noonan <steven@uplinklabs.net>
    Signed-off-by: John W. Linville <linville@tuxdriver.com>

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