Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard backlight timeout control script doesn't work when dell-smbios-wmi in use #65

Open
fredefox opened this issue Nov 9, 2018 · 8 comments

Comments

@fredefox
Copy link

fredefox commented Nov 9, 2018

This problem is related to (and a possible regression of) #48.

My problem is that I cannot set the keyboard timeout with smbios-keyboard-ctl. The output I get when trying to do so is:

Setting keyboard illumination timeout value  of:  1h
ERROR: Could not execute SMI.

Common problems are:

    -- 'SMM Mitigations' is enabled in BIOS setup.
        Run kernel 4.15 or later with 
        dell-smbios-wmi enabled.
         or 
        Disable 'SMM mitigations' in BIOS setup.

    -- Insufficient permissions to perform operation.
       Try running as a more privileged account.
          Linux  : run as 'root' user
          Windows: run as 'administrator' user

    -- dell-smbios-wmi driver not loaded 
       Try loading the dell-smbios-wmi driver 
          Linux : modprobe dell-smbios-wmi 

    -- Call filtered by Linux kernel 
       Some functionality is natively supported 
       by the Linux kernel 

    -- dcdbas device driver not loaded.
       Try loading the dcdbas driver
          Linux  : modprobe dcdbas

In #48 I gathered that this was related to a bug in the BIOS so I proceeded to update my BIOS. I was running 1.3.1 before, the fix was introduced in 1.4.0. I'm currently running 1.5.0 but the problem is still there. I don't know if this is still something that should be fixed upstream, if so, please point me in the right direction as to where I can report this.

I should add, as well, that I was running under X11 before, but with the BIOS update I could no longer log into my window manager. Only as far as the Gnome's login handler. Switching to Wayland fixed this. So I'm now running a different WM/Display driver! If you could help point me in the direction where to report this issue, that would be great as well.

I'm using the new XPS 9570 w/o touch.

@superm1 superm1 closed this as completed Nov 9, 2018
@superm1 superm1 reopened this Nov 9, 2018
@superm1
Copy link
Contributor

superm1 commented Nov 9, 2018

Can you please share dmesg output from your system after trying to use the backlight control?

@fredefox
Copy link
Author

fredefox commented Nov 9, 2018

Looking into /var/log/syslog I get

Nov  9 14:25:09 nightingale kernel: [ 1329.912227] dell-smbios A80593CE-A997-11DA-B012-B622A1EF5492: Invalid call 4/11:       1

After invoking

sudo smbios-keyboard-ctl --set-timeout-ac 1h

This is not much to go by I suppose. Where should I look besides?

@superm1
Copy link
Contributor

superm1 commented Nov 9, 2018

That's exactly what I expected. The kernel filters userspace requests to do this over SMI when dell-smbios-wmi is in use. Look at the error message more closely.

Userspace:

    -- Call filtered by Linux kernel 
       Some functionality is natively supported 
       by the Linux kernel 

Kernel:

Invalid call 4/11:       1

You'll need to use the kernel's backlight control interface rather than libsmbios's. Look in /sys/devices/platfrom/dell-laptop/leds/
At some point it is probably worthwhile to adjust this script to use the kernel's interface when it's present too though.

@superm1 superm1 changed the title Can't change keyboard backlight timeout Keyboard backlight timeout control script doesn't work when dell-smbios-wmi in use Nov 9, 2018
@superm1 superm1 added this to the 2.5 milestone Nov 9, 2018
@fredefox
Copy link
Author

fredefox commented Nov 9, 2018

Dear me. I didn't need to break my wm by updating the BIOS then :S Thanks for the clarification though! And I apologize for the noise. Not sure how you infer that "invalid call" means that the kernel implemented it.

@superm1
Copy link
Contributor

superm1 commented Nov 9, 2018

In general you should upgrade to new firmware for security update purposes either way. The versions reported for that other bug have no correlation to the version numbers for your platform though.

The reason I know kernel filtered it is I wrote that driver and added that feature. The intention is that tools (such as libsmbios) should migrate to the new userspace interface when available.

If you have the skill and time to help add this to the script, help is definitely welcome.

@superm1
Copy link
Contributor

superm1 commented Nov 9, 2018

@fredefox
Copy link
Author

I'm not exactly a C expert, but I might take a stab at it. Am happy to help. Will probably be second on my list after fixing the issue with X11 though.

@superm1
Copy link
Contributor

superm1 commented Nov 14, 2018

Well it's actually a python script, so that should make it easier. You don't need to implement that part in C.
I think if you detect the sysfs attributes associated with the kernel interface do it "this" way, otherwise use libsmbios (and dell-smbios-wmi or dcdbas)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants