You are not logged in.

#1 2018-01-05 16:22:01

cribari
Member
From: Recife, Brazil
Registered: 2016-01-28
Posts: 47
Website

Laptop battery charge/discharge status incorrect

I run Arch Linux + KDE Plasma on a Samsung laptop. Lately, however, I have been experiencing something strange. The battery indicator does not change to discharging when I unplug the notebook and it starts running on its battery (and vice-versa). For instance, this is what I get with the laptop unplugged:

[cribari@darwin5]: ~>$ acpi
Battery 0: Charging, 82%, 00:38:10 until charged

Also:

[cribari@darwin5]: ~>$ cat /sys/class/power_supply/BAT1/uevent 
POWER_SUPPLY_NAME=BAT1
POWER_SUPPLY_STATUS=Charging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=243
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=7600000
POWER_SUPPLY_VOLTAGE_NOW=8248000
POWER_SUPPLY_CURRENT_NOW=823000
POWER_SUPPLY_CHARGE_FULL_DESIGN=3950000
POWER_SUPPLY_CHARGE_FULL=3800000
POWER_SUPPLY_CHARGE_NOW=3116000
POWER_SUPPLY_CAPACITY=82
POWER_SUPPLY_CAPACITY_LEVEL=Normal
POWER_SUPPLY_MODEL_NAME=SR Real Battery
POWER_SUPPLY_MANUFACTURER=SAMSUNG Electronics
POWER_SUPPLY_SERIAL_NUMBER=123456789

Also:

[cribari@darwin5]: ~>$ ls /sys/class/power_supply/
ADP1/ BAT1/ 
[cribari@darwin5]: ~>$ ls /sys/class/power_supply/
ADP1  BAT1
[cribari@darwin5]: ~>$ ls /sys/class/power_supply/BAT1/
alarm           charge_full_design  device        present        technology          voltage_now
capacity        charge_now          manufacturer  serial_number  type
capacity_level  current_now         model_name    status         uevent
charge_full     cycle_count         power         subsystem      voltage_min_design
[cribari@darwin5]: ~>$ cat /sys/class/power_supply/BAT1/status
Charging
[cribari@darwin5]: ~>$ cat /sys/class/power_supply/BAT1/capacity      
87
[cribari@darwin5]: ~>$ cat /sys/class/power_supply/BAT1/capacity_level
Normal
[cribari@darwin5]: ~>$ upower -i /org/freedesktop/UPower/devices/battery_BAT1
  native-path:          BAT1
  vendor:               SAMSUNG Electronics
  model:                SR Real Battery
  serial:               123456789
  power supply:         yes
  updated:              Fri 05 Jan 2018 01:15:16 PM -03 (1 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    warning-level:       none
    energy:              25.1256 Wh
    energy-empty:        0 Wh
    energy-full:         28.88 Wh
    energy-full-design:  30.02 Wh
    energy-rate:         5.244 W
    voltage:             8.302 V
    time to full:        43.0 minutes
    percentage:          87%
    capacity:            96.2025%
    technology:          lithium-ion
    icon-name:          'battery-full-charging-symbolic'
  History (charge):
    1515168916  87.000  charging
  History (rate):
    1515168916  5.244   charging

acpi, acpid and upower are installed. The problem happens even when no extra kernel parameters are used and with both the vanilla Arch kernel and the CK kernel. Can anyone help me with this problem? Thank you in advance.

EDIT:  Solved by updating apm to verion 1.19.0-1.

Last edited by cribari (2018-02-07 00:19:24)


Linux, street photography and Baroque music enthusiast.

Offline

#2 2018-01-14 12:17:00

balazs4
Member
Registered: 2013-02-23
Posts: 16

Re: Laptop battery charge/discharge status incorrect

Hi,

I have the same issue like you had. (samsung series 9 ultrabook, NP900X4C)
Arch linux kernel: 4.14.13-1-ARCH
With 4.10.13-1 kernel was working properly, but since the kernel update the acpi does not recognize correctly the batter state. (neither 'discharching', nor 'charching')

I've found a workaround which works for me: After I plugged my laptop to the adapter, I call the `pm-suspend` and after few seconds I wake up the laptop again. After that the battery state is recognized properly, and everything works as expected. But this is a pretty annoying. hmm

@cribari: How did the `apm`  (Atom package manager) update solve your problem? https://www.archlinux.org/packages/comm … 86_64/apm/

Thanks!

Offline

#3 2018-01-14 18:45:42

cribari
Member
From: Recife, Brazil
Registered: 2016-01-28
Posts: 47
Website

Re: Laptop battery charge/discharge status incorrect

@balazs4 Perhaps it was solved by some other package that got updated that day. Have you tried using the LTS kernel? Have you tried reinstalling acpi and acpid?


Linux, street photography and Baroque music enthusiast.

Offline

#4 2018-02-07 00:14:29

cribari
Member
From: Recife, Brazil
Registered: 2016-01-28
Posts: 47
Website

Re: Laptop battery charge/discharge status incorrect

The problem returned today. Suggestions are welcome.


Linux, street photography and Baroque music enthusiast.

Offline

#5 2018-02-10 09:59:19

balazs4
Member
Registered: 2013-02-23
Posts: 16

Re: Laptop battery charge/discharge status incorrect

@cribari: unfortunately, I'm still facing the issue. I could not resolve it.

But the mentioned workaround works for me (`pm-suspend` and wake up the laptop)

So...suggestions are welcome, hopefully somebody has a real solution for that.

Offline

#6 2018-02-10 18:17:32

balazs4
Member
Registered: 2013-02-23
Posts: 16

Re: Laptop battery charge/discharge status incorrect

After a `pm-suspend` I have the following

Unpluged state:

Battery 0: Charging, 19%, 03:30:10 until charged
Adapter 0: off-line

Pluged state:

Battery 0: Charging, 19%, 03:30:10 until charged
Adapter 0: on-line

so the `Adapter 0` has been recognized correctly, but `Battery 0` did not change at all.

Last edited by balazs4 (2018-02-10 18:17:57)

Offline

#7 2018-02-10 18:28:08

lo1
Member
Registered: 2017-09-25
Posts: 584

Re: Laptop battery charge/discharge status incorrect

Which laptop is this, and how old is it? Probably you'd need a cmd parameter such as the ones suggested by DSDT wiki page.

Offline

#8 2018-02-10 18:31:12

balazs4
Member
Registered: 2013-02-23
Posts: 16

Re: Laptop battery charge/discharge status incorrect

Samsung series 9 ultrabook, NP900X4C // 2012

With 4.10.13-1 kernel was everything fine.


I'll check the DSDT page, thanks

Offline

#9 2018-02-10 18:49:42

lo1
Member
Registered: 2017-09-25
Posts: 584

Re: Laptop battery charge/discharge status incorrect

https://bugs.launchpad.net/ubuntu/+sour … bug/971061

I found this one but the only useful thing to note is that this bug was fixed after 14.x was out. Can you confirm is the same bug? (test it suspending and waking your system, you should see the right acpi status).

Offline

#10 2018-02-10 19:34:19

balazs4
Member
Registered: 2013-02-23
Posts: 16

Re: Laptop battery charge/discharge status incorrect

confirmed!
after 'suspend-wake' the state is correct.

Offline

#11 2018-02-10 19:36:04

cribari
Member
From: Recife, Brazil
Registered: 2016-01-28
Posts: 47
Website

Re: Laptop battery charge/discharge status incorrect

balazs4 wrote:

confirmed!
after 'suspend-wake' the state is correct.

Same here.


Linux, street photography and Baroque music enthusiast.

Offline

#12 2018-02-10 19:41:46

balazs4
Member
Registered: 2013-02-23
Posts: 16

Re: Laptop battery charge/discharge status incorrect

Offline

#13 2018-02-10 19:59:42

balazs4
Member
Registered: 2013-02-23
Posts: 16

Re: Laptop battery charge/discharge status incorrect

Based on this information, I guess this is "our problem":

https://github.com/torvalds/linux/commi … f4b52L1786

Update:
Yes, definitely! This commit has landed in the v4.11 kernel version, so this explains why the v4.10 has worked for me.

master  v4.15  v4.15-rc9 v4.15-rc8 v4.15-rc7 v4.15-rc6 v4.15-rc5 v4.15-rc4 v4.15-rc3 v4.15-rc2 v4.15-rc1 v4.14 v4.14-rc8 v4.14-rc7 v4.14-rc6 v4.14-rc5 v4.14-rc4 v4.14-rc3 v4.14-rc2 v4.14-rc1 v4.13 v4.13-rc7 v4.13-rc6 v4.13-rc5 v4.13-rc4 v4.13-rc3 v4.13-rc2 v4.13-rc1 v4.12 v4.12-rc7 v4.12-rc6 v4.12-rc5 v4.12-rc4 v4.12-rc3 v4.12-rc2 v4.12-rc1 v4.11 v4.11-rc8 v4.11-rc7 v4.11-rc6 v4.11-rc5 v4.11-rc4 v4.11-rc3 v4.11-rc2 v4.11-rc1

Last edited by balazs4 (2018-02-10 20:04:55)

Offline

#14 2018-02-10 22:54:01

cribari
Member
From: Recife, Brazil
Registered: 2016-01-28
Posts: 47
Website

Re: Laptop battery charge/discharge status incorrect

1) Is there a workaround? 2) Has anyone filed a kernel bug report?


Linux, street photography and Baroque music enthusiast.

Offline

#15 2018-02-11 11:08:58

balazs4
Member
Registered: 2013-02-23
Posts: 16

Re: Laptop battery charge/discharge status incorrect

1) `suspend-wakeup` should work OR downgrade the kernel to `4.10` version
2) I've already posted our discussion to the bug as a comment, there is also a response for that https://bugzilla.kernel.org/show_bug.cgi?id=44161#c251

Offline

#16 2018-02-19 00:17:12

cribari
Member
From: Recife, Brazil
Registered: 2016-01-28
Posts: 47
Website

Re: Laptop battery charge/discharge status incorrect

@balazs4 Would you know whether the patch mentioned in https://bugzilla.kernel.org/show_bug.cgi?id=44161#c254 will make into the Linux kernel? Have you been following that?


Linux, street photography and Baroque music enthusiast.

Offline

#17 2018-02-20 18:49:02

balazs4
Member
Registered: 2013-02-23
Posts: 16

Re: Laptop battery charge/discharge status incorrect

Yes, I'm following that.

Hopefully the patch will land in the upcoming versions.

Offline

#18 2018-04-07 14:37:38

cribari
Member
From: Recife, Brazil
Registered: 2016-01-28
Posts: 47
Website

Re: Laptop battery charge/discharge status incorrect

@balazs4 I am still facing the problem. How about you?


Linux, street photography and Baroque music enthusiast.

Offline

#19 2018-04-12 00:05:42

cribari
Member
From: Recife, Brazil
Registered: 2016-01-28
Posts: 47
Website

Re: Laptop battery charge/discharge status incorrect

I am still facing this problem with kernel 4.16.0-2. Suggestions are welcome.


Linux, street photography and Baroque music enthusiast.

Offline

#20 2018-04-13 10:15:41

balazs4
Member
Registered: 2013-02-23
Posts: 16

Re: Laptop battery charge/discharge status incorrect

@cribari Since february I'm using `custom` kernel on top of `4.15` with the patch mentioned on bugzilla; so I'm not facing the issue right now.
However I want to go back to the `arch` kernel again as soon as possible, but the `revert-commit` is still not on the `master` branch.
So probably the fix will land only in the 4.17 or above :-(

I will build a kernel with the samsung patch on top of `4.16` as soon as it is in the `core` repo, and let you know if it works.

Offline

#21 2018-04-13 11:38:16

cribari
Member
From: Recife, Brazil
Registered: 2016-01-28
Posts: 47
Website

Re: Laptop battery charge/discharge status incorrect

balazs4 wrote:

@cribari Since february I'm using `custom` kernel on top of `4.15` with the patch mentioned on bugzilla; so I'm not facing the issue right now.
However I want to go back to the `arch` kernel again as soon as possible, but the `revert-commit` is still not on the `master` branch.
So probably the fix will land only in the 4.17 or above :-(

I will build a kernel with the samsung patch on top of `4.16` as soon as it is in the `core` repo, and let you know if it works.

@balazs4 Yesterday I compiled the 4.16 kernel with the bugzilla patch. The patch solved the problem. I guess I will have to keep compiling my kernels. If at some point you find out that the patch has been officially accepted please share that information here. Thank you.


Linux, street photography and Baroque music enthusiast.

Offline

#22 2018-05-10 00:19:44

cribari
Member
From: Recife, Brazil
Registered: 2016-01-28
Posts: 47
Website

Re: Laptop battery charge/discharge status incorrect

balazs4 wrote:

@cribari Since february I'm using `custom` kernel on top of `4.15` with the patch mentioned on bugzilla; so I'm not facing the issue right now.
However I want to go back to the `arch` kernel again as soon as possible, but the `revert-commit` is still not on the `master` branch.
So probably the fix will land only in the 4.17 or above :-(

I will build a kernel with the samsung patch on top of `4.16` as soon as it is in the `core` repo, and let you know if it works.

@balazs4 See https://www.systutorials.com/linux-kern … ux-4-14-3/

Does that mean that the patch was accepted? I am still facing the problem (with the regular and LTS kernels). The problem goes away when I compile the kernel and manually apply the patch.


Linux, street photography and Baroque music enthusiast.

Offline

#23 2018-08-08 11:08:08

cribari
Member
From: Recife, Brazil
Registered: 2016-01-28
Posts: 47
Website

Re: Laptop battery charge/discharge status incorrect

balazs4 wrote:

@cribari Since february I'm using `custom` kernel on top of `4.15` with the patch mentioned on bugzilla; so I'm not facing the issue right now.
However I want to go back to the `arch` kernel again as soon as possible, but the `revert-commit` is still not on the `master` branch.
So probably the fix will land only in the 4.17 or above :-(

I will build a kernel with the samsung patch on top of `4.16` as soon as it is in the `core` repo, and let you know if it works.

@balazs4 Are you still having to build your kernels?


Linux, street photography and Baroque music enthusiast.

Offline

#24 2018-08-30 17:52:42

slavs
Member
Registered: 2018-08-30
Posts: 1

Re: Laptop battery charge/discharge status incorrect

Hi! I seem to be having the same problem with my Dell laptop. Would you please point me in the right direction as to how to compile the kernel with the patch applied?

Edit: after additional research I found this issue with upower that may be the cause of the issue: https://gitlab.freedesktop.org/upower/upower/issues/68

Edit 2: The problem turned out to be the new version of upower. After downgrading to an earlier version (using downgrader) the issue is gone, powerdevil recognises when the AC is plugged in and unplugged and changes the brightness etc

Last edited by slavs (2018-08-31 05:43:23)

Offline

Board footer

Powered by FluxBB