From patchwork Tue May 24 03:04:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 9132665 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6E98560761 for ; Tue, 24 May 2016 03:04:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62307281C1 for ; Tue, 24 May 2016 03:04:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56FA22824F; Tue, 24 May 2016 03:04:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D16EA281C1 for ; Tue, 24 May 2016 03:04:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753905AbcEXDEk (ORCPT ); Mon, 23 May 2016 23:04:40 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:36567 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751789AbcEXDEj (ORCPT ); Mon, 23 May 2016 23:04:39 -0400 Received: by mail-pa0-f67.google.com with SMTP id fg1so561316pad.3 for ; Mon, 23 May 2016 20:04:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=PZkQxFqJ4ooVTqDfnjFzgHcDiRCK3o3k6+dGJFpY48w=; b=OK+F70U+KCFk6svpNCgaql7VEsfirudRa2rU2RdXc+6oUTKJQBy1C94+Sb7LFZB2bS EB7EwSlBd3vBSntUT+ft+SAmD9kejc0uuasc1cPMHkoPOQpQ6Y59vEWfASEGMr9m7snZ 7BDAF7DcSg2TuX69Au2qPHcI2Nh4uRcbU9R6Q8HYWklI1tRypQA8/wE4oegpiAmorct2 YWIXDRd+S/Nw9o3fkqRG9S9JLHw6zzcuRH0XDPL/eXv/bq82IJ1CQ5igr49rMd4HdTnr kou9l4eVIdlH8GcBUhbKGvfqA5svevADUuI8QCOJj6kmDcDRsa6u0tTx7X8725ELbPJJ ao6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=PZkQxFqJ4ooVTqDfnjFzgHcDiRCK3o3k6+dGJFpY48w=; b=hviOFhq9nXNfFSrFnk1Pj2MEQaBK8qg4tdjVfh1mf8Z/0BdQKRRQdjAkmqfXNUryCg LSA1B8+d10pYNpEZOkoJo2AoKTDX4nGduqo6+EvUcHcHPl14PmPTrYKp+F5iwo4deKdr U6wZoj6Cv+RkPgqZqj0BA6J8ootKSGuehOFa2DrIi+ZR2EckTTF7e21tJwflR//7spMD N6LVbZnk8oyJJM7vdDSnuDTO5tBnTFnBDthmM5Ii/4ax+x9YsS+XY3JNZzqW/9jbbxdR nrcTAOKo2KgTNXxuynYxlZWJb91avZBmuqkSMJXNpgVyf9YrEcwKlUivc49SDtL7jOkO vJpg== X-Gm-Message-State: ALyK8tKWszRj5XJIlrdpuGxDILjefB+fmgwu4oXQgTAdf3SUUWH5X0cEJgdTyNJZ5UnmhA== X-Received: by 10.66.66.10 with SMTP id b10mr3248249pat.12.1464059078593; Mon, 23 May 2016 20:04:38 -0700 (PDT) Received: from localhost.net (c-24-21-228-48.hsd1.wa.comcast.net. [24.21.228.48]) by smtp.gmail.com with ESMTPSA id d184sm49761945pfc.27.2016.05.23.20.04.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 May 2016 20:04:38 -0700 (PDT) From: Ping Cheng X-Google-Original-From: Ping Cheng To: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com Cc: peter.hutterer@who-t.net, benjamin.tissoires@gmail.com, Ping Cheng Subject: [PATCH 2/2] Input: wacom_w8001 - Ignore invalid pen data packets Date: Mon, 23 May 2016 20:04:27 -0700 Message-Id: <1464059067-6244-1-git-send-email-pingc@wacom.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ThinkPad X60 Tablet PC (pen only device) sometime posts packets that are larger than W8001_PKTLEN_TPCPEN. Reported-by: Chris J Arges Tested-by: Chris J Arges Signed-off-by: Ping Cheng Reviewed-by: Peter Hutterer --- drivers/input/touchscreen/wacom_w8001.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c index b1b4127..d5dcda2 100644 --- a/drivers/input/touchscreen/wacom_w8001.c +++ b/drivers/input/touchscreen/wacom_w8001.c @@ -339,6 +339,15 @@ static irqreturn_t w8001_interrupt(struct serio *serio, w8001->idx = 0; parse_multi_touch(w8001); break; + + default: + /* + * ThinkPad X60 Tablet PC (pen only device) sometime sends + * invalid data packets that are larger than W8001_PKTLEN_TPCPEN. + * Let's start over again. + */ + if (!w8001->touch_dev && w8001->idx > W8001_PKTLEN_TPCPEN - 1) + w8001->idx = 0; } return IRQ_HANDLED;