From patchwork Fri Oct 3 09:43:12 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: 5021701 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 98057C11AB for ; Fri, 3 Oct 2014 09:44:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BECE1201FE for ; Fri, 3 Oct 2014 09:44:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C8C21201F5 for ; Fri, 3 Oct 2014 09:44:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752138AbaJCJns (ORCPT ); Fri, 3 Oct 2014 05:43:48 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:44469 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752088AbaJCJnq (ORCPT ); Fri, 3 Oct 2014 05:43:46 -0400 Received: by mail-wi0-f173.google.com with SMTP id fb4so2196917wid.0 for ; Fri, 03 Oct 2014 02:43:45 -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=UzMmlvahNR22ptUK2oGqO5Pq6TW6d3TOli/88NJZ3Co=; b=DCOcaKgCUr6i8p3WMy7HEf9g4wCizswynUrdQg9NvG0yPGDlPWQrXpolv0GjKd7uqQ yue+u1f38Wka9KSPcWJ4IzayGH4m+It7SjdnUGGZW70t1Y0RY+AewZQsClPJXvtTIYll F7tN5AxK3DEZuHlhL7uUmEFzpEr7i78uAcZMCdKa0C9Vuz9vuMBaYM4tlX5MoDiFMZB9 YajgQfFTS/YBwpYEXYJUsz4c5JvaIXKNyOji+cetYokDqkHKPVTH0/uvfDr+5HFLxN3G 4wQKCh+fPQ44uSyMoMh3BBQRW87PmsLR4tMzOV2vMn/Ccc/ndIfF82Xo/7CiVyT/cFyN 10PQ== X-Received: by 10.194.236.132 with SMTP id uu4mr5940301wjc.108.1412329425073; Fri, 03 Oct 2014 02:43:45 -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 k2sm7389416wjy.34.2014.10.03.02.43.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 03 Oct 2014 02:43:44 -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 3/3] input: alps: Reset mouse and ALPS driver immediately after first invalid packet Date: Fri, 3 Oct 2014 11:43:12 +0200 Message-Id: <1412329392-5580-4-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1412329392-5580-1-git-send-email-pali.rohar@gmail.com> References: <1412329392-5580-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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 For unknown reasons linux psmouse alps driver sometimes receive totally invalid packet sequences on Dell Latitude laptops. According to ALPS HW engineers these invalid packets do not come from ALPS devices. So it looks like bug in BIOS and EC incorrectly split keyboard and touchpad PS/2 data when laptops are under heavy loads (big I/O together with powersave governor, running on battery). There are sequences of invalid packets (which are dropeed) and some sequences which look like valid. But these valid packets cause random trackstick button pressing, random cursor moving/jumping and in these condition it is not possible to use ALPS device (trackstick+touchpad). To prevent random button press and random cursor jumps immediately reset ALPS device after first invalid packet. This will cause that touchpad and trackstick will not respond for one or two seconds and it better then random cursor jumps. Signed-off-by: Pali Rohár Tested-by: Pali Rohár Acked-by: Hans de Goede --- drivers/input/mouse/alps.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index b1f44d4..d2b144f 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -2399,6 +2399,10 @@ int alps_init(struct psmouse *psmouse) /* We are having trouble resyncing ALPS touchpads so disable it for now */ psmouse->resync_time = 0; + /* Reset immediately after bad packet. When bad packet arrives then + cursor pointer jumps and trackstick buttons are randomly pressed. */ + psmouse->resetafter = 1; + return 0; init_fail: