Bug 65601 - Lenovo T440s backlight set to max on power cord remove/attach
Summary: Lenovo T440s backlight set to max on power cord remove/attach
Status: CLOSED WILL_NOT_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Video (show other bugs)
Hardware: x86-64 Linux
: P1 normal
Assignee: Aaron Lu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-24 11:22 UTC by tomasi
Modified: 2014-03-13 03:08 UTC (History)
4 users (show)

See Also:
Kernel Version: 3.13.0-031300rc1-generic
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
i915 (8.00 KB, application/octet-stream)
2013-12-09 18:27 UTC, tomasi
Details
dmidecode (16.04 KB, text/plain)
2014-01-27 08:33 UTC, tomasi
Details
acpidump (377.21 KB, text/plain)
2014-01-27 09:29 UTC, tomasi
Details

Description tomasi 2013-11-24 11:22:31 UTC
On Lenovo T440s with kernel  3.13.0-031300rc1-generic are only 5 modes of brightness. First mode shutdown back light completely off, so there are only 4 modes of brightness.
4 modes are too bright or too low, there is nothing between. It hurts my eyes.

as a parameter using this:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm=force acpi_backlight=vendor"


root@dell-xps:/sys/class/backlight/intel_backlight/device/intel_backlight/subsystem/intel_backlight# ll
total 0
drwxr-xr-x 3 root root    0 Nov 24 12:05 ./
drwxr-xr-x 5 root root    0 Nov 24 12:05 ../
-r--r--r-- 1 root root 4096 Nov 24 12:05 actual_brightness
-rw-r--r-- 1 root root 4096 Nov 24 12:14 bl_power
-rw-r--r-- 1 root root 4096 Nov 24 12:13 brightness
lrwxrwxrwx 1 root root    0 Nov 24 12:14 device -> ../../card0-eDP-1/
-r--r--r-- 1 root root 4096 Nov 24 12:05 max_brightness
drwxr-xr-x 2 root root    0 Nov 24 12:14 power/
lrwxrwxrwx 1 root root    0 Nov 24 12:05 subsystem -> ../../../../../../../class/backlight/
-r--r--r-- 1 root root 4096 Nov 24 12:14 type
-rw-r--r-- 1 root root 4096 Nov 24 12:05 uevent
root@dell-xps:/sys/class/backlight/intel_backlight/device/intel_backlight/subsystem/intel_backlight#
Comment 1 Aaron Lu 2013-11-25 01:32:07 UTC
What's the value of max_brightness?
BTW, is the acpi_video interface broken? Please also attach your acpidump, thanks.
Comment 2 tomasi 2013-11-25 19:49:35 UTC
Brightness:
bio@dell-xps:/sys/class/backlight/intel_backlight/device/intel_backlight/subsystem/intel_backlight$ cat actual_brightness
step1: 0
step2: 170
step3: 340
step4: 510
step5: 680
step6: 851

- ok. 6 steps...(sorry i wrote previously only 5 steps)

bio@dell-xps:/sys/class/backlight/intel_backlight/device/intel_backlight/subsystem/intel_backlight$ cat max_brightness
851

I removed option pcie_aspm=force  and it's running fine.

for the acpidump i tried, but got error:
bio@dell-xps:~/Desktop$ sudo acpidump > acpi.dat
Wrong checksum for FADT!
bio@dell-xps:~/Desktop$ sudo acpidump -t SSDT > SSDT.dat
Wrong checksum for FADT!
Comment 3 Aaron Lu 2013-11-26 01:55:29 UTC
The step is decided by GUI, not kernel. Kernel just exposes backlight control interface for GUI to use.

Which GUI are you using?
Comment 4 tomasi 2013-11-26 05:49:12 UTC
Xfce 4.10, but I haven't change anything else except kernel upgrade.
Comment 5 Aaron Lu 2013-11-28 00:49:11 UTC
What's the value of max_brightness on the good_old kernel?
Comment 6 tomasi 2013-11-28 06:01:23 UTC
Hi,
in good old kernel "Linux t440s 3.12.0-031200-generic #201311031935 SMP Mon Nov 4 00:36:54 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux" is max brigtness 765.

steps are following:
bio@t440s:/sys/class/backlight/intel_backlight/device/intel_backlight/subsystem/intel_backlight$ cat brightness
9
15
24
30
39
45
54
75
102
138
186
252
330
441
579
765
765
Comment 7 Aaron Lu 2013-11-28 06:38:27 UTC
(In reply to tomasi from comment #2)
> I removed option pcie_aspm=force  and it's running fine.

What does this mean, the step is OK without pcie_aspm=force?
Comment 8 tomasi 2013-11-28 06:54:00 UTC
i meant system is running fine, it boots, there is no black screen after boot...
Comment 9 Jani Nikula 2013-12-05 11:00:15 UTC
If intel_backlight's max_brightness is 765 you have all the steps in range 0..765. You can try them by running

sudo sh -c "echo $val > /sys/class/backlight/intel_backlight/brightness"

with $val in range 0..765. How does that work?

Is there a specific reason you use acpi_backlight=vendor?

Why does comment #0 say "Lenovo T440s" and subject says "dell-xps"? Which one is it?
Comment 10 tomasi 2013-12-05 11:09:29 UTC
I will try change $val later. Now I have older kernel.

Is there a specific reason you use acpi_backlight=vendor?
- yes, otherwise buttons (brightness up and down) on laptop doesn't work.

Why does comment #0 say "Lenovo T440s" and subject says "dell-xps"? Which one is it?
- I upgraded laptop and didn't change hostname. Defect is on T440s.
Comment 11 tomasi 2013-12-06 19:15:53 UTC
sudo sh -c "echo 110 > /sys/class/backlight/intel_backlight/brightness"
is changing brightness.
Still in version 3.13.0-031300rc2 there are only 6 steps of brightness.
3.13.0-031300rc2-generic #201311291635 SMP Fri Nov 29 21:36:49 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Comment 12 Jani Nikula 2013-12-09 14:52:24 UTC
(In reply to tomasi from comment #11)
> sudo sh -c "echo 110 > /sys/class/backlight/intel_backlight/brightness"
> is changing brightness.
> Still in version 3.13.0-031300rc2 there are only 6 steps of brightness.

Please be more specific. If you echo 0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, and 750 into intel_backlight/brightness, are there 6 or 16 steps of brightness?!
Comment 13 Jani Nikula 2013-12-09 14:54:08 UTC
Also please mount debugfs and attach /sys/kernel/debug/dri/0/i915_opregion.
Comment 14 tomasi 2013-12-09 18:14:35 UTC
I have only 6 steps when I'm pressing FN+brightess buttons on the keyboard.
Comment 15 tomasi 2013-12-09 18:27:04 UTC
Created attachment 117931 [details]
i915
Comment 16 tomasi 2013-12-09 18:32:29 UTC
There is no issue with settings brightness via commandline.
Issue is, when using FN+brighness up/down butttons. From kernel 3.13 (kernel 3.12 was ok) there are only 6 steps of brightness.
i915_opregion is attached, I'm not very familiar with debugfs.
Comment 17 Daniel Vetter 2013-12-10 07:32:29 UTC
(In reply to tomasi from comment #16)
> There is no issue with settings brightness via commandline.
> Issue is, when using FN+brighness up/down butttons. From kernel 3.13 (kernel
> 3.12 was ok) there are only 6 steps of brightness.
> i915_opregion is attached, I'm not very familiar with debugfs.

That sounds more like a regression somewhere else than in the i915.ko driver. Have you attempted to bisect where this regression was introduced?
Comment 18 tomasi 2013-12-10 10:50:00 UTC
(In reply to Daniel Vetter from comment #17)
> (In reply to tomasi from comment #16)
> > There is no issue with settings brightness via commandline.
> > Issue is, when using FN+brighness up/down butttons. From kernel 3.13
> (kernel
> > 3.12 was ok) there are only 6 steps of brightness.
> > i915_opregion is attached, I'm not very familiar with debugfs.
> 
> That sounds more like a regression somewhere else than in the i915.ko
> driver. Have you attempted to bisect where this regression was introduced?

No, i haven't tried. What should I attach - logs/debugs?
Comment 19 Daniel Vetter 2013-12-10 12:41:26 UTC
I mean doing a kernel bisect on the git trees:

http://www.reactivated.net/weblog/archives/2006/01/using-git-bisect-to-find-buggy-kernel-patches/

There's also nice howtos for the distro-specific stuff around.
Comment 20 tomasi 2014-01-22 20:09:58 UTC
Sorry for long answer, but I have no results.
Bisection involves building kernel.. Is there any other way?
Comment 21 Jani Nikula 2014-01-23 06:22:09 UTC
If the /sys/class/backlight/intel_backlight/brightness interface works fine and supports as many brightness levels as you like, this is not a bug in i915.

If you're using acpi_backlight=vendor kernel parameter, I believe ACPI video in 3.13 will only report the backlight keys to userspace, and won't change the brightness. Aaron, is this correct? In this case, it's also not a bug in ACPI video.

I think what's left is userspace.

Aaron, any other things to check?
Comment 22 Aaron Lu 2014-01-23 06:46:14 UTC
(In reply to Jani Nikula from comment #21)
> If the /sys/class/backlight/intel_backlight/brightness interface works fine
> and supports as many brightness levels as you like, this is not a bug in
> i915.

Agree.

> 
> If you're using acpi_backlight=vendor kernel parameter, I believe ACPI video
> in 3.13 will only report the backlight keys to userspace, and won't change
> the brightness. Aaron, is this correct? In this case, it's also not a bug in
> ACPI video.

Yes, except that I'm not sure if the vendor driver(thinkpad-acpi in this case) would do something weird.

Hi tomasi,
Please boot v3.13 kernel with video.use_native_backlight=1 and remove acpi_backlight=vendor, see if that makes a difference. That should make thinkpad-acpi do nothing for video related key.
Comment 23 tomasi 2014-01-23 19:00:21 UTC
Hi,
I guess, this solved my issue.
video.use_native_backlight=1. Bellow are two examples.

bio@t440s:~$ uname -a
Linux t440s 3.13.0-031300-generic #201401192235 SMP Mon Jan 20 03:36:48 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

a/- parameter was wrong (so basically without parameters)

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash use_native_backlight=1"

bio@t440s:/sys/class/backlight/intel_backlight/device/intel_backlight/subsystem/intel_backlight$ cat brightness
75, 138, 765

Only three modes are avalable

b/ - good parameters - video.use_native_backlight=1

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video.use_native_backlight=1"

modes are:
brigtness from down to max
0, 85, 170, 255, 340, 425, 510, 595, 680, 765, 851
from max to low
766, 681, 596, 511, 426, 341, 256, 171, 86, 1

remark:
0 .. means black screen

Strange is 1 difference when going up and then down.
So... parameters helped, but I prefer more modes around 100 value like i wrote in comment #6. But, ok. What can I do.
Comment 24 tomasi 2014-01-23 19:27:04 UTC
side effect :-(
after removing power cord brightness is on max level, after attaching is on max level again.
Comment 25 Aaron Lu 2014-01-27 07:48:02 UTC
Please attach your acpidump:
# acpidump > acpidump.txt
And dmi info:
# dmidecode > dmi.info
Comment 26 tomasi 2014-01-27 08:32:37 UTC
bio@t440s:/tmp/acpi$ sudo acpidump > acpidump.txt
Wrong checksum for FADT!

dmidecode attached
Comment 27 tomasi 2014-01-27 08:33:01 UTC
Created attachment 123481 [details]
dmidecode
Comment 28 Aaron Lu 2014-01-27 08:59:56 UTC
I suppose the acpidump.txt is still generated?
Comment 29 tomasi 2014-01-27 09:29:34 UTC
Created attachment 123531 [details]
acpidump
Comment 30 Aaron Lu 2014-01-28 06:03:45 UTC
(In reply to tomasi from comment #24)
> side effect :-(
> after removing power cord brightness is on max level, after attaching is on
> max level again.

This may be related to GUI. If you boot into console, i.e. do not start any GUI, and when you remove the power cord, does the brightness change?
Comment 31 tomasi 2014-01-29 22:09:58 UTC
It's not related to the GUI. I stopped lightdm service.
results:
- fn + brightness down/up keys were not working
- brightness was on max when attaching or removing power cord from laptop..
 (I had to use echo $val > /sys/class/backlight/intel_backlight/brightness for changing brightness down)
Comment 32 Aaron Lu 2014-02-10 08:52:14 UTC
Sorry for replying back. Please boot into console mode and then enable backlight debug message by:
# cd /sys/kernel/debug/dynamic_debug
# echo 'module backlight +pfmt' > control
After this, remove/attach power cord and see if you get any messages by checking dmesg.
Comment 33 tomasi 2014-02-12 23:30:32 UTC
latest kernel:
Linux t440s 3.14.0-031400rc2-generic #201402092235 SMP Mon Feb 10 03:37:33 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

dmesg shows following:
--cord removed -- brightness max
[  265.939458] init: anacron main process (4640) killed by TERM signal
[  265.978072] thinkpad_acpi: EC reports that Thermal Table has changed
-- cord attached -- brightness max
[  275.652095] thinkpad_acpi: EC reports that Thermal Table has changed
[  275.655289] e1000e 0000:00:19.0: irq 58 for MSI/MSI-X

-- and so on...
--cord removed -- brightness max
[  305.191235] init: anacron main process (4906) killed by TERM signal
[  305.232855] thinkpad_acpi: EC reports that Thermal Table has changed
-- cord attached -- brightness max
[  313.184167] thinkpad_acpi: EC reports that Thermal Table has changed
[  313.187649] e1000e 0000:00:19.0: irq 58 for MSI/MSI-X
Comment 34 Aaron Lu 2014-02-17 05:13:40 UTC
This suggests the firmware did something on power cord attach/detach instead of kernel.
Comment 35 Aaron Lu 2014-03-13 03:08:38 UTC
Not fixable for the backlight max on power cord attach/detach.

Note You need to log in before you can comment on or make changes to this bug.