Bug 211741 - amd-hid: add support for SW_TABLET_MODE
Summary: amd-hid: add support for SW_TABLET_MODE
Status: REOPENED
Alias: None
Product: Drivers
Classification: Unclassified
Component: Platform_x86 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_platform_x86@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-14 19:20 UTC by Luya Tshimbalanga
Modified: 2023-04-25 16:18 UTC (History)
5 users (show)

See Also:
Kernel Version: 5.11.0-0.rc7
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Luya Tshimbalanga 2021-02-14 19:20:47 UTC
On a convertible laptop running on a mobile AMD Ryzen series like a HP Envy 360,  SW_TABLET_MODE failed to run preventing the disabling of keyboard when a device is folded in tablet mode.

The issue is similar to https://bugzilla.kernel.org/show_bug.cgi?id=207433 for Intel HID suggesting either a driver or a firmware bug.
Comment 1 Luya Tshimbalanga 2021-03-07 09:37:04 UTC
Here is the hardware information:
sudo dmidecode -s system-manufacturer
HP

sudo dmidecode -s system-product-name
HP ENVY x360 Convertible 15-cp0xxx

sudo dmidecode -s bios-version
F.48


It seems some modification inside https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/platform/x86/hp-wmi.c is needed when using with the recently landed AMD Sensor Fusion Hub.
Comment 2 Andy Shevchenko 2021-06-08 08:30:36 UTC
Have you checked the latest kernel? Does it have the bug?
Comment 3 Luya Tshimbalanga 2021-06-08 15:33:39 UTC
Latest kernel 5.12.9-300 disabled SW_TABLET_MODE on hp-wmi because it never worked at all due possible missing driver. The current status showed:

# EVEMU 1.3
# Kernel: 5.12.9-300.fc34.x86_64
# DMI: dmi:bvnAMI:bvrF.48:bd11/26/2020:br15.48:efr92.48:svnHP:pnHPENVYx360Convertible15-cp0xxx:pvr:rvnHP:rn8497:rvr92.48:cvnHP:ct31:cvrChassisVersion:
# Input device name: "HP WMI hotkeys"
# Input device ID: bus 0x19 vendor 0000 product 0000 version 0000
# Supported events:
#   Event type 0 (EV_SYN)
#     Event code 0 (SYN_REPORT)
#     Event code 1 (SYN_CONFIG)
#     Event code 2 (SYN_MT_REPORT)
#     Event code 3 (SYN_DROPPED)
#     Event code 4 ((null))
#     Event code 5 ((null))
#     Event code 6 ((null))
#     Event code 7 ((null))
#     Event code 8 ((null))
#     Event code 9 ((null))
#     Event code 10 ((null))
#     Event code 11 ((null))
#     Event code 12 ((null))
#     Event code 13 ((null))
#     Event code 14 ((null))
#     Event code 15 (SYN_MAX)
#   Event type 1 (EV_KEY)
#     Event code 138 (KEY_HELP)
#     Event code 141 (KEY_SETUP)
#     Event code 148 (KEY_PROG1)
#     Event code 153 (KEY_ROTATE_DISPLAY)
#     Event code 224 (KEY_BRIGHTNESSDOWN)
#     Event code 225 (KEY_BRIGHTNESSUP)
#     Event code 226 (KEY_MEDIA)
#     Event code 240 (KEY_UNKNOWN)
#     Event code 358 (KEY_INFO)
#   Event type 4 (EV_MSC)
#     Event code 4 (MSC_SCAN)
#   Event type 5 (EV_SW)
#     Event code 5 (SW_DOCK)
#        State 0

The bug still remains as the keyboard still works even on tablet mode. Ideally, it should be disabled at that mode while the touchscreen remains active.
Comment 4 Luya Tshimbalanga 2021-06-08 16:00:57 UTC
See the linked showing that SW_TABLET_MODE never worked with hp-wmi and why it was disabled in kernel 5.11.x for the time being:

https://bugzilla.redhat.com/show_bug.cgi?id=1651886#c44
Comment 5 Andy Shevchenko 2022-11-24 11:49:38 UTC
Add Hans to the Cc list, he made a lot of work on different laptops to make SW_TABLET_MODE working.
Comment 6 Mario Limonciello (AMD) 2022-11-30 22:11:59 UTC
I'd expect that this is actually fixed now in 5.18 or later by this commit:

520ee4ea1cc6 ("platform/x86: hp-wmi: Fix SW_TABLET_MODE detection method")

Can you please recheck on a kernel containing that?
Comment 7 Luya Tshimbalanga 2022-12-01 01:06:10 UTC
Unfortunately, I have no longer a HP Envy x360 for testing anymore. It is replaced by a Dell Inspiron 14 7425 2-in-1 Ryzen 7 5825U.
Comment 8 Mario Limonciello (AMD) 2022-12-01 02:11:55 UTC
Okay, I'll close this then, thanks.
Comment 9 Nils Jacobs 2022-12-01 10:29:16 UTC
I can confirm that this bug still persists in kernel 6.0 so the path submitted in 5.18 didn't work for at least my HP envy x360. The only thing that changed since that patch is now that when running evtest the SW_TABLET_MODE shows up as an input device but the event never triggers when putting the device in tablet mode.
Comment 10 Firnin 2023-04-25 16:18:52 UTC
I can confirm that this bug is still present in kernel 6.1. SW_TABLET_MODE does show up as an input device, but never triggers an event.

Note You need to log in before you can comment on or make changes to this bug.