Bug 193061
Summary: | Razer Blaze Stealth laptop battery shows discharging instead of full | ||
---|---|---|---|
Product: | ACPI | Reporter: | Jason Dewayne Clinton (me) |
Component: | Power-Battery | Assignee: | Zhang Rui (rui.zhang) |
Status: | CLOSED DOCUMENTED | ||
Severity: | normal | CC: | renault, rui.zhang |
Priority: | P1 | ||
Hardware: | Intel | ||
OS: | Linux | ||
Kernel Version: | 4.9 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
Attached acpidump when still charging
Attached acpidump when reached full |
Description
Jason Dewayne Clinton
2017-01-21 04:25:15 UTC
please attach the acpidump output Created attachment 254531 [details]
Attached acpidump when still charging
Created attachment 254541 [details]
Attached acpidump when reached full
please attach the output of "grep . /sys/class/power_supply/*/*" both when the battery shows normal and abnormal. ping... === = Abnormal (charged, AC online but showing discharging) === $ grep . /sys/class/power_supply/*/* grep: /sys/class/power_supply/AC0/device: Is a directory /sys/class/power_supply/AC0/online:1 grep: /sys/class/power_supply/AC0/power: Is a directory grep: /sys/class/power_supply/AC0/subsystem: Is a directory /sys/class/power_supply/AC0/type:Mains /sys/class/power_supply/AC0/uevent:POWER_SUPPLY_NAME=AC0 /sys/class/power_supply/AC0/uevent:POWER_SUPPLY_ONLINE=1 /sys/class/power_supply/BAT0/alarm:0 /sys/class/power_supply/BAT0/capacity:96 /sys/class/power_supply/BAT0/capacity_level:Normal /sys/class/power_supply/BAT0/charge_full:4584000 /sys/class/power_supply/BAT0/charge_full_design:4640000 /sys/class/power_supply/BAT0/charge_now:4408000 /sys/class/power_supply/BAT0/current_now:0 /sys/class/power_supply/BAT0/cycle_count:0 grep: /sys/class/power_supply/BAT0/device: Is a directory /sys/class/power_supply/BAT0/manufacturer:Razer /sys/class/power_supply/BAT0/model_name:Razer Blade Stealth grep: /sys/class/power_supply/BAT0/power: Is a directory /sys/class/power_supply/BAT0/present:1 /sys/class/power_supply/BAT0/serial_number:cnb1rc30019669501218 /sys/class/power_supply/BAT0/status:Discharging grep: /sys/class/power_supply/BAT0/subsystem: Is a directory /sys/class/power_supply/BAT0/technology:Unknown /sys/class/power_supply/BAT0/type:Battery /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_NAME=BAT0 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_STATUS=Discharging /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_PRESENT=1 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_TECHNOLOGY=Unknown /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CYCLE_COUNT=0 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11550000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_VOLTAGE_NOW=12976000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CURRENT_NOW=0 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CHARGE_FULL_DESIGN=4640000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CHARGE_FULL=4584000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CHARGE_NOW=4408000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CAPACITY=96 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CAPACITY_LEVEL=Normal /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_MODEL_NAME=Razer Blade Stealth /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_MANUFACTURER=Razer /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_SERIAL_NUMBER=cnb1rc300... /sys/class/power_supply/BAT0/voltage_min_design:11550000 /sys/class/power_supply/BAT0/voltage_now:12976000 === = Normal (charging, AC online) === $ grep . /sys/class/power_supply/*/* grep: /sys/class/power_supply/AC0/device: Is a directory /sys/class/power_supply/AC0/online:1 grep: /sys/class/power_supply/AC0/power: Is a directory grep: /sys/class/power_supply/AC0/subsystem: Is a directory /sys/class/power_supply/AC0/type:Mains /sys/class/power_supply/AC0/uevent:POWER_SUPPLY_NAME=AC0 /sys/class/power_supply/AC0/uevent:POWER_SUPPLY_ONLINE=1 /sys/class/power_supply/BAT0/alarm:0 /sys/class/power_supply/BAT0/capacity:91 /sys/class/power_supply/BAT0/capacity_level:Normal /sys/class/power_supply/BAT0/charge_full:4573000 /sys/class/power_supply/BAT0/charge_full_design:4640000 /sys/class/power_supply/BAT0/charge_now:4178000 /sys/class/power_supply/BAT0/current_now:195000 /sys/class/power_supply/BAT0/cycle_count:0 grep: /sys/class/power_supply/BAT0/device: Is a directory /sys/class/power_supply/BAT0/manufacturer:Razer /sys/class/power_supply/BAT0/model_name:Razer Blade Stealth grep: /sys/class/power_supply/BAT0/power: Is a directory /sys/class/power_supply/BAT0/present:1 /sys/class/power_supply/BAT0/serial_number:cnb1rc30019669501218 /sys/class/power_supply/BAT0/status:Charging grep: /sys/class/power_supply/BAT0/subsystem: Is a directory /sys/class/power_supply/BAT0/technology:Unknown /sys/class/power_supply/BAT0/type:Battery /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_NAME=BAT0 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_STATUS=Charging /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_PRESENT=1 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_TECHNOLOGY=Unknown /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CYCLE_COUNT=0 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11550000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_VOLTAGE_NOW=12475000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CURRENT_NOW=195000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CHARGE_FULL_DESIGN=4640000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CHARGE_FULL=4573000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CHARGE_NOW=4178000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CAPACITY=91 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CAPACITY_LEVEL=Normal /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_MODEL_NAME=Razer Blade Stealth /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_MANUFACTURER=Razer /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_SERIAL_NUMBER=cnb1rc300... /sys/class/power_supply/BAT0/voltage_min_design:11550000 /sys/class/power_supply/BAT0/voltage_now:12475000 Method (_BST, 0, NotSerialized) // _BST: Battery Status { If (^^EC0.ECON == One) { BFB0 [Zero] = ^^EC0.BST0 /* \_SB_.PCI0.LPCB.EC0_.BST0 */ BFB0 [One] = ^^EC0.BST1 /* \_SB_.PCI0.LPCB.EC0_.BST1 */ BFB0 [0x02] = ^^EC0.BST2 /* \_SB_.PCI0.LPCB.EC0_.BST2 */ BFB0 [0x03] = ^^EC0.BST3 /* \_SB_.PCI0.LPCB.EC0_.BST3 */ Local0 = ^^EC0.PSTA /* \_SB_.PCI0.LPCB.EC0_.PSTA */ Local0 &= 0x83 If (Local0 == 0x82) { Return (BFB0) /* \_SB_.PCI0.LPCB.BAT0.BFB0 */ } If (Local0 == 0x83) { Return (BFB0) /* \_SB_.PCI0.LPCB.BAT0.BFB0 */ } If (Local0 == 0x81) { Return (BFB1) /* \_SB_.PCI0.LPCB.BAT0.BFB1 */ } Return (BFB1) /* \_SB_.PCI0.LPCB.BAT0.BFB1 */ } Else { Return (BFB1) /* \_SB_.PCI0.LPCB.BAT0.BFB1 */ } } This is the control method that ACPI uses to get Battery status. And we can see that it may either return a package containing information get from EC firmware (BFB0), or a dummy packages containing invalid information (BFB1). And from the log attached above, we can see that _BST still returns valid voltage_now/current_now/charge_now information, so I think the problem is that EC firmware does not return proper battery status information, and Linux kernel just translate the bogus battery status information to user space. Any guesses as to why a fresh Windows 10 install on the same hardware (no additional driver installation) has the UI showing the correct information? Did maybe Razer get a hack into Windows 10 base image for the EC firmware bug? And in order to make kernel return 'charged', we need 1. ^^EC0.BST0 returns 0, which indicates the battery is neither charging, nor discharging 2. ^^EC0.BST2 returns the battery remaining capacity either equals "Design full capacity" or "Last full charge capacity" Bug closed as this is a firmware issue to me. Unless another battery driver is used instead of the standard ACPI battery driver, in which case, it is a gap that we need another battery driver in Linux, rather than an ACPI battery driver bug. (In reply to Jason Dewayne Clinton from comment #8) > Any guesses as to why a fresh Windows 10 install on the same hardware (no > additional driver installation) has the UI showing the correct information? Hah, good catch, can you please check windows device manager and see what battery device windows is using? and does it help if you boot with kernel parameters acpi_osi=! acpi_osi="Windows 2015"? Device Manager in Windows 10: Microsoft ACPI-Compliant Control Method Battery version 10.0.14393.0. Under right-click Properties > Details > Property "BIOS device name": \_SB.PCI0.LPCB.BAT0 I will post kernel boot option next. $ cat /proc/cmdline BOOT_IMAGE=/vmlinuz-4.11.0-0.rc3.git0.2.fc26.x86_64 root=/dev/mapper/fedora_jclinton--laptop-root ro rd.lvm.lv=fedora_jclinton-laptop/root rd.luks.uuid=... rd.lvm.lv=fedora_jclinton-laptop/swap acpi_osi=! "acpi_osi=Windows 2015" rhgb quiet LANG=en_US.UTF-8 $ grep . /sys/class/power_supply/*/* grep: /sys/class/power_supply/AC0/device: Is a directory /sys/class/power_supply/AC0/online:1 grep: /sys/class/power_supply/AC0/power: Is a directory grep: /sys/class/power_supply/AC0/subsystem: Is a directory /sys/class/power_supply/AC0/type:Mains /sys/class/power_supply/AC0/uevent:POWER_SUPPLY_NAME=AC0 /sys/class/power_supply/AC0/uevent:POWER_SUPPLY_ONLINE=1 /sys/class/power_supply/BAT0/alarm:0 /sys/class/power_supply/BAT0/capacity:99 /sys/class/power_supply/BAT0/capacity_level:Normal /sys/class/power_supply/BAT0/charge_full:4573000 /sys/class/power_supply/BAT0/charge_full_design:4640000 /sys/class/power_supply/BAT0/charge_now:4572000 /sys/class/power_supply/BAT0/current_now:0 /sys/class/power_supply/BAT0/cycle_count:0 grep: /sys/class/power_supply/BAT0/device: Is a directory /sys/class/power_supply/BAT0/manufacturer:Razer /sys/class/power_supply/BAT0/model_name:Razer Blade Stealth grep: /sys/class/power_supply/BAT0/power: Is a directory /sys/class/power_supply/BAT0/present:1 /sys/class/power_supply/BAT0/serial_number:cnb1rc30019669501218 /sys/class/power_supply/BAT0/status:Discharging grep: /sys/class/power_supply/BAT0/subsystem: Is a directory /sys/class/power_supply/BAT0/technology:Unknown /sys/class/power_supply/BAT0/type:Battery /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_NAME=BAT0 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_STATUS=Discharging /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_PRESENT=1 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_TECHNOLOGY=Unknown /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CYCLE_COUNT=0 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_VOLTAGE_MIN_DESIGN=11550000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_VOLTAGE_NOW=13110000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CURRENT_NOW=0 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CHARGE_FULL_DESIGN=4640000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CHARGE_FULL=4573000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CHARGE_NOW=4572000 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CAPACITY=99 /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CAPACITY_LEVEL=Normal /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_MODEL_NAME=Razer Blade Stealth /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_MANUFACTURER=Razer /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_SERIAL_NUMBER=cnb1rc30019669501218 /sys/class/power_supply/BAT0/voltage_min_design:11550000 /sys/class/power_supply/BAT0/voltage_now:13110000 That is, per Comment 13, no change when set to "Windows 2015". hmm, so we're using the same device. This makes me doubt that windows may use a different logic to determine battery status, and the logic is "battery can not be discharging while it's on AC", say, battery status is 'Charged' if AC is online and battery is not charging. But this is just a guess right now. If we have some proof that windows is doing in this way, maybe we can convince the user space people to follow the same logic. But anyway, this can not be handled in Linux kernel. Now that you mentioned it, in my day job, I remember a discussion about the challenges of implementing USB Type-C that involved the possibility that someone could be charging a laptop off of a cell phone charger (5V, 1.5A). In this scenario, technically the AC is online but the battery could still be discharging to make up the difference as this isn't enough power to run laptop hardware. I think you are correct: the userspace UI logic hasn't been updated to account for AC online while battery discharging (or not, as the case may be per Comment 9). (In reply to Jason Dewayne Clinton from comment #16) > Now that you mentioned it, in my day job, I remember a discussion about the > challenges of implementing USB Type-C that involved the possibility that > someone could be charging a laptop off of a cell phone charger (5V, 1.5A). > In this scenario, technically the AC is online but the battery could still > be discharging to make up the difference as this isn't enough power to run > laptop hardware. > Hmm, sounds interesting, but this is not true today, right? problem is that, if windows follows the logic as I describe in comment #15, it is possible that some laptops shipped with a buggy battery status, and relies on windows user space to handle it, and these laptops confuses Linux User space. > I think you are correct: the userspace UI logic hasn't been updated to > account for AC online while battery discharging (or not, as the case may be > per Comment 9). In any case, this does not seem to be a kernel problem to me, thus close it. I think we'd 1. raise the problem to RazerBlaze as its firmware does not return correct battery status as the other laptops (but I'm not sure if it can be fixed or not, as Windows works...) OR 2. raise the problem to user space to make it smart enough to handle the buggy firmware $ grep . /sys/class/power_supply/*/* /sys/class/power_supply/AC0/online:1 /sys/class/power_supply/BAT0/charge_full:4584000 /sys/class/power_supply/BAT0/charge_full_design:4640000 /sys/class/power_supply/BAT0/charge_now:4408000 /sys/class/power_supply/BAT0/current_now:0 /sys/class/power_supply/BAT0/status:Discharging I think these information (AC on-line, Battery' discharging rate is 0) is sufficient to say the battery is charged instead of discharging. |