Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4472471ybx; Mon, 4 Nov 2019 14:01:10 -0800 (PST) X-Google-Smtp-Source: APXvYqyOmVq9gxxYYYgMTn1bcmuQq2ks6d2r9U/FGbYrZZsgoTsxLMQ6lnuNXXar/LMb0A0s1oxL X-Received: by 2002:a17:906:d781:: with SMTP id pj1mr25886168ejb.98.1572904869864; Mon, 04 Nov 2019 14:01:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572904869; cv=none; d=google.com; s=arc-20160816; b=w/hVPLEPc0LRXBnl0O3CXyFDc8zp5h2QIKPz5MRAaySNkstEq1zuuN29Atrsrw1a5B sAJ1nV3oQaaZxY1ueEYan6wRV/o0OByht0Us66W+ryZwFnw1bFEHo/Wl3iRDKW9ZxHzg c/8kvKJWYL+ZJ+9ECttTDTZ91in/T4mBHIRFwMcsBYmiyUXWqRh9TaMvuFPYE8YLzspK YTWzJ65wSIYTCds60toLr0EVQG4PrMGE6ULMoibCsMNT3QwmygU5PW5TIsFaZaBJ7iIK Ir6LIJfzTsJpdcqO1mDZ5CmJzmER7lR0ucfT82Rgh2vFUCJl+rA+ieVCw3p3dObUoIdI jcBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hEaY5/ITxJ3dcoeq5+3e5UBjfPNMhtkZahigt+hznCQ=; b=UkeR8OAfOHwX2ivTBN8e6FoNKtsiueElApfLgEEALFiGZk4B5JKYPvjxQDT7WaNeYq JquPVy2jNCkyxs4MUuaS1xw2cm4E2G4aqSkj/iTyjcCyXQDTMkBddkILpOkkdGJ50DhJ 9juoRKdJshouCBURr1Qyi/DFW2sLJ92w/C7TDwBrgXK0Fdo+041X2YykcWhm4WJUI+ho IW4tL60tUWCpH9GjPf0sQlfAvMSKlSWI/Pa9TNOkMb7pV9WK8jD823zGfd3miLsncXYh sbT1FVYwRy9itROfbjF5ngCOzcM8GlSQE2B0nQ716u1B08ODVkA2slO8RGO2q32Q27iJ GN2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qRQNMlEJ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si8405662eda.406.2019.11.04.14.00.46; Mon, 04 Nov 2019 14:01:09 -0800 (PST) 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=@kernel.org header.s=default header.b=qRQNMlEJ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387943AbfKDV5t (ORCPT + 99 others); Mon, 4 Nov 2019 16:57:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:54154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388568AbfKDV5m (ORCPT ); Mon, 4 Nov 2019 16:57:42 -0500 Received: from localhost (6.204-14-84.ripe.coltfrance.com [84.14.204.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 57DA821744; Mon, 4 Nov 2019 21:57:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572904661; bh=pSHZH/4w3nOlLE17v+y+HwO+fJvTz+CXttg0x1Q+dhE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qRQNMlEJZBhsc7sh97DdkwpBozT93sfnGv3k12wpkkHVA4tUMtrJf8WZze7zhWf8L IWPdg9E6UwZrvu/F2siB2lmRoGX0uk0OpVcFzg+nN2v5H47WCkoQfaSHe21YJmPrah GpdTN9QOVYI9r3yWU+9uDxMycXHBn/vvT/T43YBs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kai-Heng Feng , Benjamin Tissoires , Sasha Levin Subject: [PATCH 4.19 025/149] HID: i2c-hid: Ignore input report if theres no data present on Elan touchpanels Date: Mon, 4 Nov 2019 22:43:38 +0100 Message-Id: <20191104212137.534015856@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212126.090054740@linuxfoundation.org> References: <20191104212126.090054740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kai-Heng Feng [ Upstream commit 1475af255e18f35dc46f8a7acc18354c73d45149 ] 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 Signed-off-by: Benjamin Tissoires Signed-off-by: Sasha Levin --- drivers/hid/i2c-hid/i2c-hid-core.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c index 8555ce7e737b3..2f940c1de6169 100644 --- a/drivers/hid/i2c-hid/i2c-hid-core.c +++ b/drivers/hid/i2c-hid/i2c-hid-core.c @@ -50,6 +50,7 @@ #define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1) #define I2C_HID_QUIRK_NO_RUNTIME_PM BIT(2) #define I2C_HID_QUIRK_DELAY_AFTER_SLEEP BIT(3) +#define I2C_HID_QUIRK_BOGUS_IRQ BIT(4) /* flags */ #define I2C_HID_STARTED 0 @@ -179,6 +180,8 @@ static const struct i2c_hid_quirks { I2C_HID_QUIRK_DELAY_AFTER_SLEEP }, { USB_VENDOR_ID_LG, I2C_DEVICE_ID_LG_8001, I2C_HID_QUIRK_NO_RUNTIME_PM }, + { USB_VENDOR_ID_ELAN, HID_ANY_ID, + I2C_HID_QUIRK_BOGUS_IRQ }, { 0, 0 } }; @@ -503,6 +506,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); -- 2.20.1