Bug 210269
Summary: | Tablet mode not correctly reported after wake-up from hibernate | ||
---|---|---|---|
Product: | Drivers | Reporter: | Julian (j.r) |
Component: | Platform_x86 | Assignee: | drivers_platform_x86 (drivers_platform_x86) |
Status: | NEW --- | ||
Severity: | normal | CC: | benjamin, jwrdegoede, pobrn |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 5.9.9 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: | Trivial patch to send the switch key event |
Description
Julian
2020-11-19 15:39:32 UTC
Yeah, the only thing that is missing here should be a call to dytc_lapmode_refresh at resume time. i.e. should be as simple as: * Adding a resume handler into dytc_driver_data * Add a call to dytc_lapmode_refresh there Er, sorry, this is tablet mode, not lapmode … So, it looks like we already have a call to hotkey_tablet_mode_notify_change in the resume handler. So I suspect that the sysfs file "hotkey_tablet_mode" has the correct value. If that is the case, we'll need to add a call to tpacpi_input_send_tabletsw into hotkey_resume. Is there a way I could find out if this sysfs file has the correct value? I'm not very experienced with Kernel internals so I don't really know how to find out such stuff. If I see it correctly cat /sys/devices/platform/thinkpad_acpi/hotkey_tablet_mode should be the value you're looking for. Yup, that should be the file (which will actually query ACPI for the status each time you read it). Julian, would you be able to test a patch for the thinkpad module? I could create a kernel scratch build for Fedora, not sure about other distros. Yeah Benjamin I could test a patch Just checked it and the sysfs file does contain a 0 after wakeup as you said Benjamin. Created attachment 293737 [details]
Trivial patch to send the switch key event
I wonder if we should only do this if the switch actually changed. But I suspect the input layer will already take care of that case.
Your patch seems to fix the problem Benjamin, thanks. (In reply to Benjamin Berg from comment #8) > I wonder if we should only do this if the switch actually changed. But I > suspect the input layer will already take care of that case. There is no need to check if the switch actually changed, as you already presumed the input layer will filter out the event if there is no change. (In reply to Julian from comment #9) > Your patch seems to fix the problem Benjamin, thanks. Awesome, thank you for testing. Benjamin, can you submit the fix for this upstream please ? Then I'll pick it up and merge it for the 5.11 cycle. Note please add the following tags to the commit msg: Fixes: dda3ec0aa631 ("platform/x86: thinkpad_acpi: Implement tablet mode using GMMS method") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210269 |