]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
HID: i2c-hid: Ignore input report if there's no data present on Elan touchpanels
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Tue, 29 Jan 2019 08:44:30 +0000 (16:44 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 6 Feb 2019 04:53:01 +0000 (04:53 +0000)
BugLink: https://bugs.launchpad.net/bugs/1813733
While using Elan touchpads, the message floods:
[  136.138487] i2c_hid i2c-DELL08D6:00: i2c_hid_get_input: incomplete report (14/65535)

Though the message flood is annoying, the device it self works without
any issue. I suspect that the device in question takes too much time to
pull the IRQ back to high after I2C host has done reading its data.

Since the host receives all useful data, let's ignore the input report
when there's no data.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
(backported from commit 1475af255e18f35dc46f8a7acc18354c73d45149 git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-5.1/i2c-hid)
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/hid/i2c-hid/i2c-hid.c

index b235d2b38f39590884b9896410ffbbc523b49001..95d6e1c1d97695d9a20b5856eb606873e78c858d 100644 (file)
@@ -49,6 +49,7 @@
 #define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET       BIT(1)
 #define I2C_HID_QUIRK_RESEND_REPORT_DESCR      BIT(2)
 #define I2C_HID_QUIRK_NO_RUNTIME_PM            BIT(3)
+#define I2C_HID_QUIRK_BOGUS_IRQ                        BIT(4)
 
 /* flags */
 #define I2C_HID_STARTED                0
@@ -180,6 +181,8 @@ static const struct i2c_hid_quirks {
                I2C_HID_QUIRK_NO_RUNTIME_PM },
        { I2C_VENDOR_ID_GOODIX, I2C_DEVICE_ID_GOODIX_01F0,
                I2C_HID_QUIRK_NO_RUNTIME_PM },
+       { USB_VENDOR_ID_ELAN, HID_ANY_ID,
+                I2C_HID_QUIRK_BOGUS_IRQ },
        { 0, 0 }
 };
 
@@ -490,6 +493,12 @@ static void i2c_hid_get_input(struct i2c_hid *ihid)
                return;
        }
 
+       if (ihid->quirks & I2C_HID_QUIRK_BOGUS_IRQ && ret_size == 0xffff) {
+               dev_warn_once(&ihid->client->dev, "%s: IRQ triggered but "
+                             "there's no data\n", __func__);
+               return;
+       }
+
        if ((ret_size > size) || (ret_size < 2)) {
                dev_err(&ihid->client->dev, "%s: incomplete report (%d/%d)\n",
                        __func__, size, ret_size);