Bug 2229373 - Laptop keyboard and touchpad don't work on 6.4.x
Summary: Laptop keyboard and touchpad don't work on 6.4.x
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 38
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-05 11:12 UTC by Dmitry
Modified: 2023-08-13 15:10 UTC (History)
18 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-08-13 15:10:54 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dmitry 2023-08-05 11:12:21 UTC
Hello. I have a laptop 'Lenovo ThinkBook 13s G2 ITL 20V9' (hardware: https://linux-hardware.org/?computer=3b02dcd80f3c)
On 6.3.12 everything is fine. After updating kernel to 6.4.4 and later, keyboard and touch pad don't work, I can use only virtual keyboard and bluetooth mouse for input.

If I need to gather any additional informational/diagnostic data, please write how.

Reproducible: Always

Steps to Reproduce:
1. Turn on PC
2. Choose any 6.4.x kernel in GRUB
3. After OS loading try to choose a user and enter password
Actual Results:  
Keyboard and touchpad are not working

Expected Results:  
Keyboard and touchpad are working

libinput-1.23.0-2.fc38.x86_64

Comment 1 Peter Hutterer 2023-08-10 00:19:43 UTC
Punting to the kernel, libinput doesn't know about the kernel version running and if the kernel update caused it that's a good hint there.

Comment 2 Hans de Goede 2023-08-10 07:44:18 UTC
I wonder if this is caused by some input device now reporting SW_TABLET_MODE=1 causing libinput to filter out keyboard and touchpad events.

cozykopaka can you do:

sudo dnf install evtest

And then:

1. Run "sudo evtest" and then select the "AT PS/2" (or something like it) keyboard device and see if that still prints events when you press keys.

2. Run "sudo evtest" and then select something like "ELAN06FA:00 Touchpad" and see if that generates events for the touchpad ?

3. Please try "sudo evtest" for all input devices 1 by 1 and see if any lists SW_TABLET_MODE in the header where the supported events are printed after selecting the device and if yes, what the reported value for SW_TABLET_MODE is.

After running these tests please let us know the results of all 3 tests.

Comment 3 Dmitry 2023-08-10 15:40:19 UTC
Did all the tests:
1. There was a device "AT Raw Set 2 keyboard" in the list, and evtest printed events for the keys.
2. There was a device "ELAN06FA:00 04F3:3141 Touchpad" in the list, and evtest also showed events for it.
3. Yes, there's 16 devices and "Lenovo Yoga Tablet Mode Control switch" shows "Event code 1 (SW_TABLET_MODE) state 1"
Forgot to mention, this laptop has a touchscreen and it works fine on both 6.3.x and 6.4.x kernels.

Comment 4 Hans de Goede 2023-08-10 18:25:56 UTC
(In reply to Dmitry from comment #3)
> Did all the tests:
> 1. There was a device "AT Raw Set 2 keyboard" in the list, and evtest
> printed events for the keys.
> 2. There was a device "ELAN06FA:00 04F3:3141 Touchpad" in the list, and
> evtest also showed events for it.
> 3. Yes, there's 16 devices and "Lenovo Yoga Tablet Mode Control switch"
> shows "Event code 1 (SW_TABLET_MODE) state 1"
> Forgot to mention, this laptop has a touchscreen and it works fine on both
> 6.3.x and 6.4.x kernels.

Thank you for running those test, this:

> 3. Yes, there's 16 devices and "Lenovo Yoga Tablet Mode Control switch"
> shows "Event code 1 (SW_TABLET_MODE) state 1"

Is exactly what I expected although I admittedly completely forgot about the new lenovo-ymc driver, even though I'm the person who reviewed and merged it upstream.

For now you should be able to use a 6.4.? kernel by adding "modprobe.blacklist=lenovo_ymc" to the kernel commandline after that the "Lenovo Yoga Tablet Mode Control switch" device should disappear and your keyboard and touchpad should work again with 6.4.? kernels.

The issue is that your BIOS exports the WMI methods (which are identified by GUID, so quite unique) for "Lenovo Yoga Tablet Mode Control" even though your thinkbook is not a yoga. That and that the WMI methods report "device is in tablet mode", so libinput thinks this is a yoga with the keyboard + touchpad folded underneath the screen for tabler mode and thus throws away keyboard + touchpad event as spurious events.

For a proper kernel fix disabling the driver on your laptop model I need some more info, can you please run as *normal* user:

grep . /sys/class/dmi/id/* 2> /dev/null

And then copy and paste the output of that command here? After that I'll try to come up with a hopefully somewhat generic solution and discuss things with the authors of the lenovo-ymc driver.

Comment 5 Dmitry 2023-08-10 18:57:23 UTC
Thank you very much! I added this option and it helped.

Here's the output of the command:
/sys/class/dmi/id/bios_date:05/05/2023
/sys/class/dmi/id/bios_release:1.56
/sys/class/dmi/id/bios_vendor:LENOVO
/sys/class/dmi/id/bios_version:F9CN56WW
/sys/class/dmi/id/board_asset_tag:No Asset Tag
/sys/class/dmi/id/board_name:LNVNB161216
/sys/class/dmi/id/board_vendor:LENOVO
/sys/class/dmi/id/board_version:SDK0J40697 WIN
/sys/class/dmi/id/chassis_asset_tag:No Asset Tag
/sys/class/dmi/id/chassis_type:10
/sys/class/dmi/id/chassis_vendor:LENOVO
/sys/class/dmi/id/chassis_version:ThinkBook 13s G2 ITL
/sys/class/dmi/id/ec_firmware_release:1.44
/sys/class/dmi/id/modalias:dmi:bvnLENOVO:bvrF9CN56WW:bd05/05/2023:br1.56:efr1.44:svnLENOVO:pn20V9:pvrThinkBook13sG2ITL:rvnLENOVO:rnLNVNB161216:rvrSDK0J40697WIN:cvnLENOVO:ct10:cvrThinkBook13sG2ITL:skuLENOVO_MT_20V9_BU_idea_FM_ThinkBook13sG2ITL:
/sys/class/dmi/id/product_family:ThinkBook 13s G2 ITL
/sys/class/dmi/id/product_name:20V9
/sys/class/dmi/id/product_sku:LENOVO_MT_20V9_BU_idea_FM_ThinkBook 13s G2 ITL
/sys/class/dmi/id/product_version:ThinkBook 13s G2 ITL
/sys/class/dmi/id/sys_vendor:LENOVO
/sys/class/dmi/id/uevent:MODALIAS=dmi:bvnLENOVO:bvrF9CN56WW:bd05/05/2023:br1.56:efr1.44:svnLENOVO:pn20V9:pvrThinkBook13sG2ITL:rvnLENOVO:rnLNVNB161216:rvrSDK0J40697WIN:cvnLENOVO:ct10:cvrThinkBook13sG2ITL:skuLENOVO_MT_20V9_BU_idea_FM_ThinkBook13sG2ITL:

Comment 6 Hans de Goede 2023-08-12 15:29:16 UTC
Thank you.

I have prepared a kernel patch which should fix this:

https://lore.kernel.org/platform-driver-x86/20230812144818.383230-1-hdegoede@redhat.com/

I have also started a test build of the Fedora 38 6.4.10 kernel with this patch added:

https://koji.fedoraproject.org/koji/taskinfo?taskID=104738886

Note this is still building atm, this should be finished in a couple of hours.

Here are some instructions for installing a kernel directly from koji (Fedora's buildsystem):

https://fedorapeople.org/~jwrdegoede/kernel-test-instructions.txt

Please give this test build a try. Do not forget to remove the modprobe.blacklist=lenovo_ymc from the kernel commandline. After booting the test kernel please do:

uname -r
lsmod | grep lenovo_ymc

The first command should show bz2229373 in the kernel-release info. The second command should show that the module is loaded. Despite the module being loaded your keyboard + touchpad should keep functioning normally.

It would be great if you can test the test-kernel this weekend as I plan to send a pull-request with some fixes for 6.5 to Linus coming Monday or Tuesday and I would like to include the patch fixing this.

Comment 7 Hans de Goede 2023-08-12 17:55:47 UTC
The test kernel is done building now, please give it a try:

https://koji.fedoraproject.org/koji/taskinfo?taskID=104738886
https://fedorapeople.org/~jwrdegoede/kernel-test-instructions.txt

Comment 8 Dmitry 2023-08-13 06:27:27 UTC
I've installed the test kernel following the instructions, removed "modprobe.blacklist=lenovo_ymc", etc.
Keyboard and touchpad work fine.
Commands' outputs are:

6.4.10-200.bz2229373.fc38.x86_64

lenovo_ymc             20480  0
sparse_keymap          12288  2 ideapad_laptop,lenovo_ymc
wmi                    45056  5 video,wmi_bmof,ideapad_laptop,lenovo_ymc,think_lmi

Comment 9 Hans de Goede 2023-08-13 15:10:54 UTC
(In reply to Dmitry from comment #8)
> I've installed the test kernel following the instructions, removed
> "modprobe.blacklist=lenovo_ymc", etc.
> Keyboard and touchpad work fine.
> Commands' outputs are:
> 
> 6.4.10-200.bz2229373.fc38.x86_64
> 
> lenovo_ymc             20480  0
> sparse_keymap          12288  2 ideapad_laptop,lenovo_ymc
> wmi                    45056  5
> video,wmi_bmof,ideapad_laptop,lenovo_ymc,think_lmi

Thank you for the quick test!

I have send a pull-request with fixes for 6.5 to Linus, including the patch fixing this:

https://lore.kernel.org/platform-driver-x86/70d9417a-1b90-58ed-8810-fc617701d689@redhat.com/

Once this is merged by Linus I expect this to get added to the 6.4.y stable kernel series relatively quickly, so I expect the Fedora 6.4.12 or 6.4.13 kernel update to have the fix.

In the mean time you can keep using `modprobe.blacklist=lenovo_ymc` on the kernel commandline as a workaround.


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