You are not logged in.
Hi everyone,
I wanted to share a project and kernel fix I've been working on for AMD Ryzen 4000 (Renoir) 2-in-1 convertible laptops. I'm running Arch on a Dell Inspiron 7405 2-in-1 with Hyprland, where tablet mode and the hardware accelerometer (amd_sfh) have been completely non-functional upstream for years.
After reverse-engineering the BAR 2 registers and tracing drivers/hid/amd-sfh-hid, I identified three separate bugs preventing this hardware from working:
1. 32-bit DMA Truncation on Renoir MP2: Upstream calls dma_set_mask_and_coherent() with DMA_BIT_MASK(64). Because Renoir MP2 only has a 32-bit DMA engine, allocations above 4GB get truncated in hardware, causing memory corruption and MCE / bad swap offset kernel panics. Changing this to DMA_BIT_MASK(32) eliminates the crashes.
2. Command ACK Timeout: The driver defaults intr_disable = true, which prevents Renoir MP2 firmware from acknowledging sensor enable commands (Bugzilla #218104). Setting intr_disable = false allows commands to be processed.
3. Uninitialized HID Report Type Routing: In amd_sfh_client.c, the work handler dispatches reports using an uninitialized array cli_data->report_type (defaults to 0, which is HID_INPUT_REPORT). When the hub queried a 15-byte Feature report, it was routed to the input report handler. The input report descriptor expects 16 bytes total (15 payload + 1 ID), causing hid-core to throw "Event data for report 1 was too short (15 vs 14)" and drop all motion events with -EINVAL. Routing via the actual node_type from the request node fixes this and unlocks accel_3d in IIO.
For Wayland / Hyprland users, rotating the screen without transforming the input coordinates inverts touch/stylus controls. I wrote a daemon that reads the raw IIO accelerometer stream (in_accel_*_raw) with hysteresis filtering and synchronously updates both the display transform and input:touchdevice:transform mapped to eDP-1.
I've packaged the patched driver into a DKMS module (so it automatically survives kernel upgrades) along with the Hyprland daemon and systemd unit:
GitHub repository:
https://github.com/WhiteDoor6767/amd-sfh-renoir-fix
Quick install:
git clone https://github.com/WhiteDoor6767/amd-sfh-renoir-fix.git
cd amd-sfh-renoir-fix
chmod +x install.sh
./install.shI have also formatted the 4 patches and submitted them upstream to linux-input@vger.kernel.org (archived on lore.kernel.org).
If you have a Dell Inspiron 7405 or another Ryzen 4000 convertible (HP Envy x360, Lenovo Yoga 6), feedback and testing would be greatly appreciated!
Offline