Received: by 10.213.65.68 with SMTP id h4csp2120661imn; Sun, 8 Apr 2018 20:12:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+bVZAIuBOTsNWUy1ysrF5GNvKbkPxVGnVEt2qndk81INeBmtyjJASiJKyTkwzYiVNGi8Fi X-Received: by 10.98.196.83 with SMTP id y80mr27940130pff.117.1523243485011; Sun, 08 Apr 2018 20:11:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243484; cv=none; d=google.com; s=arc-20160816; b=0V0Kkv+sICKcDeoRYZcw78uPexUa4NNxX/cIPFb0dKSNdGJky0z9XYqIFq07I7sYqZ 7g7QBWc/xTalSEGQFsTqKYBX/Z42UB/zjo/O7OrE3oj1LrVYVrVMNcLG1RZhDGNf74Gk x4OdrTWEK5CPPTVtHbWTLNBS/K5pMkTiKQ0YCQ/IeM/CKRUGkRYEzlWEaXpOuvIuFXOI n1y5uy6ktPgyfQ3F47TPz7LwH9aNfTEdoEryOdFVLi+4fI6z+jN4OkZ9fF/tUcPncLzF TrMoKiXj/h+5vrK72BQrkfebL48t/1xtQVQCpqmrpbbgOK3LZExPAgYbiWJ2R6RtOmjN 8acQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=GmkkIZED7+Txhd+pNgzj8/1OQWSNTc0z1hNIU6/Mmzs=; b=aL3WnBWabeb+2LCPGgcjjj9t2hi261bfOMrYmtOHSxzkzqeDTAib5Y2+Sl6GX+oHjI 0l0X3DX7PZJhkUPgIlW78MQ490HIF3YXi2/Dk0wKi1YYtPXSE+J//W54AIeUsl25j1yB LOL4O6asa4QpYGpka9bmc5BqT675wQS5XMaNCBUktT4PPELdwCtsYmoXPiZ5sSl71w44 jtYSpNq9EsYrxhfrA7nFG8S3cvYbKSbVffkVfdEk3sc9YVNZyNHchp80qW0k/Wr3KHVV BxLoWIMN8kp2y/4JfiGgQPBzQaivTdpek99AmiHy6PBOtZrxw910jZh7L9NQ8wl1a+97 OmQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=N1VxivUQ; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64-v6si5154695plk.239.2018.04.08.20.10.47; Sun, 08 Apr 2018 20:11:24 -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=@microsoft.com header.s=selector1 header.b=N1VxivUQ; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757978AbeDICRo (ORCPT + 99 others); Sun, 8 Apr 2018 22:17:44 -0400 Received: from mail-sn1nam02on0125.outbound.protection.outlook.com ([104.47.36.125]:10314 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755636AbeDIAa0 (ORCPT ); Sun, 8 Apr 2018 20:30:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GmkkIZED7+Txhd+pNgzj8/1OQWSNTc0z1hNIU6/Mmzs=; b=N1VxivUQ0Tc3A3zj172PJrc3k1DGnsMXKIgx0kSk+6OSk+fobr4oZ46AxAo6PHbdaX4PrTkpnhLc93CgOFWoipXwH8hLIL7wH1rQGBNS9FK8NBKK8ysTIPKISQVefrWZQeORA6B8m0l5w6o5Vk2BVNjwyg2bhcviGaX8F3c+GE8= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:30:21 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:30:21 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Andrew Duggan , Dmitry Torokhov , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 131/293] Input: synaptics-rmi4 - only read the F54 query registers which are used Thread-Topic: [PATCH AUTOSEL for 4.9 131/293] Input: synaptics-rmi4 - only read the F54 query registers which are used Thread-Index: AQHTz5kj/6FgNmfi202waZj38s+tug== Date: Mon, 9 Apr 2018 00:24:35 +0000 Message-ID: <20180409002239.163177-131-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1032;7:WLg2orJLMrX/5yUdMjI4pfzzx3YwGz+/nP3HVlBnfIdSQMMC+F4BdDKwQIJYwfBHXHsutlojrYKNtB1kg+mbhzpWsgZMzLUk77LdykIvGFBt2CfP5ixBr7vrCaaXWWmPJq+qL5864eI75cX5om6So2de7GewMjxMkEB/hEKRioxFVvxU5xYOSMR3pG5DfcEJr3FYGm2IxE0uvxCxi/AAYNZ/i1A1HOVDtvD7V6pc74FiPxop9lC9axNlUnzEc9FB;20:NDZ7YRcfFjpXrLVVCcJz8skIC5gtTd/O7hAx+xLUUtnW0KxMkrmze/xv2k78qH4lRw375BvK6/2fzzHBG34th6ffHE7y+0CG9Z14ppzuUtqnlSAfdQu2UR8Ufsw6Lfm5TAJEVFzi3Nt3ITfJq+8pS+49RsYGYp0QHGIX3e47ShM= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 727e1f45-8bc8-4d81-0761-08d59db113db x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1032; x-ms-traffictypediagnostic: DM5PR2101MB1032: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(20558992708506)(89211679590171)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231221)(944501327)(52105095)(10201501046)(93006095)(93001095)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB1032;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1032; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(346002)(396003)(39860400002)(376002)(366004)(189003)(199004)(5660300001)(76176011)(99286004)(10090500001)(2900100001)(105586002)(305945005)(7736002)(107886003)(2501003)(5250100002)(14454004)(53936002)(4326008)(8936002)(68736007)(25786009)(86612001)(3846002)(66066001)(1076002)(486006)(316002)(72206003)(22452003)(106356001)(186003)(97736004)(6436002)(6116002)(476003)(2616005)(39060400002)(478600001)(6486002)(10290500003)(2906002)(110136005)(54906003)(6512007)(81156014)(81166006)(8676002)(36756003)(966005)(11346002)(3660700001)(446003)(6666003)(86362001)(26005)(6306002)(102836004)(575784001)(3280700002)(6506007)(59450400001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1032;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 4lWreWEdvx5bTu6WXctF07s4RK4d4Mol6LkpCf+d1zGVtE776mE8BfAHkzWF+2QzxiOTVuaHjB7YQw5PqV4Hra779zrmZR76byX3IvCZD67hq8wmsHyKf3IhyBPaDreiJC7FUd7AuYkoDEdQqOiYuW98iqK86l+rYAhzc4x/c+Zwtq1xzWeGNWKo+26zUSHt9iZlefOe6FVpjwmmt7WiEcvf3vbE/0zsxLTrDzdyiesM7t5+b/mlB2LSdEjKt6FaTQRjvgpEqGpQMzrXuJqbnSRaEYtWeWgA1wm5ftKE3XAg/62vsEAVlcSBt23MV5aq1Vmf44MPrsBg1TwP2+fRBLVMVwh2rkuBryEEcKmPbjGGWcpL8FMDBxVWGrf1aMhP1PA95NT9CPQd/s+WStnyh2PLobQtSbU7OeLKaTgnlAk= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 727e1f45-8bc8-4d81-0761-08d59db113db X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:24:35.0813 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1032 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrew Duggan [ Upstream commit 9768935264c4f0e4afd788a185d8e8d89c28e41d ] The F54 driver is currently only using the first 6 bytes of F54 so there is no need to read all 27 bytes. Some Dell systems (Dell XP13 9333 and similar) have an issue with the touchpad or I2C bus when reading reports larger then 16 bytes. Reads larger then 16 bytes are reported in two HID reports. Something about the back to back reports seems to cause the next read to report incorrect data. This results in F30 failing to load and the click button failing to work. Previous issues with the I2C controller or touchpad were addressed in: commit 5b65c2a02966 ("HID: rmi: check sanity of the incoming report") Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=3D195949 Signed-off-by: Andrew Duggan Reviewed-by: Benjamin Tissoires Reviewed-by: Nick Dyer Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/rmi4/rmi_f54.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/input/rmi4/rmi_f54.c b/drivers/input/rmi4/rmi_f54.c index 2e934aef3d2a..813bef40aab6 100644 --- a/drivers/input/rmi4/rmi_f54.c +++ b/drivers/input/rmi4/rmi_f54.c @@ -31,9 +31,6 @@ #define F54_GET_REPORT 1 #define F54_FORCE_CAL 2 =20 -/* Fixed sizes of reports */ -#define F54_QUERY_LEN 27 - /* F54 capabilities */ #define F54_CAP_BASELINE (1 << 2) #define F54_CAP_IMAGE8 (1 << 3) @@ -95,7 +92,6 @@ struct rmi_f54_reports { struct f54_data { struct rmi_function *fn; =20 - u8 qry[F54_QUERY_LEN]; u8 num_rx_electrodes; u8 num_tx_electrodes; u8 capabilities; @@ -626,22 +622,23 @@ static int rmi_f54_detect(struct rmi_function *fn) { int error; struct f54_data *f54; + u8 buf[6]; =20 f54 =3D dev_get_drvdata(&fn->dev); =20 error =3D rmi_read_block(fn->rmi_dev, fn->fd.query_base_addr, - &f54->qry, sizeof(f54->qry)); + buf, sizeof(buf)); if (error) { dev_err(&fn->dev, "%s: Failed to query F54 properties\n", __func__); return error; } =20 - f54->num_rx_electrodes =3D f54->qry[0]; - f54->num_tx_electrodes =3D f54->qry[1]; - f54->capabilities =3D f54->qry[2]; - f54->clock_rate =3D f54->qry[3] | (f54->qry[4] << 8); - f54->family =3D f54->qry[5]; + f54->num_rx_electrodes =3D buf[0]; + f54->num_tx_electrodes =3D buf[1]; + f54->capabilities =3D buf[2]; + f54->clock_rate =3D buf[3] | (buf[4] << 8); + f54->family =3D buf[5]; =20 rmi_dbg(RMI_DEBUG_FN, &fn->dev, "F54 num_rx_electrodes: %d\n", f54->num_rx_electrodes); --=20 2.15.1