Bug 782450

Summary: ath9k consumes 3.3 W of power
Product: [Fedora] Fedora Reporter: Adarsha HD <adarshahd>
Component: kernelAssignee: John W. Linville <linville>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 16CC: adarshahd, dcbw, gansalmon, itamar, jonathan, kernel-maint, linville, madhu.chinakonda, shafi.wireless
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-04 15:15:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
lspci -vvnn log
none
PowerTop Report
none
PowerTop Report(New)
none
ASPM L1 enable script
none
PowerTop Report(latest)
none
dmesg output for ath9k none

Description Adarsha HD 2012-01-17 14:18:12 UTC
Description of problem:
The ath9k driver on my Asus Laptop consumes very high power. It was measured using powertop. 

Please revert to me what extra details would be required, I will provide the same.

Comment 1 Mohammed Shafi 2012-01-18 05:42:06 UTC
please provide the attachment of lspci -vvnn. under what scenario the power consumption goes up.

Comment 2 Adarsha HD 2012-01-18 06:22:31 UTC
Created attachment 555917 [details]
lspci -vvnn log

Comment 3 Adarsha HD 2012-01-18 06:26:17 UTC
Hi Shafi,

Please find the o/p of lspci -vvnn. From the time I start my machine till I shutdown the power consumption of ath9k remains at around 3W. Its a brand new Laptop.

Also the battery backup of my laptop on Fedora 16 is just 1.5 hours!
I do not use Windows, so can not compare it with. However on googling I found out that it is atleast around 3 hours.

Please revert to me if any more details are required.

Regards,
Adarsha HD.

Comment 4 Mohammed Shafi 2012-01-18 06:45:41 UTC
Hi Adarsha,

please post your powertop tool dump. also please try with the latest compat wireless if it helps.
http://linuxwireless.org/en/users/Download#Where_to_download_bleeding_edge
also ASPM is not enabled, we can try that too.

Comment 5 Mohammed Shafi 2012-01-18 06:54:58 UTC
Hi Adarsha,

please post your powertop tool dump. also please try with the latest compat wireless if it helps.
http://linuxwireless.org/en/users/Download#Where_to_download_bleeding_edge
also ASPM is not enabled, we can try that too.

Comment 6 Adarsha HD 2012-01-18 07:12:02 UTC
Created attachment 555936 [details]
PowerTop Report

Comment 7 Adarsha HD 2012-01-18 07:13:03 UTC
Hi Shafi,

Please find the attached PowerTop Report.

Regards,
Adarsha HD

Comment 8 Adarsha HD 2012-01-18 08:03:21 UTC
Created attachment 555942 [details]
PowerTop Report(New)

Wow! compat-wireless dramatically decreased the power consumption of the ath9k.
However the display is consuming more power :-( (as you can see in the new powertop report)

Comment 9 Mohammed Shafi 2012-01-18 08:59:30 UTC
please load with sudo modprobe ath9k -v debug=0x601 with debug enabled
http://linuxwireless.org/en/users/Drivers/ath9k/debug
in idle state/ when device is just associated we should have PS transistions
ath: AWAKE -> NETWORK SLEEP
ath: NETWORK SLEEP -> AWAKE

also we can compare by enabling ASPM
http://linuxwireless.org/en/users/Documentation/ASPM

please make sure you change the correct ROOT_COMPLEX and endpoint(explained in above doc link)
attached the script for it to enable L1 ASPM

Comment 10 Mohammed Shafi 2012-01-18 09:00:10 UTC
Created attachment 555958 [details]
ASPM L1 enable script

Comment 11 Adarsha HD 2012-01-18 11:05:14 UTC
Hi Shafi,

I do not want to take chance in judging the root_complex and endpoints. Here is the output of the lspci -t and lspci. Could you please confirm the root_complex and endpoint are 

ROOT_COMPLEX="00:1c.1"
ENDPOINT="03:00.0"

# lspci -t
-[0000:00]-+-00.0
           +-01.0-[01]----00.0
           +-02.0
           +-16.0
           +-1a.0
           +-1b.0
           +-1c.0-[02]--
           +-1c.1-[03]----00.0
           +-1c.3-[04]----00.0
           +-1c.5-[05]----00.0
           +-1d.0
           +-1f.0
           +-1f.2
           \-1f.3

# lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5)
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5)
00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 6 (rev b5)
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation HM65 Express Chipset Family LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)
01:00.0 VGA compatible controller: nVidia Corporation Device 1051 (rev a1)
03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)
04:00.0 USB Controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host Controller
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)

Also the powertop report I had attached for the second time was just after I restarted my machine. So the actual power consumption of ath9k went up after I started browsing. But still it was 50% less compared to original :-). I have attached the revised PowerTop report. 

I recompiled the compat_wireless with debug enabled and attached the dmesg output also. It seems there are lot of wakeups/sleeps present. 

Once you confirm the root_complex and endpoint I will provide the results of ASPM also.

Regards,
Adarsha HD.

Comment 12 Adarsha HD 2012-01-18 11:06:27 UTC
Created attachment 555991 [details]
PowerTop Report(latest)

Comment 13 Adarsha HD 2012-01-18 11:07:48 UTC
Created attachment 555992 [details]
dmesg output for ath9k

Comment 14 Mohammed Shafi 2012-01-18 11:38:00 UTC
(In reply to comment #11)
> Hi Shafi,
> 
> I do not want to take chance in judging the root_complex and endpoints. Here is
> the output of the lspci -t and lspci. Could you please confirm the root_complex
> and endpoint are 
> 
> ROOT_COMPLEX="00:1c.1"
> ENDPOINT="03:00.0"
> 
> # lspci -t
> -[0000:00]-+-00.0
>            +-01.0-[01]----00.0
>            +-02.0
>            +-16.0
>            +-1a.0
>            +-1b.0
>            +-1c.0-[02]--
>            +-1c.1-[03]----00.0
>            +-1c.3-[04]----00.0
>            +-1c.5-[05]----00.0
>            +-1d.0
>            +-1f.0
>            +-1f.2
>            \-1f.3
> 
> # lspci
> 00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family
> DRAM Controller (rev 09)
> 00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core
> Processor Family PCI Express Root Port (rev 09)
> 00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core
> Processor Family Integrated Graphics Controller (rev 09)
> 00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series
> Chipset Family MEI Controller #1 (rev 04)
> 00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family
> USB Enhanced Host Controller #2 (rev 05)
> 00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family
> High Definition Audio Controller (rev 05)
> 00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI
> Express Root Port 1 (rev b5)
> 00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI
> Express Root Port 2 (rev b5)
> 00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI
> Express Root Port 4 (rev b5)
> 00:1c.5 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI
> Express Root Port 6 (rev b5)
> 00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family
> USB Enhanced Host Controller #1 (rev 05)
> 00:1f.0 ISA bridge: Intel Corporation HM65 Express Chipset Family LPC
> Controller (rev 05)
> 00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family
> 6 port SATA AHCI Controller (rev 05)
> 00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus
> Controller (rev 05)
> 01:00.0 VGA compatible controller: nVidia Corporation Device 1051 (rev a1)
> 03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network
> Adapter (PCI-Express) (rev 01)
> 04:00.0 USB Controller: ASMedia Technology Inc. ASM1042 SuperSpeed USB Host
> Controller
> 05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI
> Express Gigabit Ethernet controller (rev 06)
> 
> Also the powertop report I had attached for the second time was just after I
> restarted my machine. So the actual power consumption of ath9k went up after I
> started browsing. But still it was 50% less compared to original :-). I have
> attached the revised PowerTop report. 
> 
> I recompiled the compat_wireless with debug enabled and attached the dmesg
> output also. It seems there are lot of wakeups/sleeps present. 
> 
> Once you confirm the root_complex and endpoint I will provide the results of
> ASPM also.
> 
> Regards,
> Adarsha HD.

hi,

looks correct to me(for ASPM). one weird thing i saw in compat wireless is when you reboot with ath9k from compat-wireless, please make sure power save is enabled (check with iwconfig) also via ath9k debug messages. again this should not happen if you are running the laptop with battery power alone. after rebooting try to unload and load the driver, see if it anyway helps. let me try to install the powertop showing power consumption(my stable version does not has it)

Comment 15 Mohammed Shafi 2012-01-18 11:41:32 UTC
Hi Adarsha,

some idea about ath9k power consumption
http://linuxwireless.org/en/users/Drivers/ath9k/power-consumption

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

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

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