Bug 214543

Summary: ath11k card on dell XPS 12 9310 prevent low power PC states.
Product: Drivers Reporter: s.zharkoff
Component: network-wirelessAssignee: Kalle Valo (kvalo)
Status: RESOLVED CODE_FIX    
Severity: normal CC: kvalo, mark.herbert42
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 5.10 - 5.15-rc3 Subsystem:
Regression: No Bisected commit-id:

Description s.zharkoff 2021-09-27 12:24:18 UTC
Tried on all kernels where ath11k is working, including Kale Valo pending-master git. 

When wifi is connected (just connected, no transfer is happening) - CPU never goes below package state C6(pc6) (measured by powertop).  Sometimes even gets stuck on C3(pc3). Power consumption with nothing running and screen closed - 1.9 watts.

When wifi is disconnected - CPU stays 80-85% in C10 (PC10) and consumes 0.8-0.9 watts of power under the same condition.

for the comparison iwlwifi based XPS 9310 (same but 16gb ram) stays 80-90% in C10 (PC10) and 0.8-0.9 watts power even with wifi connected.
Comment 1 Mark Herbert 2021-10-10 12:23:57 UTC
Tested on my 9310 32GB 5.14.11

Simply disabling wifi  drops 0.8-1 watts from power consumption.  Comparing almost same model (16 gb RAM vs 32) but based on Intel card shows the same difference - Intel based laptop with WiFi connected consumes about same as ath11k with Wifi discnnected.

Powertop  newer shows PC states below PC6. Disabling WiFi allows PC8, disabling ath11k completely (bios) - PC10.

Wifi enabled

           Pkg(HW) 
C2 (pc2)   18,5%    | 
C3 (pc3)   14,2%    |
C6 (pc6)   47,5%    |
C7 (pc7)    0,0%    |
C8 (pc8)    0,0%    |
C9 (pc9)    0,0%    |
C10 (pc10)  0,0%    |

Wfi disabled (by networkmanager/nm-applet)


           Pkg(HW)
C2 (pc2)   10,8%    |
C3 (pc3)   18,5%    |
C6 (pc6)    1,1%    |
C7 (pc7)    0,3%    |
C8 (pc8)   28,3%    | 
C9 (pc9)    0,0%    | 
C10 (pc10)  0,0%    |         

Seems that even on no network activity ath11k forces CPU to stay awake and eat battery. There are some background transfer happening as I have Viber, thunderbird and firefox opened so I bet they do sent some but there is no file transfers, media streams etc. Under the same conditions (taking this disk from one 9310 to other 9310 - same software, same kernel - just wifi's different) - iwlwifi manages to reach PC8-PC10 being connected.  With ath10k on dell XPS-13 9350 intel also was saving battery much better than ath10k, bit there was like 88% of PC10 with intel and 65% PC10 and 20% PC8 with ath10k. But it was not such terribly bad as with ath11.
Comment 2 Kalle Valo 2021-10-28 11:47:07 UTC
There's now a proposed patch but unfortunately it needs some work:

https://patchwork.kernel.org/project/linux-wireless/patch/20211011190625.4463-1-cjhuang@codeaurora.org/
Comment 3 Kalle Valo 2021-11-10 17:09:24 UTC
The commit which should fix this:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=ath-next&id=b2beffa7d9a67b59b085616a27f1d10b1e80784f

If all goes well the commit will be in v5.17.