Bug 108411

Summary: ACPI never reports fully-charged status for ASUS Zenbook UX305CA battery - Intel Skylake
Product: ACPI Reporter: János Illés (ijanos)
Component: BIOSAssignee: Zhang Rui (rui.zhang)
Status: CLOSED MOVED    
Severity: normal CC: aaron.lu, lenb, rui.zhang
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: 4.4-rc2 Subsystem:
Regression: No Bisected commit-id:
Attachments: upower --dump
dmesg
acpidump

Description János Illés 2015-11-24 21:41:47 UTC
Created attachment 195341 [details]
upower --dump

acpi command properly reports adapter online/offline status and the battery remaining time is calculated properly but the battery is always in discharging or charging state. This breaks Gnome UI which reports 89 hours remaining time when the laptop is plugged in and charged fully. 


When I plugin the charger I see this line appear in the logs, don't know if related or not. 

    kernel: asus_wmi: Unknown key cf pressed


I'm not sure what files should I provide so I attached the output of upower --dump with a fully charged battery with the adapter plugged in. 

I'll gladly provide further files of command output.
Comment 1 Aaron Lu 2015-12-14 03:02:28 UTC
(In reply to János Illés from comment #0)
> Created attachment 195341 [details]
> upower --dump
> 
> acpi command properly reports adapter online/offline status and the battery
> remaining time is calculated properly but the battery is always in
> discharging or charging state. This breaks Gnome UI which reports 89 hours
> remaining time when the laptop is plugged in and charged fully. 

OK, so the charging state is wrong. Can you please attach dmesg, acpidump too?
# dmesg > dmesg
# acpidump > acpidump.txt
Comment 2 János Illés 2015-12-14 06:47:59 UTC
Created attachment 197291 [details]
dmesg
Comment 3 János Illés 2015-12-14 06:48:47 UTC
Created attachment 197301 [details]
acpidump
Comment 4 Zhang Rui 2015-12-28 13:04:27 UTC
This seems to be a BIOS problem to me.
On this laptop, ACPI battery driver just reads the IO register to get battery status, which is either charging or discharging.

Do you have windows installed? If yes, please check if windows has the same problem.

Another way to fix this is to add a new logic in upower,
if AC on line {
  if battery charging
     return battery status = charging
  else
     return battery status = charged /* battery can not be discharging when AC is on */ 
}
But anyway, this is not a kernel bug to me.
Comment 5 János Illés 2015-12-28 20:50:08 UTC
I've had a windows installation that I since removed so I cannot check but I'm pretty sure it didn't had this problem.
Comment 6 Zhang Rui 2015-12-29 00:16:44 UTC
Well, like I said, the root cause of this problem is that BIOS returns bad Battery status, and there is noway for kernel to fix it.
Maybe windows uses the same logic like I proposed for Linus userspace.

Could you raise this issue to upower instead? Because I really don't see anything we could do in kernel.
Comment 7 János Illés 2015-12-29 08:49:55 UTC
I opened a ticket. 

https://bugs.freedesktop.org/show_bug.cgi?id=93529
Comment 8 Zhang Rui 2016-03-15 07:57:57 UTC
tracked in freedesktop instead.