Bug 36492

Summary: iwl4965 slow connection- package loss
Product: Drivers Reporter: Marko (markodevelop)
Component: network-wirelessAssignee: Stanislaw Gruszka (stf_xl)
Status: CLOSED CODE_FIX    
Severity: normal CC: akpm, florian, stf_xl
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.39 Subsystem:
Regression: No Bisected commit-id:
Attachments: iwl logs for 2.6.39
iwl logs for 2.6.37
iwl logs for 2.6.37
iwl logs for 2.6.39
send_tx_power_after_rxon_assoc.patch
set_tx_power_only_when_needed.patch

Description Marko 2011-06-01 23:48:45 UTC
Created attachment 60502 [details]
iwl logs for 2.6.39

The wireless connection, using the iwl4965 driver from kernel 2.6.29 is slow compared with the one from kernel 2.6.37-r2. 

lspci |grep -i wireless
14:00.0 Network controller: Intel Corporation PRO/Wireless 4965 AG or AGN [Kedron] Network Connection (rev 61)

wlan0     IEEE 802.11abgn  ESSID:"sid123"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: xxx  
          Bit Rate=1 Mb/s   Tx-Power=14 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=59/70  Signal level=-51 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:8  Invalid misc:25   Missed beacon:0

Kernel 2.6.37:

modinfo iwlagn
filename:       /lib/modules/2.6.37-gentoo-r2/kernel/drivers/net/wireless/iwlwifi/iwlagn.ko
alias:          iwl4965
license:        GPL
author:         Copyright(c) 2003-2010 Intel Corporation <ilw@linux.intel.com>
version:        in-tree:d
description:    Intel(R) Wireless WiFi Link AGN driver for Linux
firmware:       iwlwifi-4965-2.ucode
firmware:       iwlwifi-5150-2.ucode
firmware:       iwlwifi-5000-2.ucode
firmware:       iwlwifi-130-5.ucode
firmware:       iwlwifi-6000g2b-5.ucode
firmware:       iwlwifi-6000g2a-5.ucode
firmware:       iwlwifi-6050-5.ucode
firmware:       iwlwifi-6000-4.ucode
firmware:       iwlwifi-100-5.ucode
firmware:       iwlwifi-1000-3.ucode
srcversion:     7D88AD0FB2555D0E1BA4B48

depends:        iwlcore,mac80211,cfg80211
vermagic:       2.6.37-gentoo-r2 SMP mod_unload

ping www.google.com
...
--- www.l.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 49.373/50.167/50.858/0.538 ms

kernel module loaded with

modprobe iwlagn debug=0x47fffff

Logs are captured in iwl-good-2.6.37.log
System logger syslog-ng. Filter used 
filter f_iwl { facility(kern) and message("iwl4965.*"); };

kernel 2.6.39

ping www.google.com
...
--- www.google.com ping statistics ---
9 packets transmitted, 8 received, 11% packet loss, time 8008ms
rtt min/avg/max/mdev = 48.856/52.062/57.012/2.885 ms


Logs are captured in iwl-bad-2.6.39.log

System logger syslog-ng. Filter used filter 
f_iwl { facility(kern) and message("iwlagn*"); };
Comment 1 Marko 2011-06-01 23:50:34 UTC
Created attachment 60512 [details]
iwl logs for 2.6.37
Comment 2 Andrew Morton 2011-06-01 23:53:29 UTC
recategorised to drivers-network-wireless
Comment 3 Stanislaw Gruszka 2011-06-02 11:09:56 UTC
> facility(kern) and message("iwl4965.*"); };

I guess you wanted to make log analyse easier, but unfortunate effect is opposite. Log missing messages from functions started by iwl_ and others that are needed to see what is going on. Please provide logs with _all_ kernel messages. Thanks.
Comment 4 Marko 2011-06-03 02:01:29 UTC
Created attachment 60582 [details]
iwl logs for 2.6.37
Comment 5 Marko 2011-06-03 02:02:50 UTC
Created attachment 60592 [details]
iwl logs for 2.6.39
Comment 6 Stanislaw Gruszka 2011-06-03 18:52:20 UTC
Created attachment 60662 [details]
send_tx_power_after_rxon_assoc.patch

Please test this patch. If it does not help, try to disable bluetooth coexistence:

modprobe -r iwl4965
modprobe iwl_legacy bt_coex_active=0
modprobe iwl4965

and report back.
Comment 7 Marko 2011-06-03 23:41:19 UTC
works like a charm :)
Would you still need logs created with the patched module ?
Do I need to let the parameter bt_coex_active=0 as a permanent setting ?
Comment 8 Stanislaw Gruszka 2011-06-04 17:37:50 UTC
I'm glad it works. No more info is needed, I'll post the patch.
Comment 9 Stanislaw Gruszka 2011-06-09 07:01:36 UTC
Created attachment 61322 [details]
set_tx_power_only_when_needed.patch

I posted previous patch and it is on the way upstream (currently on wireless-2.6 tree), but I realized that better fix is possible, witch do not send tx power setting to device all the time, but only when these settings changed.

Marko, can you test that patch and see if driver still works? Patch is on top of my previous one.
Comment 10 Florian Mickler 2011-06-14 11:21:56 UTC
A patch referencing this bug report has been merged in v3.0-rc3:

commit 51892dbbd511911c0f965a36b431fc3e8f1e4f8a
Author: Stanislaw Gruszka <sgruszka@redhat.com>
Date:   Mon Jun 6 15:11:30 2011 +0200

    iwl4965: set tx power after rxon_assoc