From patchwork Sun Nov 29 05:13:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 7717991 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 155389F3CD for ; Sun, 29 Nov 2015 05:16:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4B6E22055B for ; Sun, 29 Nov 2015 05:16:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D7222055A for ; Sun, 29 Nov 2015 05:16:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751621AbbK2FOw (ORCPT ); Sun, 29 Nov 2015 00:14:52 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:34055 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751069AbbK2FOG (ORCPT ); Sun, 29 Nov 2015 00:14:06 -0500 Received: by padhx2 with SMTP id hx2so150268594pad.1; Sat, 28 Nov 2015 21:14:05 -0800 (PST) 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; bh=CwuxOatZ5PwBoW4ZRdIX0wgf26UQmcQXs6XlvdJDR7c=; b=IUmTgZsh8ZYzmyKr0hA4D9F/PoJ+BxZMxYbisWIWKRsoSaFni+FLEBUFgUySZ2i9m3 oQkx+uta0i95bEdhF93jJJyjNxSWh1ZmCq3vYOTJymja0htUgfJdfHHQczKM1IweNpmV Glc7EJR0yg80ajsCvr9WYYEA6FwYEC86msbjPTZrfD7iK8bb1J45CW70f49AzO5sHJu7 0iifFVuJEw0UKnCUeyd+ve3k3XTGWTBpJp4xU2DSKLIfClWHqBh2eJONyFYYuDHj/w5Z vUBz7uHaRrbrsqI+erNP/c53DDMBrZB4ei4RrvM/zB1WHW/0RoB3t/qG1VV/Yanb0csx JpzQ== X-Received: by 10.66.154.161 with SMTP id vp1mr35419861pab.25.1448774045635; Sat, 28 Nov 2015 21:14:05 -0800 (PST) Received: from dtor-ws.mtv.corp.google.com ([172.22.64.149]) by smtp.gmail.com with ESMTPSA id pb9sm43616340pac.38.2015.11.28.21.14.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 28 Nov 2015 21:14:04 -0800 (PST) From: Dmitry Torokhov To: linux-input@vger.kernel.org Cc: Hans de Goede , Benjamin Tissoires , Thomas Hellstrom , pali.rohar@gmail.com, jckeerthan@gmail.com, till2.schaefer@uni-dortmund.de, linux-kernel@vger.kernel.org Subject: [PATCH 6/6] Input: psmouse - limit protocols that we try on passthrough ports Date: Sat, 28 Nov 2015 21:13:56 -0800 Message-Id: <1448774036-39040-7-git-send-email-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.6.0.rc2.230.g3dd15c0 In-Reply-To: <1448774036-39040-1-git-send-email-dmitry.torokhov@gmail.com> References: <1448774036-39040-1-git-send-email-dmitry.torokhov@gmail.com> 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=unavailable 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 PS/2 protocol is slow, and using it with pass-through port (where we encapsulate PS/2 into PS/2) is slower yet so it takes quite a bit of time to do full protocol discovery for device attached to a pass-through port. However, so far we have not see anything but trackpoints or basic PS/2 mice on pass-through ports, so let's limit protocols that we probe there to Trackpoint, IntelliMouse Explorer, IntelliMouse, and bare PS/2 protocol, and avoid other extended protocols, such as Synaptics, ALPS, etc. Signed-off-by: Dmitry Torokhov Reviewed-by: Hans de Goede Reviewed-by: Pali Rohár --- drivers/input/mouse/psmouse-base.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index ee59b0e..e909c6e 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -119,6 +119,7 @@ struct psmouse_protocol { enum psmouse_type type; bool maxproto; bool ignore_parity; /* Protocol should ignore parity errors from KBC */ + bool try_passthru; /* Try protocol also on passthrough ports */ const char *name; const char *alias; int (*detect)(struct psmouse *, bool); @@ -691,6 +692,7 @@ static const struct psmouse_protocol psmouse_protocols[] = { .maxproto = true, .ignore_parity = true, .detect = ps2bare_detect, + .try_passthru = true, }, #ifdef CONFIG_MOUSE_PS2_LOGIPS2PP { @@ -728,6 +730,7 @@ static const struct psmouse_protocol psmouse_protocols[] = { .maxproto = true, .ignore_parity = true, .detect = intellimouse_detect, + .try_passthru = true, }, { .type = PSMOUSE_IMEX, @@ -736,6 +739,7 @@ static const struct psmouse_protocol psmouse_protocols[] = { .maxproto = true, .ignore_parity = true, .detect = im_explorer_detect, + .try_passthru = true, }, #ifdef CONFIG_MOUSE_PS2_SYNAPTICS { @@ -777,6 +781,7 @@ static const struct psmouse_protocol psmouse_protocols[] = { .name = "TPPS/2", .alias = "trackpoint", .detect = trackpoint_detect, + .try_passthru = true, }, #endif #ifdef CONFIG_MOUSE_PS2_TOUCHKIT @@ -933,6 +938,11 @@ static bool psmouse_try_protocol(struct psmouse *psmouse, if (!proto) return false; + if (psmouse->ps2dev.serio->id.type == SERIO_PS_PSTHRU && + !proto->try_passthru) { + return false; + } + if (set_properties) psmouse_apply_defaults(psmouse);