Bug 2315395 - HID lenovo is not loaded for Thinkpad X1 Tablet Gen 3 (patch included)
Summary: HID lenovo is not loaded for Thinkpad X1 Tablet Gen 3 (patch included)
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 40
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-09-28 01:09 UTC by Izhar Firdaus
Modified: 2024-10-16 02:07 UTC (History)
15 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-10-10 09:48:53 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Izhar Firdaus 2024-09-28 01:09:19 UTC
1. Please describe the problem:
FnLock , Mute, and multiple keyboard media buttons are not working on Thinkpad X1 Tablet Gen 3. hid-lenovo kernel module is not loaded for the model. Patching it works. 

2. What is the Version-Release number of the kernel:
6.10.11-200.fc40.x86_64


3. Did it work previously in Fedora? If so, what kernel version did the issue
   *first* appear?  Old kernels are available for download at
   https://koji.fedoraproject.org/koji/packageinfo?packageID=8 :
No

4. Can you reproduce this issue? If so, please provide the steps to reproduce
   the issue below:
Install fedora on X1 Tablet Gen 3, FnLock, F4/Mute not working

5. Does this problem occur with the latest Rawhide kernel? To install the
   Rawhide kernel, run ``sudo dnf install fedora-repos-rawhide`` followed by
   ``sudo dnf update --enablerepo=rawhide kernel``:
Yes


6. Are you running any modules that not shipped with directly Fedora's kernel?:
No

7. Please attach the kernel logs. You can get the complete kernel log
   for a boot with ``journalctl --no-hostname -k > dmesg.txt``. If the
   issue occurred on a previous boot, use the journalctl ``-b`` flag.

Attached a patch to hid-lenovo.c against upstream https://github.com/torvalds/linux/blob/v6.10/drivers/hid/hid-lenovo.c:


--- hid-lenovo.c	2024-09-28 08:58:00.510054052 +0800
+++ hid-lenovo.c	2024-09-28 08:41:42.514276903 +0800
@@ -473,7 +473,9 @@
 		return lenovo_input_mapping_tp10_ultrabook_kbd(hdev, hi, field,
 							       usage, bit, max);
 	case USB_DEVICE_ID_LENOVO_X1_TAB:
+	case USB_DEVICE_ID_LENOVO_X1_TAB3:
 		return lenovo_input_mapping_x1_tab_kbd(hdev, hi, field, usage, bit, max);
+
 	default:
 		return 0;
 	}
@@ -583,6 +585,7 @@
 		break;
 	case USB_DEVICE_ID_LENOVO_TP10UBKBD:
 	case USB_DEVICE_ID_LENOVO_X1_TAB:
+        case USB_DEVICE_ID_LENOVO_X1_TAB3:
 		ret = lenovo_led_set_tp10ubkbd(hdev, TP10UBKBD_FN_LOCK_LED, value);
 		if (ret)
 			return ret;
@@ -776,6 +779,7 @@
 		return lenovo_event_cptkbd(hdev, field, usage, value);
 	case USB_DEVICE_ID_LENOVO_TP10UBKBD:
 	case USB_DEVICE_ID_LENOVO_X1_TAB:
+        case USB_DEVICE_ID_LENOVO_X1_TAB3:
 		return lenovo_event_tp10ubkbd(hdev, field, usage, value);
 	default:
 		return 0;
@@ -1056,6 +1060,7 @@
 		break;
 	case USB_DEVICE_ID_LENOVO_TP10UBKBD:
 	case USB_DEVICE_ID_LENOVO_X1_TAB:
+        case USB_DEVICE_ID_LENOVO_X1_TAB3:
 		ret = lenovo_led_set_tp10ubkbd(hdev, tp10ubkbd_led[led_nr], value);
 		break;
 	}
@@ -1286,6 +1291,7 @@
 		break;
 	case USB_DEVICE_ID_LENOVO_TP10UBKBD:
 	case USB_DEVICE_ID_LENOVO_X1_TAB:
+        case USB_DEVICE_ID_LENOVO_X1_TAB3:
 		ret = lenovo_probe_tp10ubkbd(hdev);
 		break;
 	default:
@@ -1372,6 +1378,7 @@
 		break;
 	case USB_DEVICE_ID_LENOVO_TP10UBKBD:
 	case USB_DEVICE_ID_LENOVO_X1_TAB:
+        case USB_DEVICE_ID_LENOVO_X1_TAB3:
 		lenovo_remove_tp10ubkbd(hdev);
 		break;
 	}
@@ -1421,13 +1428,15 @@
 	 */
 	{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
 		     USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X1_TAB) },
+	{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
+		     USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X1_TAB3) },
 	{ }
 };
 
 MODULE_DEVICE_TABLE(hid, lenovo_devices);
 
 static struct hid_driver lenovo_driver = {
	.name = "lenovo",
 	.id_table = lenovo_devices,
 	.input_configured = lenovo_input_configured,
 	.input_mapping = lenovo_input_mapping,
@@ -1442,4 +1451,5 @@
 };
 module_hid_driver(lenovo_driver);
 
 MODULE_LICENSE("GPL");


Reproducible: Always

Comment 1 Hans de Goede 2024-09-28 16:05:42 UTC
Thank you for reporting this.

The best way to get this fixed is for someone to submit a patch with the changes you are suggesting to the upstream driver and then Fedora will pick this up automatically when it gets added to the 6.10.y / 6.11.y stable kernel releases.

Are you planning on submitting a patch for this upstream, or shall I submit it upstream?

If you want me to submit it upstream, I would like to credit you for this if that is ok with you:

Option 1:

Author: Izhar Firdaus <email>
Signed-off-by: Izhar Firdaus <email>

Option 2:

Author: Hans de Goede <hdegoede>
Co-developed-by: Izhar Firdaus <email>
Signed-off-by: Izhar Firdaus <email>

Option 3:

Author: Hans de Goede <hdegoede>

Suggested-by: Izhar Firdaus <email>

Option 4 (same as 3 without email address) :

Author: Hans de Goede <hdegoede>
Suggested-by: Izhar Firdaus

Option 5:

No credit (just a link to this bugzilla in the commitmsg)

Please let me know if you want credit and which email address you want to use if you go for an option which includes an email address.

Note that this will pretty much publish the email address which you provide to the entire world!

Comment 2 Hans de Goede 2024-09-28 16:07:09 UTC
Note the code-changes which you provide are missing the addition of: USB_DEVICE_ID_LENOVO_X1_TAB3 to drivers/hid/hid-ids.h can you please provide that part too ?

Comment 3 Izhar Firdaus 2024-09-28 16:33:03 UTC
Hi .. 

As I'm not familiar with kernel.org patch submission & approval processes, I'll go with Option 3 with my fp.o address: izhar

USB_DEVICE_ID_LENOVO_X1_TAB3 already exists here: https://github.com/torvalds/linux/blob/v6.10/drivers/hid/hid-ids.h

#define USB_DEVICE_ID_LENOVO_X1_TAB3	0x60b5

Thank you!

Comment 4 Hans de Goede 2024-10-10 09:48:53 UTC
Sorry for being a bit slow (I was swamped with other stuff).

I have submitted this upstream now using Suggested-by with your fedoraproject.org address:

https://lore.kernel.org/linux-input/20241010094512.215797-1-hdegoede@redhat.com/

Typically these kind of patches get backported to e.g. 6.11.y pretty soon after landing upstream.

Comment 5 Izhar Firdaus 2024-10-16 02:07:35 UTC
Thank you!


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