[PATCH] platform/x86: intel-vbtn: Support for tablet mode on Dell Venue 11 Pro 7140

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On a Dell Venue 7140 tablet with the keyboard/touchpad/battery dock, when
disconnecting the dock there is a kernel bug:

BUG: kernel NULL pointer dereference, address: 0000000000000018

And this causes the following things not to work:
1. Suspend to idle - the system simply hangs
2. Poweroff normally (the only way is forcing it via long press the power button)
3. USB ports: both the USB port on the tablet and also plugging in the keyboard again

The error message above (plus some crash dump) isn't so useful for debugging, but we
have noticed that there is a debug message shown before the crash dump:

intel-vbtn INT33D6:00: Registering Intel Virtual Switches input-dev after receiving
a switch event

The messages above is shown right after the dock is disconnected, and the message implies:

We failed to set the priv->has_switches to true in the probe function since the
Dell Venue 11 Pro 7140 is not shown in the dmi_switches_allow_list, and this causes a problem
that no input_register_device() on the switch device is called. Afterward, When a user
disconnects the dock, intel-vbtn receives the ACPI event and finally find that there is a
switch out there. So intel-vbtn starts to register the switch device, which may be a dangerous
behavior since there might be some device-related objects/structs that has been freed (due to
the disconnection of the dock).

To solve this problem from the root cause, simply add the Dell Venue 11 pro 7140 to the
dmi_switches_allow_list.
(The Dell Venue 11 Pro 7140 is a 2-in-1 model that has chassis-type "Portable".)

BugLink: https://bugs.launchpad.net/bugs/2073001

Fixes: 8169bd3e6e19 ("platform/x86: intel-vbtn: Switch to an allow-list
for SW_TABLET_MODE reporting")
Reported-by: Kostadin Stoilov <kmstoilov@xxxxxxxxx>
Tested-by: Kostadin Stoilov <kmstoilov@xxxxxxxxx>
Signed-off-by: En-Wei Wu <en-wei.wu@xxxxxxxxxxxxx>
---
 drivers/platform/x86/intel/vbtn.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/platform/x86/intel/vbtn.c b/drivers/platform/x86/intel/vbtn.c
index 9b7ce03ba085..46d07d3cd34b 100644
--- a/drivers/platform/x86/intel/vbtn.c
+++ b/drivers/platform/x86/intel/vbtn.c
@@ -235,6 +235,12 @@ static const struct dmi_system_id dmi_switches_allow_list[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "Venue 11 Pro 7130"),
 		},
 	},
+	{
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Venue 11 Pro 7140"),
+		},
+	},
 	{
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
-- 
2.43.0





[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux