Keyboard backlight timeout control script doesn't work when dell-smbios-wmi in use
fredefox opened this issue · 8 comments
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.
Can you please share dmesg output from your system after trying to use the backlight control?
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?
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.
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.
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.
Specifically here is the function that causes filtering.
https://github.com/torvalds/linux/blob/master/drivers/platform/x86/dell-smbios-wmi.c#L128
And these are the calls that are filtered
https://github.com/torvalds/linux/blob/master/drivers/platform/x86/dell-smbios-base.c#L76
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.
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)