Bug 208341

Summary: [ThinkPad] Brightness-Power Supply Issue Kernel 5.8-rc's - AMD Ryzen 7 2700U/Vega 8
Product: ACPI Reporter: Mik (e595)
Component: Power-BatteryAssignee: acpi_power-battery
Status: NEW ---    
Severity: normal CC: eubnara, rui.zhang
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 5.8-rc1 Subsystem:
Regression: No Bisected commit-id:

Description Mik 2020-06-27 05:11:03 UTC
The brightness drops to minimum when removing the laptop power supply from the wall. This bug occurs only once. Restart brings back the problem. Same if the power-supply is not connected at boot, brightness is at very low.

This bug is present in Mint Tricia, Ubuntu 20.10, Manjaro Gnome + kde 5.19.2.

I discover this bug after a power failure on the 23rd and it has come back since then when removing the PS.
Comment 1 Mik 2020-06-29 00:39:23 UTC
Still there om rc-3. Ku 20.10
Comment 2 Mik 2020-06-30 14:23:35 UTC
Same in Manajro unstable branch 20200630
Comment 3 Mik 2020-06-30 14:42:41 UTC
Kernel 5.8-rc3

journalctl -f
...

Disconnecting/reconnecting the PS and set brightness to max.

Jun 30 10:35:12 kk kernel: audit: type=1131 audit(1593527711.996:58): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=NetworkManager-dispatcher comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jun 30 10:35:15 kk kdeconnectd[1235]: kdeconnect.core: Broadcasting identity packet
Jun 30 10:35:25 kk dbus-daemon[982]: [session uid=1000 pid=982] Activating via systemd: service name='org.gtk.vfs.Daemon' unit='gvfs-daemon.service' requested by ':1.38' (uid=1000 pid=1231 comm="/usr/lib/DiscoverNotifier ")
Jun 30 10:35:25 kk systemd[841]: Starting Virtual filesystem service...
Jun 30 10:35:25 kk dbus-daemon[982]: [session uid=1000 pid=982] Successfully activated service 'org.gtk.vfs.Daemon'
Jun 30 10:35:25 kk systemd[841]: Started Virtual filesystem service.
Jun 30 10:35:25 kk kernel: fuse: init (API version 7.31)
Jun 30 10:35:25 kk systemd[1]: Mounting FUSE Control File System...
Jun 30 10:35:25 kk systemd[1]: Mounted FUSE Control File System.
Jun 30 10:35:26 kk PackageKit[1267]: get-updates transaction /1_ddddccba from uid 1000 finished with success after 1399ms
Jun 30 10:35:30 kk kdeconnectd[1235]: kdeconnect.core: Could not query capabilities from notifications server
Jun 30 10:35:31 kk dbus-daemon[734]: [system] Activating service name='org.kde.powerdevil.backlighthelper' requested by ':1.34' (uid=1000 pid=1301 comm="/usr/lib/org_kde_powerdevil ") (using servicehelper)
Jun 30 10:35:31 kk dbus-daemon[734]: [system] Successfully activated service 'org.kde.powerdevil.backlighthelper'
Jun 30 10:35:35 kk systemd[1]: systemd-hostnamed.service: Succeeded.
Jun 30 10:35:35 kk audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jun 30 10:35:35 kk kernel: audit: type=1131 audit(1593527735.713:59): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jun 30 10:35:35 kk audit: BPF prog-id=10 op=UNLOAD
Jun 30 10:35:35 kk audit: BPF prog-id=9 op=UNLOAD
Jun 30 10:35:35 kk kernel: audit: type=1334 audit(1593527735.859:60): prog-id=10 op=UNLOAD
Jun 30 10:35:35 kk kernel: audit: type=1334 audit(1593527735.859:61): prog-id=9 op=UNLOAD
...
exit

pacman -Q linux58
linux58 5.8rc3.d0629.g7c30b85-1
Comment 4 Mik 2020-06-30 15:44:55 UTC
Energy Saving parameters are all disabled, but if screen brightness is set to maximum for battery and AC power the bug is not the same.

pacman -Ss kde-agent
extra/polkit-kde-agent 5.19.2-1 (plasma)
    Daemon providing a polkit authentication UI for KDE
community/polkit-kde-agent-git 5.19.80.r442.g14f09c4-1 (plasma-git) [installed]
    Daemon providing a polkit authentication UI for KDE
pacman -Q mesa
mesa 20.1.2-1


Disconnecting the PS does the same, but reconnecting restores the level to maximum.

Enabling all energy saving parameters to default gives the same result: no need to touch brightness, disconnecting/reconnecting the PS restores the level to maximum.

Nothing wrong on stable Kernel 5.7-6 with energy saving enabled or disabled. 

 pacman -Ss acpi
extra/linux414-acpi_call 1.1.0-158 (linux414-extramodules)
    A linux kernel module that enables calls to ACPI methods through /proc/acpi/call
extra/linux419-acpi_call 1.1.0-120 (linux419-extramodules)
    A linux kernel module that enables calls to ACPI methods through /proc/acpi/call
extra/linux44-acpi_call 1.1.0-159
    A linux kernel module that enables calls to ACPI methods through /proc/acpi/call
extra/linux49-acpi_call 1.1.0-173 (linux49-extramodules)
    A linux kernel module that enables calls to ACPI methods through /proc/acpi/call
extra/linux54-acpi_call 1.1.0-55 (linux54-extramodules)
    A linux kernel module that enables calls to ACPI methods through /proc/acpi/call
extra/linux56-acpi_call 1.1.0-23 (linux56-extramodules)
    A linux kernel module that enables calls to ACPI methods through /proc/acpi/call
extra/linux57-acpi_call 1.1.0-10 (linux57-extramodules)
    A linux kernel module that enables calls to ACPI methods through /proc/acpi/call
extra/linux58-acpi_call 1.1.0-0.3 (linux58-extramodules)
    A linux kernel module that enables calls to ACPI methods through /proc/acpi/call
community/acpi 1.7-3 [installed]
    Client for battery, power, and thermal readings
community/acpi_call-dkms 1.1.0-287
    A linux kernel module that enables calls to ACPI methods through /proc/acpi/call - module sources
community/acpica 20200528-1
    ACPI tools, including Intel ACPI Source Language compiler
community/acpid 2.0.32-1 [installed]
    A daemon for delivering ACPI power management events with netlink support
community/acpilight 1.2-1
    a backward-compatible xbacklight replacement based on ACPI
community/linux-latest-acpi_call 5.7-1 (linux-latest-extramodules)
    A linux kernel module that enables calls to ACPI methods through /proc/acpi/call (metapackage)
community/linux-lts-acpi_call 1:5.4-3 (linux-lts-extramodules)
    A linux kernel module that enables calls to ACPI methods through /proc/acpi/call (metapackage)
community/linux-rt-lts-manjaro-acpi_call 5.4-1 (linux-rt-lts-manjaro-extramodules)
    A linux kernel module that enables calls to ACPI methods through /proc/acpi/call
community/linux-rt-manjaro-acpi_call 5.6-2 (linux-rt-manjaro-extramodules)
    A linux kernel module that enables calls to ACPI methods through /proc/acpi/call
community/linux54-rt-acpi_call 1.1.0-17 (linux54-rt-extramodules)
    A linux kernel module that enables calls to ACPI methods through /proc/acpi/call
community/linux56-rt-acpi_call 1.1.0-6 (linux56-rt-extramodules)
    A linux kernel module that enables calls to ACPI methods through /proc/acpi/call
community/tpacpi-bat 3.1-3
    A Perl script with ACPI calls for recent ThinkPads (such as T420 and W520) whose battery thresholds are not supported by tp_smapi

Operating System: Manjaro Linux
KDE Plasma Version: 5.19.80
KDE Frameworks Version: 5.72.0
Qt Version: 5.15.0
Kernel Version: 5.8.0-1-MANJARO
OS Type: 64-bit
Processors: 8 × AMD Ryzen 7 2700U with Radeon Vega Mobile Gfx
Memory: 7.5 GiB of RAM
Graphics Processor: AMD RAVEN

Same with latest updates:
pacman -Q amd-ucode
amd-ucode 20200629.r1663.1a0c0c2-1
pacman -Q linux-firmware
linux-firmware 20200629.r1663.1a0c0c2-1
Comment 5 Mik 2020-06-30 23:52:38 UTC
This new patch does not help = permanent dark state. The same undesirable effect is present, but increasing brightness has no effect now. Energy saving must be set on AC power and on Battery that way:

Screen Brightness enabled with maximum level for both. Apply change removes the bug. 

Set that way, removing the PS reduces brightness to minimum and reconnecting it restores normal state. No need to increase it manually. Again, this is a one shot bug on boot or after restart.

20200630
Packages (23) breeze-git-5.19.80.r2009.g0fefe7fb-1  breeze-icons-git-5.72.0.r1576.gab758050-1  kcmutils-git-5.72.0.r409.g4ba2fe6-1
              kcoreaddons-git-5.72.0.r989.g9748cbc-1  kdeplasma-addons-git-5.19.80.r8356.ge7ab2f301-1
              kio-git-5.72.0.r4083.ge65ea9e8-1  kirigami2-git-5.72.0.r2249.gfd6e6138-1  knetattach-git-5.19.80.r7719.g8d926a3f8-1
              kpty-git-5.72.0.r264.g690ee7c-1  ksshaskpass-git-5.19.80.r172.g01b5517-1  ksysguard-git-5.19.80.r3294.g8c4049fe-1
              ktexteditor-git-5.72.0.r2378.g71b4295a-1  kwallet-git-5.72.0.r972.g032a2b8-1
              kwidgetsaddons-git-5.72.0.r691.g1c648fb-1  kwin-git-5.19.80.r18115.g1b4c725d1-1  kxmlgui-git-5.72.0.r633.gd5d05d1-1
              libkscreen-git-5.19.80.r1525.g1b78ba2-1  plasma-desktop-git-5.19.80.r7719.g8d926a3f8-1
              plasma-framework-git-5.72.0.r15467.g7c4f5c5f1-1  plasma-nm-git-5.19.80.r2895.ga0455c31-1
              plasma-wayland-session-git-5.19.80.r9170.g0ec7a3e2c-1  plasma-workspace-git-5.19.80.r9170.g0ec7a3e2c-1
              powerdevil-git-5.19.80.r2321.gfcb26be2-1

With the new parameters (energy saving) removing/reconnecting the PS:  

journalctl -f
-- Logs begin at Mon 2020-06-29 07:24:14 EDT. --
Jun 30 19:23:55 kk dbus-daemon[1044]: [session uid=1000 pid=1044] Activating via systemd: service name='org.gtk.vfs.Daemon' unit='gvfs-daemon.service' requested by ':1.38' (uid=1000 pid=1236 comm="/usr/lib/DiscoverNotifier ")
Jun 30 19:23:55 kk systemd[849]: Starting Virtual filesystem service...
Jun 30 19:23:55 kk dbus-daemon[1044]: [session uid=1000 pid=1044] Successfully activated service 'org.gtk.vfs.Daemon'
Jun 30 19:23:55 kk systemd[849]: Started Virtual filesystem service.
Jun 30 19:23:55 kk kernel: fuse: init (API version 7.31)
Jun 30 19:23:55 kk systemd[1]: Mounting FUSE Control File System...
Jun 30 19:23:55 kk systemd[1]: Mounted FUSE Control File System.
Jun 30 19:23:56 kk PackageKit[1272]: get-updates transaction /1_ccababae from uid 1000 finished with success after 818ms
Jun 30 19:24:00 kk kdeconnectd[1245]: kdeconnect.core: Could not query capabilities from notifications server
Jun 30 19:24:01 kk systemd-timesyncd[498]: Initial synchronization to time server 192.207.62.39:123 (2.manjaro.pool.ntp.org).
Jun 30 19:24:05 kk systemd[1]: systemd-hostnamed.service: Succeeded.
Jun 30 19:24:05 kk audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jun 30 19:24:05 kk kernel: audit: type=1131 audit(1593559445.874:59): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jun 30 19:24:06 kk audit: BPF prog-id=10 op=UNLOAD
Jun 30 19:24:06 kk audit: BPF prog-id=9 op=UNLOAD
Jun 30 19:24:06 kk kernel: audit: type=1334 audit(1593559446.069:60): prog-id=10 op=UNLOAD
Jun 30 19:24:06 kk kernel: audit: type=1334 audit(1593559446.069:61): prog-id=9 op=UNLOAD
Jun 30 19:24:14 kk dbus-daemon[750]: [system] Activating service name='org.kde.powerdevil.backlighthelper' requested by ':1.42' (uid=1000 pid=1348 comm="/usr/lib/org_kde_powerdevil ") (using servicehelper)
Jun 30 19:24:14 kk dbus-daemon[750]: [system] Successfully activated service 'org.kde.powerdevil.backlighthelper'

Still not able to reproduce the bug on stable Kernel. This is the only bug present on Kernel 5.8.
Comment 6 Mik 2020-07-27 15:13:41 UTC
Manjaro Unstable kde-dev 20200727

pacman -Q linux58
linux58 5.8rc7.d0726.g92ed301-1

RC-7 should be the last and the bug remains. I'm still not able to reproduce this brightness issue in Kernel 5.7-xx. 

The only thing left to try is to compile the debian packages of rc-1 to see if it was introduced on the first release candidate. Will be reporting back.
Comment 7 Mik 2020-07-28 15:58:24 UTC
This bug is present in the first release candidate, it was introduced there. Not present in Kernel 5.7-rc7. Tested in Ubuntu 20.10 this morning (20200726 ISO). 

One question remains, is it a ThinkPad issue?
Comment 8 Mik 2020-07-28 16:00:56 UTC
This bug is present in the first release candidate, it was introduced there. Not present in 5.7-rc7. Tested in Ubuntu 20.10 this morning (20200726 ISO). The brightness level drops near 2% after removing the Power Supply from the wall (rc-1 to 7). 

One question remains, is it a ThinkPad issue?
Comment 9 eubnara 2020-11-16 14:20:15 UTC
I'm suffering the same issue.

I use dell inspiron 15 5505.

Currently running Kubuntu 20.04, Plasma 5.18.5, Frameworks 5.68.0, Qt 5.12.8, kernel 5.9.8-050908-generic.
Comment 10 eubnara 2020-11-16 14:21:12 UTC
I ask kde forum but it didn't help.
https://forum.kde.org/viewtopic.php?f=17&t=168584&p=439900#p439900
Comment 11 eubnara 2020-11-16 15:16:18 UTC
I found that after "org.kde.powerdevil.backlighthelper" activated this symptom doesn't happen again after boot.


Nov 17 00:11:23 eub-Inspiron-5505 dbus-daemon[773]: [system] Activating service name='org.kde.powerdevil.backlighthelper' requested by ':1.60' (uid=1000 pid=1623 comm="/usr/lib/x86_64-linux-gnu/libexec/org_kde_powerdev") (using servicehelper)
Nov 17 00:11:23 eub-Inspiron-5505 dbus-daemon[773]: [system] Successfully activated service 'org.kde.powerdevil.backlighthelper'


However, I couldn't find a way to activate "org.kde.powerdevil.backlighthelper" service forcefully after boot.

I think "org.kde.powerdevil.backlighthelper" is activated some conditions meet. (e.g. a user controls brightness)
Comment 12 Mik 2020-11-25 02:39:19 UTC
Thanks for replying!

I still have that problem under Ubuntu 21.04 with Kernel 5.10-rc5, but it is no big deal even in Gnome. I also have the same issue on Windows 10. 

The trick is not to remove the Power Supply.
Comment 13 Zhang Rui 2020-11-26 07:33:54 UTC
please run "grep . /sys/class/backlight/*/*" both when the power supply is plugged and unplugged.
Comment 14 eubnara 2020-11-28 06:32:23 UTC
unplugged & on first boot

~ $ grep . /sys/class/backlight/*/*
/sys/class/backlight/amdgpu_bl0/actual_brightness:179
/sys/class/backlight/amdgpu_bl0/bl_power:0
/sys/class/backlight/amdgpu_bl0/brightness:179
grep: /sys/class/backlight/amdgpu_bl0/device: Is a directory
/sys/class/backlight/amdgpu_bl0/max_brightness:255
grep: /sys/class/backlight/amdgpu_bl0/power: Is a directory
/sys/class/backlight/amdgpu_bl0/scale:unknown
grep: /sys/class/backlight/amdgpu_bl0/subsystem: Is a directory
/sys/class/backlight/amdgpu_bl0/type:raw


after plugged

~ $ grep . /sys/class/backlight/*/*
/sys/class/backlight/amdgpu_bl0/actual_brightness:4
/sys/class/backlight/amdgpu_bl0/bl_power:0
/sys/class/backlight/amdgpu_bl0/brightness:4
grep: /sys/class/backlight/amdgpu_bl0/device: Is a directory
/sys/class/backlight/amdgpu_bl0/max_brightness:255
grep: /sys/class/backlight/amdgpu_bl0/power: Is a directory
/sys/class/backlight/amdgpu_bl0/scale:unknown
grep: /sys/class/backlight/amdgpu_bl0/subsystem: Is a directory
/sys/class/backlight/amdgpu_bl0/type:raw
Comment 15 eubnara 2020-11-28 06:37:32 UTC
plugged & on first boot

~ $ grep . /sys/class/backlight/*/*
/sys/class/backlight/amdgpu_bl0/actual_brightness:179
/sys/class/backlight/amdgpu_bl0/bl_power:0
/sys/class/backlight/amdgpu_bl0/brightness:179
grep: /sys/class/backlight/amdgpu_bl0/device: Is a directory
/sys/class/backlight/amdgpu_bl0/max_brightness:255
grep: /sys/class/backlight/amdgpu_bl0/power: Is a directory
/sys/class/backlight/amdgpu_bl0/scale:unknown
grep: /sys/class/backlight/amdgpu_bl0/subsystem: Is a directory
/sys/class/backlight/amdgpu_bl0/type:raw


after unplug it

~ $ grep . /sys/class/backlight/*/*
/sys/class/backlight/amdgpu_bl0/actual_brightness:4
/sys/class/backlight/amdgpu_bl0/bl_power:0
/sys/class/backlight/amdgpu_bl0/brightness:4
grep: /sys/class/backlight/amdgpu_bl0/device: Is a directory
/sys/class/backlight/amdgpu_bl0/max_brightness:255
grep: /sys/class/backlight/amdgpu_bl0/power: Is a directory
/sys/class/backlight/amdgpu_bl0/scale:unknown
grep: /sys/class/backlight/amdgpu_bl0/subsystem: Is a directory
/sys/class/backlight/amdgpu_bl0/type:raw
Comment 16 Mik 2020-11-29 19:40:08 UTC
Kernel 5.9.11-3 or 5.10-rc5 same thing
Plugged:
grep . /sys/class/backlight/*/*
/sys/class/backlight/amdgpu_bl0/actual_brightness:239
/sys/class/backlight/amdgpu_bl0/bl_power:0
/sys/class/backlight/amdgpu_bl0/brightness:255
grep: /sys/class/backlight/amdgpu_bl0/device: Is a directory
/sys/class/backlight/amdgpu_bl0/max_brightness:255
grep: /sys/class/backlight/amdgpu_bl0/power: Is a directory
/sys/class/backlight/amdgpu_bl0/scale:unknown
grep: /sys/class/backlight/amdgpu_bl0/subsystem: Is a directory
/sys/class/backlight/amdgpu_bl0/type:raw

Unplugged: brightness near zero

grep . /sys/class/backlight/*/*
/sys/class/backlight/amdgpu_bl0/actual_brightness:239
/sys/class/backlight/amdgpu_bl0/bl_power:0
/sys/class/backlight/amdgpu_bl0/brightness:2
grep: /sys/class/backlight/amdgpu_bl0/device: Is a directory
/sys/class/backlight/amdgpu_bl0/max_brightness:255
grep: /sys/class/backlight/amdgpu_bl0/power: Is a directory
/sys/class/backlight/amdgpu_bl0/scale:unknown
grep: /sys/class/backlight/amdgpu_bl0/subsystem: Is a directory
/sys/class/backlight/amdgpu_bl0/type:raw

Operating System: Manjaro Linux
KDE Plasma Version: 5.20.3
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.2
Kernel Version: 5.10.0-1-MANJARO
Comment 17 Mik 2020-12-09 16:48:06 UTC
To fix this issue manually in KDE, go to settings > Power management > Activity Settings > Use separate settings (advanced users only) > Screen brightness > Level > Maximum > Apply change.