From patchwork Sat Nov 1 23:25:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 5210021 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 85794C11AC for ; Sat, 1 Nov 2014 23:26:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A279020117 for ; Sat, 1 Nov 2014 23:26:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C0D47200D5 for ; Sat, 1 Nov 2014 23:26:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751554AbaKAX0I (ORCPT ); Sat, 1 Nov 2014 19:26:08 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:44468 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750786AbaKAX0E (ORCPT ); Sat, 1 Nov 2014 19:26:04 -0400 Received: by mail-wi0-f169.google.com with SMTP id n3so3641499wiv.0 for ; Sat, 01 Nov 2014 16:26:02 -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:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=O390mupaWVXBr65tYNXrfthDCINOjwzX2EZGZ2OEhi4=; b=E6pZGBuKuo3Do2eUH0pm3lsKFbwhLVKCFbvs5UphooddfWWP93u+ZtIVVwuCobwhDz rQ+bLjlUWNeTV4XNGkVzo/KwswgRhKK3+ak+8RHlwc28zaSyT6nA2lCzWuUH6kdEMHCB y9t7l+1JslN7R3Yrq7J5H5Hl19MmylEYLdsG2Wvicuj9H33o86N8kbNHa9brzT2TFLWH IWqvD7yvb15GZ8nCubXm+QKMTQi1NqZHBoLJH7g6SaeOXb+XRpYTLuDneuMdBk5ZE9++ O9H2xpUtA2NsbFBxyfdv3FQYcR7i+ZDC34CkL5mafqHNSHIRJ7OznA5AhK2NuOyuk0Xy 3jqw== X-Received: by 10.180.149.208 with SMTP id uc16mr6179653wib.23.1414884362379; Sat, 01 Nov 2014 16:26:02 -0700 (PDT) Received: from Pali-Latitude.kolej.mff.cuni.cz (pali.kolej.mff.cuni.cz. [78.128.193.202]) by mx.google.com with ESMTPSA id ei1sm3315398wib.20.2014.11.01.16.25.57 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Nov 2014 16:26:01 -0700 (PDT) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Dmitry Torokhov , Hans de Goede , Yunkang Tang , Tommy Will Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH v3 2/4] input: alps: Allow 2 invalid packets without resetting device Date: Sun, 2 Nov 2014 00:25:08 +0100 Message-Id: <1414884310-19842-3-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1414884310-19842-1-git-send-email-pali.rohar@gmail.com> References: <1412329392-5580-1-git-send-email-pali.rohar@gmail.com> <1414884310-19842-1-git-send-email-pali.rohar@gmail.com> MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On some Dell Latitude laptops ALPS device or Dell EC send one invalid byte in 6 bytes ALPS packet. In this case psmouse driver enter out of sync state. It looks like that all other bytes in packets are valid and also device working properly. So there is no need to do full device reset, just need to wait for byte which match condition for first byte (start of packet). Because ALPS packets are bigger (6 or 8 bytes) default limit is small. This patch increase number of invalid bytes to size of 2 ALPS packets which psmouse driver can drop before do full reset. Resetting ALPS devices take some time and when doing reset on some Dell laptops touchpad, trackstick and also keyboard do not respond. So it is better to do it only if really necessary. Signed-off-by: Pali Rohár Tested-by: Pali Rohár Cc: stable@vger.kernel.org --- drivers/input/mouse/alps.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index a772745..7c47e97 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -2391,6 +2391,9 @@ int alps_init(struct psmouse *psmouse) /* We are having trouble resyncing ALPS touchpads so disable it for now */ psmouse->resync_time = 0; + /* Allow 2 invalid packets without resetting device */ + psmouse->resetafter = psmouse->pktsize * 2; + return 0; init_fail: