-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
hwdb modalias matching issue on aarch64 #24232
Description
systemd version the issue has been seen with
251
Used distribution
Debian Testing
Linux kernel version used
5.19.0
CPU architectures issue was seen on
aarch64
Component
hardware database files
Expected behaviour you didn't see
In /etc/udev/hwdb.d/61-sensor-local.hwdb, I would expect the following rule to match on my system
sensor:modalias:platform:cros-ec-accel
ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1
Unexpected behaviour you saw
Above rule did not take effect. Only the following catch-all rule would work:
sensor:modalias:platform:*
ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1
Steps to reproduce the problem
Get a Chromebook with aarch64 chip. Install Linux in developer mode. Observe sudo su -s /bin/sh geoclue -c monitor-sensor shows the sensor reads "upside down". Try fixing with first rule that matches the sensor's modalias.
Additional program output to the terminal or log subsystem illustrating the issue
Note that CONFIG_DMIID documented in 60-sensor.hwdb is not applicable to the aarch64 platform.
Lines 13 to 18 in 2fb1165
| # The full DMI string of the running machine can be read from | |
| # /sys/class/dmi/id/modalias | |
| # That requires a kernel built with CONFIG_DMIID set, which is common. | |
| # The full DMI string is not needed here and the meaning of individual parts | |
| # can be seen in the source of the DMIID kernel module | |
| # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/firmware/dmi-id.c |
I suspect there is some x86 related behavior hardcoded that breaks the modalias based matching on aarch64 systems.
Once this is fixed, all the rules for individual chromebooks at
Lines 406 to 430 in 2fb1165
| ######################################### | |
| # Google Chromebooks | |
| ######################################### | |
| sensor:modalias:platform:cros-ec-accel:dmi:*:svnGOOGLE:* | |
| ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1 | |
| # caroline board (Samsung Chromebook Pro) reports itself as svnGoogle | |
| sensor:modalias:platform:cros-ec-accel:dmi:*:svnGoogle:pnCaroline*:* | |
| ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1 | |
| # Dell Inspiron Chromebook 14 2-in-1 | |
| sensor:modalias:platform:cros-ec-accel:dmi:*svnGoogle:pnVayne*:* | |
| ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1 | |
| # nocturne board (Google Pixel Slate) | |
| sensor:modalias:platform:cros-ec-accel:dmi:*Google_Nocturne*:* | |
| ACCEL_MOUNT_MATRIX=1, 0, 0; 0, -1, 0; 0, 0, 1 | |
| # rammus board (Asus Chromebook Flip C433) | |
| sensor:modalias:platform:cros-ec-accel:dmi:*svnGoogle:pnRammus*:* | |
| ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1 | |
| # Lenovo ThinkPad C13 Yoga | |
| sensor:modalias:platform:cros-ec-accel:dmi:*svnGoogle:pnMorphius*:* | |
| ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1 |
can be replaced by a single rule matching all sensor:modalias:platform:cros-ec-accel as the ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1 on all Chromebooks.