dell_wmi: Unknown key codes

Bug #1762385 reported by Dmitriy Geels on 2018-04-09
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OEM Priority Project
Critical
Unassigned
linux (Ubuntu)
Status tracked in Cosmic
Bionic
Medium
Kai-Heng Feng
Cosmic
Medium
Kai-Heng Feng
systemd (Ubuntu)
Status tracked in Cosmic
Xenial
Undecided
Unassigned
Bionic
Undecided
Unassigned
Cosmic
Undecided
Unassigned

Bug Description

[Impact]

 * Bogus keycode messages produced by the kernel / user annoyance
 * rfkill keyboard shortcuts not working as intended on some Dell machines

[Test Case]

 * check that there are no spurious kernel messages about unknown keys in journalctl upon RFKill key presses

 * check that RFKill key presses work correctly and kill/restore RF capabilities

[Regression Potential]

 * The change is scoped to particular SKUs and thus should only affect them
 * It is related to matching gsd support, which is in-place on xenial and up

[Solution]
Cherrypick upstream commit https://github.com/systemd/systemd/commit/cab01e9ecf1c69656785e64f5fc94cd4ed09e57f

[Original Bug report]

RFKill key produces these messages in kernel log:

dell_wmi: Unknown key with type 0x0010 and code 0xe008 pressed

This key code is a notification and should be added as KEY_IGNORE here: https://github.com/torvalds/linux/blob/master/drivers/platform/x86/dell-wmi.c#L263

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: linux-image-4.15.0-15-generic 4.15.0-15.16
ProcVersionSignature: Ubuntu 4.15.0-15.16-generic 4.15.15
Uname: Linux 4.15.0-15-generic x86_64
ApportVersion: 2.20.9-0ubuntu4
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: dmig 2737 F.... pulseaudio
CurrentDesktop: ubuntu:GNOME
Date: Mon Apr 9 18:09:03 2018
InstallationDate: Installed on 2018-03-27 (12 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Alpha amd64 (20180327)
MachineType: Dell Inc. Inspiron 5379
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/@/boot/vmlinuz-4.15.0-15-generic root=UUID=9745e22b-0b19-4a7d-98a0-1a4bc5b19d99 ro rootflags=subvol=@ quiet splash vt.handoff=1
RelatedPackageVersions:
 linux-restricted-modules-4.15.0-15-generic N/A
 linux-backports-modules-4.15.0-15-generic N/A
 linux-firmware 1.173
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 01/31/2018
dmi.bios.vendor: Dell Inc.
dmi.bios.version: 1.6.0
dmi.board.name: 0C6J64
dmi.board.vendor: Dell Inc.
dmi.board.version: A00
dmi.chassis.type: 10
dmi.chassis.vendor: Dell Inc.
dmi.modalias: dmi:bvnDellInc.:bvr1.6.0:bd01/31/2018:svnDellInc.:pnInspiron5379:pvr:rvnDellInc.:rn0C6J64:rvrA00:cvnDellInc.:ct10:cvr:
dmi.product.family: Inspiron
dmi.product.name: Inspiron 5379
dmi.sys.vendor: Dell Inc.

Dmitriy Geels (dmig) wrote :

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v4.16 kernel[0].

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.16

Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete
Dmitriy Geels (dmig) wrote :

According to https://github.com/torvalds/linux/blob/master/drivers/platform/x86/dell-wmi.c this key isn't supported by kernel.
To add support record { KE_IGNORE, 0xe008, { KEY_RFKILL } } must be added to array dell_wmi_keymap_type_0010. Right now it exists only in dell_wmi_keymap_type_0000.

Here is a piece of kern.log on mainline kernel 4.16.2:
Apr 13 12:35:07 dmig-Inspiron-5379 kernel: [ 1597.752396]dell_wmi: Unknown key with type 0x0010 and code 0xe008 pressed Apr 13 12:35:07 dmig-Inspiron-5379 kernel: [ 1598.160367]dell_wmi: Unknown key with type 0x0010 and code 0xe008 pressed Apr 13 12:35:08 dmig-Inspiron-5379 kernel: [ 1598.461929]dell_wmi: Unknown key with type 0x0010 and code 0xe008 pressed Apr 13 12:35:08 dmig-Inspiron-5379 kernel: [ 1598.731117]dell_wmi: Unknown key with type 0x0010 and code 0xe008 pressed Apr 13 12:35:08 dmig-Inspiron-5379 kernel: [ 1598.990486]dell_wmi: Unknown key with type 0x0010 and code 0xe008 pressed Apr 13 12:35:09 dmig-Inspiron-5379 kernel: [ 1599.287094]dell_wmi: Unknown key with type 0x0010 and code 0xe008 pressed Apr 13 12:35:09 dmig-Inspiron-5379 kernel: [ 1599.556158]dell_wmi: Unknown key with type 0x0010 and code 0xe008 pressed Apr 13 12:35:09 dmig-Inspiron-5379 kernel: [ 1599.812597]dell_wmi: Unknown key with type 0x0010 and code 0xe008 pressed Apr 13 12:35:09 dmig-Inspiron-5379 kernel: [ 1600.109678]dell_wmi: Unknown key with type 0x0010 and code 0xe008 pressed Apr 13 12:35:10 dmig-Inspiron-5379 kernel: [ 1600.373923]dell_wmi: Unknown key with type 0x0010 and code 0xe008 pressed Apr 13 12:35:10 dmig-Inspiron-5379 kernel: [ 1600.650719]dell_wmi: Unknown key with type 0x0010 and code 0xe008 pressed Apr 13 12:35:10 dmig-Inspiron-5379 kernel: [ 1600.900744]dell_wmi: Unknown key with type 0x0010 and code 0xe008 pressed Apr 13 12:35:10 dmig-Inspiron-5379 kernel: [ 1601.149327]dell_wmi: Unknown key with type 0x0010 and code 0xe008 pressed

tags: added: kernel-bug-exists-upstream
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Kai-Heng Feng (kaihengfeng) wrote :

Did you see this after you pressed the wireless hotkey? Or did it just happen out of nowhere?

Kai-Heng Feng (kaihengfeng) wrote :

Ok it actually happens to all Dell machines I tested.
Also I can see your systemd's hwdb commit to fix the issue. I'll update your change to make it apply to all dell machines.

Dmitriy Geels (dmig) wrote :

I found one more missing key definition: FN-Lock key - Lock icon with 'Fn' on it, it toggles Fn row behavior between F1-F12 and media keys. I'm not sure with keycode it should have assigned, so I set it to IGNORE in patch.

summary: - dell_wmi: Unknown key with type 0x0010 and code 0xe008 pressed
+ dell_wmi: Unknown key codes
tags: added: patch
Kai-Heng Feng (kaihengfeng) wrote :

I can observe the same issue on several Dell systems with Linux kernel v4.4. I didn't test older kernel though.

It should be handled by the kernel instead of udevd's hwdb.

Does !wlan in hwdb necessary to make the wireless hotkey to work?
Anyway this is not the correct solution, the "!" is to send a release key for buggy keyboard, but 0xe008 we see here is just a "notification" instead of a real key press.

Changed in linux (Ubuntu):
assignee: nobody → Kai-Heng Feng (kaihengfeng)
Dmitriy Geels (dmig) wrote :

Rfkill key produces 2 events: keyboard and one, that should be handled by dell-wmi.

Hwdb record is for keyboard event. Release emulation is required, at least for my model. Otherwise evtest shows only 1 EV_KEY event.

Kai-Heng Feng (kaihengfeng) wrote :

There are actually two different bugs:

- Wireless hotkey doesn't work:
It's a bug in GNOME. You can try KDE and you'll see it works just fine.
So the udevd hwdb is not necessary.

- Annoying "unknown keycodes"
Both wireless hotkey and Fn/Multimedia hotkey "key codes" are for notification.
We need to add these two keys to the table.

Kai-Heng Feng (kaihengfeng) wrote :

It should be this bug:
https://bugzilla.gnome.org/show_bug.cgi?id=788683

I can observe the same behavior, wireless hotkey works under GDM but not after login.

Kai-Heng Feng (kaihengfeng) wrote :

I can confirm the "!" release is required.

Dmitriy Geels (dmig) wrote :

Enough guessing. Gnome bug is a different one. And it has no connection to this bug.

In my case rfkill didn't work because keycode 88 was set to UNKNOWN by this generic dell rule: https://github.com/systemd/systemd/blob/c5896b6a8cfcfd1b94f25450a96a1411384f1108/hwdb/60-keyboard.hwdb#L267

My rule https://github.com/systemd/systemd/blob/c5896b6a8cfcfd1b94f25450a96a1411384f1108/hwdb/60-keyboard.hwdb#L303-L305 was accepted and it is a correct solution, because it refines key code for exact model.

Kai-Heng Feng (kaihengfeng) wrote :

This is the same one as the Gnome bug.

Please check the commit message in https://github.com/systemd/systemd/pull/8762.

The attachment "This is a patch to dell-wmi.c kernel module adding 2 new key definitions" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

Woodrow Shen (woodrow-shen) wrote :

Attached deb patch for bionic

no longer affects: linux (Ubuntu Bionic)
no longer affects: linux (Ubuntu Xenial)
no longer affects: linux (Ubuntu Cosmic)
description: updated
description: updated
tags: added: oem-bug-1769562
Changed in systemd (Ubuntu Cosmic):
status: New → Fix Committed
Changed in oem-priority:
status: New → Confirmed
importance: Undecided → Critical

Hello Dmitriy, or anyone else affected,

Accepted systemd into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/237-3ubuntu10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in systemd (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed verification-needed-bionic
Woodrow Shen (woodrow-shen) wrote :

I verified the udev -proposed on Dell Inspiron 5767 machine and it works fine. Change tag to verification-done-bionic. Thanks.

tags: added: verification-done-bionic
removed: verification-needed-bionic
tags: added: verification-done
removed: verification-needed
Changed in oem-priority:
status: Confirmed → Triaged
Steve Langasek (vorlon) wrote :

Hello Dmitriy, or anyone else affected,

Accepted systemd into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/237-3ubuntu10.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed verification-needed-bionic
removed: verification-done verification-done-bionic
Dimitri John Ledkov (xnox) wrote :

This patch set is still present, and is operating as expected in 237-3ubuntu10.2

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 237-3ubuntu10.2

---------------
systemd (237-3ubuntu10.2) bionic; urgency=medium

  * logind: backport v238/v239 fixes for handling DRM devices.
    These changes introduce all the fixes that correct handling of open fd's
    related to the DRM devices, as used by for example NVIDIA GPUs. This backport
    includes some refactoring, corrections, and comment updates. This to insure
    that correct history is preserved, code comments match reality, and to ease
    backporting logind fixes in the future SRUs. (LP: #1777099)
  * Disable dh_installinit generation of tmpfiles for the systemd package.
    Replace with a manual safe call to systemd-tmpfiles which will process any
    updates to the tmpfiles shipped by systemd package, taking into account any
    overrides shipped by other packages, sysadmin, or specified in the runtime
    directories. (LP: #1748147)

systemd (237-3ubuntu10.1) bionic; urgency=medium

  [ Dimitri John Ledkov ]
  * hwdb: Fix wlan/rfkill keycode on Dell systems. (LP: #1762385)
  * Cherrypick upstream fix for corrected detection of Virtualbox & Xen.
    (LP: #1768104)
  * Further improve captive portal workarounds.
    Retry any NXDOMAIN results with lower feature levels, instead of just those
    with 'secure' in the domain name. (LP: #1766969)

  [ Michael Biebl ]
  * Add dependencies of libsystemd-shared to Pre-Depends.
    This is necessary so systemctl is functional at all times during a
    dist-upgrade. (Closes: #897986) (LP: #1771791)

  [ Mario Limonciello ]
  * Fix hibernate disk offsets.
    Configure resume offset via sysfs, to enable resume from a swapfile.
    (LP: #1760106)

 -- Dimitri John Ledkov 🌈 <email address hidden> Fri, 22 Jun 2018 13:55:09 +0100

Changed in systemd (Ubuntu Bionic):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for systemd has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 239-7ubuntu4

---------------
systemd (239-7ubuntu4) cosmic; urgency=medium

  * Workaround broken meson copying symlinked data files, as dangling symlinks.

 -- Dimitri John Ledkov <email address hidden> Wed, 22 Aug 2018 14:11:35 +0100

Changed in systemd (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Stefan Bader (smb) on 2018-08-30
no longer affects: linux (Ubuntu)
Changed in linux (Ubuntu):
status: New → Confirmed
assignee: nobody → Kai-Heng Feng (kaihengfeng)
no longer affects: systemd (Ubuntu Bionic)
Changed in systemd (Ubuntu Bionic):
status: New → Fix Released
Stefan Bader (smb) on 2018-08-30
no longer affects: systemd (Ubuntu Cosmic)
Changed in linux (Ubuntu Bionic):
assignee: nobody → Kai-Heng Feng (kaihengfeng)
status: New → In Progress
importance: Undecided → Medium
Changed in linux (Ubuntu Cosmic):
importance: Undecided → Medium
Seth Forshee (sforshee) on 2018-08-30
Changed in linux (Ubuntu Cosmic):
status: Confirmed → Fix Committed
Changed in linux (Ubuntu Bionic):
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.