Bug 1436686 - leds dell::kbd_backlight: Setting an LED's brightness failed (-6) on Dell Precision 7510/0M91XC and 4.15.4-300
Summary: leds dell::kbd_backlight: Setting an LED's brightness failed (-6) on Dell Pre...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 27
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-28 12:45 UTC by Arcadiy Ivanov
Modified: 2018-03-06 07:20 UTC (History)
13 users (show)

Fixed In Version: 4.15.7-300.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
4.15.4-300.fc27.x86_64
Last Closed: 2018-03-06 07:19:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Arcadiy Ivanov 2017-03-28 12:45:11 UTC
In 4.8 and 4.9 kernels no such messages appeared and Dell keyboard backlight could not be software controlled.

The backlight still cannot be software-controlled in 4.10 but now these messages appear in response to KDE power manager trying to make changes.

Example:

[    5.536399] dell_laptop: Setting old previous keyboard state failed
[    5.536434] leds dell::kbd_backlight: Setting an LED's brightness failed (-6)
[   16.228184] dell_laptop: Setting old previous keyboard state failed
[   16.228189] leds dell::kbd_backlight: Setting an LED's brightness failed (-6)
[  519.918079] dell_laptop: Setting old previous keyboard state failed
[  519.918085] leds dell::kbd_backlight: Setting an LED's brightness failed (-6)
[  549.868267] dell_laptop: Setting old previous keyboard state failed
[  549.868271] leds dell::kbd_backlight: Setting an LED's brightness failed (-6)

Comment 1 Evgeny Kolesnikov 2017-04-07 14:17:52 UTC
+1, Dell Latitude E7470. 

Preinstalled Dell's Ubuntu 14.04.X does not seem to have this problem, if I remember it right.

Comment 2 Evgeny Kolesnikov 2017-04-10 07:10:53 UTC
Fedora 26 actual (Kernel 4.11.0-0.rc3) is also affected. Logs are the same.

Comment 3 Evgeny Kolesnikov 2017-04-10 07:55:28 UTC
Sorry for making so much noise but I uncovered some more details (F26, K4.11.0-0.rc3).

Keyboard backlight still could not be controlled from Gnome Settings, but if you turn off the light with Fn+F10 and wait for the laptop to go to sleep it will turn keyboard backlight back ON while turning the screen off.

Comment 4 Laura Abbott 2017-04-10 17:30:53 UTC
There was exactly one commit to drivers/platform/x86/dell-laptop.c between 4.9 and 4.10

commit 1d161d4cd719ac498545c94805803af8af9b642f
Author: Hans de Goede <hdegoede>
Date:   Wed Oct 26 17:17:44 2016 +0200

    platform/x86: dell-laptop: Use brightness_set_blocking for kbd_led_level_set
    
    kbd_led_level_set uses dell_smbios call which blocks, so the kbd_led
    classdev should use the brightness_set_blocking callback.
    
    Signed-off-by: Hans de Goede <hdegoede>
    Reviewed-by: Pali Rohár <pali.rohar>
    Signed-off-by: Darren Hart <dvhart.com>

Which seems like a good candidate for causing problems. Hans, any idea?

Comment 5 Hans de Goede 2017-04-10 18:09:00 UTC
Hi,

(In reply to Laura Abbott from comment #4)
> There was exactly one commit to drivers/platform/x86/dell-laptop.c between
> 4.9 and 4.10
> 
> commit 1d161d4cd719ac498545c94805803af8af9b642f
> Author: Hans de Goede <hdegoede>
> Date:   Wed Oct 26 17:17:44 2016 +0200
> 
>     platform/x86: dell-laptop: Use brightness_set_blocking for
> kbd_led_level_set
>     
>     kbd_led_level_set uses dell_smbios call which blocks, so the kbd_led
>     classdev should use the brightness_set_blocking callback.
>     
>     Signed-off-by: Hans de Goede <hdegoede>
>     Reviewed-by: Pali Rohár <pali.rohar>
>     Signed-off-by: Darren Hart <dvhart.com>
> 
> Which seems like a good candidate for causing problems. Hans, any idea?

All that that commit does from this bug's pov is that it now propagates errors (and the LED core now reports them). As per the description of the bug: 

"In 4.8 and 4.9 kernels no such messages appeared and Dell keyboard backlight could not be software controlled.

The backlight still cannot be software-controlled in 4.10 but now these messages appear"

Things were already not working in 4.8 / 4.9, my commit just causes an error to actually get logged for this now :)

Error -6 is -ENXIO which comes from dell_smbios_error() which says: 

        case -2: /* Function not supported */
                return -ENXIO;

So the dell-laptop code definitely doing something wrong, but what exactly that is the question.

Comment 6 Laura Abbott 2017-04-10 19:23:04 UTC
Thanks for clarifying. The best way to get this fixed would be to report it to the x86 platform maintainers, ideally via an e-mail to the list but I think they check the kernel.org bugzilla as well.

Comment 7 Evgeny Kolesnikov 2017-04-10 19:33:38 UTC
That's the upstream bug report: https://bugzilla.kernel.org/show_bug.cgi?id=191731

Comment 8 Arcadiy Ivanov 2017-04-22 20:32:21 UTC
Some additional reading material:
https://github.com/dell/libsmbios/issues/17
https://www.spinics.net/lists/platform-driver-x86/msg11195.html

Comment 9 Arcadiy Ivanov 2017-04-22 21:04:27 UTC
Time permitting I'll be fixing dell-laptop module to fix the keyboard LEDs. I'll keep everyone posted on the progress.

Comment 10 Arcadiy Ivanov 2017-04-23 04:56:41 UTC
https://github.com/torvalds/linux/pull/407

Comment 11 Arcadiy Ivanov 2017-04-23 20:17:13 UTC
This patch supersedes mine: https://patchwork.kernel.org/patch/9695271/

Comment 12 Arcadiy Ivanov 2017-05-06 10:38:58 UTC
The patch is now in main: https://github.com/torvalds/linux/commit/9216e0dcb5533a999d544d0af8661118e0588e1d

Please backport into F25/F26 train.

Comment 13 Rory Renton 2017-05-07 03:03:30 UTC
sounds like it's fixed.

is the patch coming to f25?

Comment 14 Fedora Update System 2017-05-09 12:42:50 UTC
kernel-4.10.15-200.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4537a2fbdc

Comment 15 Fedora Update System 2017-05-09 12:43:41 UTC
kernel-4.10.15-100.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-9a479a2cff

Comment 16 Fedora Update System 2017-05-10 07:04:35 UTC
kernel-4.10.15-200.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-4537a2fbdc

Comment 17 Fedora Update System 2017-05-10 10:43:57 UTC
kernel-4.10.15-100.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-9a479a2cff

Comment 18 Arcadiy Ivanov 2017-05-11 01:04:04 UTC
I can confirm that kernel-4.10.15-200.fc25 is working with Dell Precision 7510/0M91XC, that keyboard brightness can now be regulated with KDE Plasma widget and in response to power events.

Comment 19 Fedora Update System 2017-05-16 06:01:20 UTC
kernel-4.10.15-200.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 20 Fedora Update System 2017-05-17 05:56:50 UTC
kernel-4.10.15-100.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 21 David Koppelman 2017-06-08 20:10:40 UTC
Will this be applied to F26?

Comment 22 Laura Abbott 2017-06-08 20:41:19 UTC
Yes, F26 seems to have gotten lost in the shuffle. We're still in beta freeze so once that ends the patch can be applied there too.

Comment 23 David Koppelman 2017-06-14 13:38:00 UTC
Can the fix be applied to F26 now?

Comment 24 Arcadiy Ivanov 2018-02-24 06:13:07 UTC
The error is back on 4.15.4-300.fc27.x86_64. This is a regression from 4.15.3.fc27.

[    5.614704] dell_laptop: Setting old previous keyboard state failed
[    5.614725] leds dell::kbd_backlight: Setting an LED's brightness failed (-6)

Comment 25 Alfredo Ferrari 2018-03-06 04:49:38 UTC
I have the same problem on a Dell Precision M4800 with the latest Fedora 27 kernels. The keyboard backlight is never working correctly, when the laptop boots it gets switched off completely, if I reactivate it with the Fn keys it lights up only for 1-2 seconds at every keyboard tap which makes it pretty unusable. Also, I noticed that every time I boot in Fedora, the BIOS settings got reset to 25% illumination level, while I set them at 75%, clearly recent Fedora kernels mess
up with the backlight and the BIOS.
I have also a Latitude E7270, where the problem is less serious, still Fedora when booting switches off the keyboard backlight, but with the Fn+F10 keys I can get it working properly again.
All this with kernel-4.15.6.fc27, x86_64

Comment 26 Arcadiy Ivanov 2018-03-06 07:19:52 UTC
Regression is gone on 4.15.7-300.fc27.


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