Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7365388ybi; Wed, 5 Jun 2019 16:27:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpY20at3QOPSiC2bC5nA0W+0VKxRgDTgA8qfwX58MyonKmhsh/ZK1CIyaX6qPPebzgX1Nc X-Received: by 2002:a63:d4c:: with SMTP id 12mr405977pgn.30.1559777248031; Wed, 05 Jun 2019 16:27:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559777248; cv=none; d=google.com; s=arc-20160816; b=HNgPlrFwwRWYN8utmVbica9Ppb46oxyqej22yuaHrmXYYZfIiISWJVCg81ZO0aplMp 3eOJzhYNXPxw2xSW1pp55TL9fmmnydRLIprom1CnUxjluzc8LWqm7BVFTKSjFpZ0Xigl 4IPpHrkPI0CkgOumGsGsRnIid4vyA1vYyihKchnCd1Vinezicjh9c2OJ/8U6VflB0q9L 6DQY+x8E/jYcHINfFcc3voVk1nK1M9+rDsBAqpaFi7Ud3cjtv479lqADHDUZbot0FvEw hioaJIWzRnftLWATRcX8W0dYNLZvefX1tOU9JU1yOrs+N5oeXwjvVsd3ZLSfWujVSrss EqYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+WWUao+0KYKJX7/eCyyrGifWT6Z32ta9Z0LQFgrFodk=; b=yJ+ZU1TViYbC1v0JZb5Qce/yssX+WeSPmorEUdgBSC+/6tw9t1DKwAW6MQddrfYMja Nl4DxEl8Fv5HVbDAxpIU3SFsBmuB+aV+1KunYluEV4ZVk8YfG72UFq4VUH93Q/LMjij6 lqVWLhIHhoTAs8PdT0nSQu/MO1QXDwK8vuyc+ixOQb3IplstgdtG1ZsV6VkIQMRFueDO 8HoTSuypyLvdMrq8+ZrrblBn90NoMfj7DYD3r4b6FhkEz07TYY7iw1QcUIRbE+XfXXiH QJ27KZtj+hh/nqQka91R7/eeyV1Q7U9Pae6+LAbkYpQWgMtKPTCicorWqRwLqWD1rAl7 vJ0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="sPrd/xgn"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d21si187010pjr.17.2019.06.05.16.27.10; Wed, 05 Jun 2019 16:27:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="sPrd/xgn"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726818AbfFEXZ2 (ORCPT + 99 others); Wed, 5 Jun 2019 19:25:28 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:56226 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726603AbfFEXZ2 (ORCPT ); Wed, 5 Jun 2019 19:25:28 -0400 Received: by mail-it1-f194.google.com with SMTP id i21so267646ita.5; Wed, 05 Jun 2019 16:25:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+WWUao+0KYKJX7/eCyyrGifWT6Z32ta9Z0LQFgrFodk=; b=sPrd/xgnfWj8aOIB6h6viaBvaeccIwX4YNlrf2bwLiCoBmGVbA9nKJG5+UCyALqqiz nFlZNWmPqfL1yyJwRWeZ7yLRTytcqNDRn8nb11oLYfXVVCoHHqTxxs5Qj/AaIsw9BwAJ XIvCCUhyKGADDjVS60sEt5Hw0G0fegqPJh7Ke2CheWlPbTBOP74gSQD/3iIR6P2kuu3M UKSN3S4PYkKuk8s9mROHVMM3hDVgR1Q7OE3Kc998hiKqwMSFyRrKGNA/qJl8Vozs3JsU YMNuX9sQdAWdg+q3XURtApz1N85A7oPP34f8tOUXZa+gCZDTDx/8utlP7TspmDAW8EhG huQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+WWUao+0KYKJX7/eCyyrGifWT6Z32ta9Z0LQFgrFodk=; b=lJBVdJUgAx5bUlhu0BAPnNrqTLS6lxikZyMbE90+uPnpPldjFz5HHDtoDTjsfRdfv7 G60IhzO1WlJP56FD2/tyu/OE8dPU+ExPDobt8ZNdM0YlSfTAcEmG/XNrT5ssAhfbUNWo kpko7deGJOI0m+Kt39noC03uZICEY2tgM8YIUk6aQtqZ0o6FS1PuglpFpUK9kKWWQL7r msPH0yvFnxUUDvhSRgV8gqvCWC2Y1OMcR/APNXTk/weXIJNwVnm3A48BLqW6BzEnDEwF U3ip9FNqMkaWnWPTOpp4I26KUnqVCURHNm9WbdCNmfg9pTfoneFU9O4lsHLK6JwtTWUm MqLA== X-Gm-Message-State: APjAAAXVp6pdtb81Tw9oYioCXSsb8j5bvEYx71Wrq6hp3I3teR007MXs 9+9gxpNe1YdR0kkUmxDBHrND7GPp5KDq3roSllk= X-Received: by 2002:a24:6c4a:: with SMTP id w71mr29571756itb.128.1559777127054; Wed, 05 Jun 2019 16:25:27 -0700 (PDT) MIME-Version: 1.0 References: <20190423160543.9922-1-jeffrey.l.hugo@gmail.com> <20190423160605.9970-1-jeffrey.l.hugo@gmail.com> <20190521164324.GA2085@tuxbook-pro> In-Reply-To: <20190521164324.GA2085@tuxbook-pro> From: Jeffrey Hugo Date: Wed, 5 Jun 2019 17:25:15 -0600 Message-ID: Subject: Re: [PATCH v4 1/2] HID: quirks: Refactor ELAN 400 and 401 handling To: Bjorn Andersson Cc: Dmitry Torokhov , Jiri Kosina , Benjamin Tissoires , Lee Jones , Rob Herring , Mark Rutland , Andy Gross , David Brown , Hans de Goede , "open list:HID CORE LAYER" , devicetree@vger.kernel.org, MSM , lkml Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 21, 2019 at 10:42 AM Bjorn Andersson wrote: > > On Tue 23 Apr 09:06 PDT 2019, Jeffrey Hugo wrote: > > > There needs to be coordination between hid-quirks and the elan_i2c driver > > about which devices are handled by what drivers. Currently, both use > > whitelists, which results in valid devices being unhandled by default, > > when they should not be rejected by hid-quirks. This is quickly becoming > > an issue. > > > > Since elan_i2c has a maintained whitelist of what devices it will handle, > > use that to implement a blacklist in hid-quirks so that only the devices > > that need to be handled by elan_i2c get rejected by hid-quirks, and > > everything else is handled by default. The downside is the whitelist and > > blacklist need to be kept in sync. > > > > Reviewed-by: Bjorn Andersson > > Jiri, the two patches in this series doesn't have a build time > dependency, so if you take this one through your tree I'll take 2/2 > through arm-soc. Ping? Is this good from the HID perspective? I would really like to see this queued for 5.3. > > Regards, > Bjorn > > > Suggested-by: Benjamin Tissoires > > Signed-off-by: Jeffrey Hugo > > --- > > drivers/hid/hid-quirks.c | 64 ++++++++++++++++++++++++----- > > drivers/input/mouse/elan_i2c_core.c | 4 ++ > > 2 files changed, 58 insertions(+), 10 deletions(-) > > > > diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c > > index 77ffba48cc73..656485e08eb7 100644 > > --- a/drivers/hid/hid-quirks.c > > +++ b/drivers/hid/hid-quirks.c > > @@ -987,17 +987,61 @@ bool hid_ignore(struct hid_device *hdev) > > break; > > case USB_VENDOR_ID_ELAN: > > /* > > - * Many Elan devices have a product id of 0x0401 and are handled > > - * by the elan_i2c input driver. But the ACPI HID ELAN0800 dev > > - * is not (and cannot be) handled by that driver -> > > - * Ignore all 0x0401 devs except for the ELAN0800 dev. > > + * Blacklist of everything that gets handled by the elan_i2c > > + * input driver. This should be kept in sync with the whitelist > > + * that exists in that driver. This avoids disabling valid > > + * touchpads and other ELAN devices. > > */ > > - if (hdev->product == 0x0401 && > > - strncmp(hdev->name, "ELAN0800", 8) != 0) > > - return true; > > - /* Same with product id 0x0400 */ > > - if (hdev->product == 0x0400 && > > - strncmp(hdev->name, "QTEC0001", 8) != 0) > > + if ((hdev->product == 0x0401 || hdev->product == 0x0400) && > > + (strncmp(hdev->name, "ELAN0000", 8) == 0 || > > + strncmp(hdev->name, "ELAN0100", 8) == 0 || > > + strncmp(hdev->name, "ELAN0600", 8) == 0 || > > + strncmp(hdev->name, "ELAN0601", 8) == 0 || > > + strncmp(hdev->name, "ELAN0602", 8) == 0 || > > + strncmp(hdev->name, "ELAN0603", 8) == 0 || > > + strncmp(hdev->name, "ELAN0604", 8) == 0 || > > + strncmp(hdev->name, "ELAN0605", 8) == 0 || > > + strncmp(hdev->name, "ELAN0606", 8) == 0 || > > + strncmp(hdev->name, "ELAN0607", 8) == 0 || > > + strncmp(hdev->name, "ELAN0608", 8) == 0 || > > + strncmp(hdev->name, "ELAN0609", 8) == 0 || > > + strncmp(hdev->name, "ELAN060B", 8) == 0 || > > + strncmp(hdev->name, "ELAN060C", 8) == 0 || > > + strncmp(hdev->name, "ELAN060F", 8) == 0 || > > + strncmp(hdev->name, "ELAN0610", 8) == 0 || > > + strncmp(hdev->name, "ELAN0611", 8) == 0 || > > + strncmp(hdev->name, "ELAN0612", 8) == 0 || > > + strncmp(hdev->name, "ELAN0613", 8) == 0 || > > + strncmp(hdev->name, "ELAN0614", 8) == 0 || > > + strncmp(hdev->name, "ELAN0615", 8) == 0 || > > + strncmp(hdev->name, "ELAN0616", 8) == 0 || > > + strncmp(hdev->name, "ELAN0617", 8) == 0 || > > + strncmp(hdev->name, "ELAN0618", 8) == 0 || > > + strncmp(hdev->name, "ELAN0619", 8) == 0 || > > + strncmp(hdev->name, "ELAN061A", 8) == 0 || > > + strncmp(hdev->name, "ELAN061B", 8) == 0 || > > + strncmp(hdev->name, "ELAN061C", 8) == 0 || > > + strncmp(hdev->name, "ELAN061D", 8) == 0 || > > + strncmp(hdev->name, "ELAN061E", 8) == 0 || > > + strncmp(hdev->name, "ELAN061F", 8) == 0 || > > + strncmp(hdev->name, "ELAN0620", 8) == 0 || > > + strncmp(hdev->name, "ELAN0621", 8) == 0 || > > + strncmp(hdev->name, "ELAN0622", 8) == 0 || > > + strncmp(hdev->name, "ELAN0623", 8) == 0 || > > + strncmp(hdev->name, "ELAN0624", 8) == 0 || > > + strncmp(hdev->name, "ELAN0625", 8) == 0 || > > + strncmp(hdev->name, "ELAN0626", 8) == 0 || > > + strncmp(hdev->name, "ELAN0627", 8) == 0 || > > + strncmp(hdev->name, "ELAN0628", 8) == 0 || > > + strncmp(hdev->name, "ELAN0629", 8) == 0 || > > + strncmp(hdev->name, "ELAN062A", 8) == 0 || > > + strncmp(hdev->name, "ELAN062B", 8) == 0 || > > + strncmp(hdev->name, "ELAN062C", 8) == 0 || > > + strncmp(hdev->name, "ELAN062D", 8) == 0 || > > + strncmp(hdev->name, "ELAN0631", 8) == 0 || > > + strncmp(hdev->name, "ELAN0632", 8) == 0 || > > + strncmp(hdev->name, "ELAN1000", 8) == 0 || > > + strncmp(hdev->name, "elan,ekth3000", 13) == 0)) > > return true; > > break; > > } > > diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c > > index f9525d6f0bfe..3ded19528cd4 100644 > > --- a/drivers/input/mouse/elan_i2c_core.c > > +++ b/drivers/input/mouse/elan_i2c_core.c > > @@ -1332,6 +1332,10 @@ static const struct i2c_device_id elan_id[] = { > > }; > > MODULE_DEVICE_TABLE(i2c, elan_id); > > > > +/* > > + * when these whtielists get updated, the corresponding blacklist in hid-quirks > > + * needs to be updated to match. > > + */ > > #ifdef CONFIG_ACPI > > static const struct acpi_device_id elan_acpi_id[] = { > > { "ELAN0000", 0 }, > > -- > > 2.17.1 > >