Received: by 10.223.176.5 with SMTP id f5csp3372593wra; Mon, 29 Jan 2018 12:17:04 -0800 (PST) X-Google-Smtp-Source: AH8x227A17F2G4V5uQyOsOSD8HcEC2VtG4odXlwEALanSb4zNaj/59qAzXk5Md09pl99RnoI0cNX X-Received: by 10.98.158.89 with SMTP id s86mr28167179pfd.203.1517257024545; Mon, 29 Jan 2018 12:17:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517257024; cv=none; d=google.com; s=arc-20160816; b=wGBLpZxa6OrT/++MkGaIGcQK4bKkH0CEOpxUXgf3WK9abZzUXZWu8GYD1Xaiy0wiuC qwCtALyiGbFuLMbcoE93aVKHjSXYspp0ZvJ4e1/jejn2UqyZ2ywaFlugga4k9OR9aL3x EzSJsT0MjPfbWVa6GhqCgJuSpnneP3/Df2QLW61Y9ZMpJjsxEQwT1VNHOQVr11ismVGG BZXXHklUj0hN3ILH1uKZihwIlN7PC4JeMnVG/XiSU7mM6kikridXTvEC2XZF+L5P2GTC pbArxOTlhTpgSFOSO/Y8XBDMTwMoxCkaGlp7yk7nn1og8fE8mrjJXAsujEc+aqA3e854 0njQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=DCb6LUnLADPSv9NZc1T4wOWUKH1FpUwQ+VUOQmd+v4M=; b=vV3Dr0WAKELZUC/lnAqIH/FMjIxXxtWLji8yXe1vShT6m0aarubg0ItvCzDAmzD29Y 6ew21qW9RgDQcd6I9zLnzpJtXrQDkBNbQjdFUiLm0H7mWYGPp/Vx7KQxs2OnEi4XCrDY /TEbMRiSTphdOay9YDQBo0KgeEqr9o5YwP0Yz7+rIsC3pm8FAFMAWr4rSc5TM27g5+EH HPVzIydV7I3/nvvKxbCrys/c+OrSQ+L5Wrgn0Gz3ukCJhPFClgfsU6+MhGIzHsjbhj10 bNZDn1MZbRCmf5J2PsoDSpVhl3e5U/ElzeVkLsmNYEBiqUGRSdzqIgwGBcfxNwS6NwTY eIzQ== ARC-Authentication-Results: i=1; mx.google.com; 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 k10si7972083pgs.499.2018.01.29.12.16.49; Mon, 29 Jan 2018 12:17:04 -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; 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 S1754537AbeA2UQZ (ORCPT + 99 others); Mon, 29 Jan 2018 15:16:25 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44042 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754429AbeA2UQP (ORCPT ); Mon, 29 Jan 2018 15:16:15 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4AD362F7F; Mon, 29 Jan 2018 13:05:19 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aaron Ma , Dmitry Torokhov Subject: [PATCH 4.9 28/66] Input: trackpoint - force 3 buttons if 0 button is reported Date: Mon, 29 Jan 2018 13:56:52 +0100 Message-Id: <20180129123841.302742004@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180129123839.842860149@linuxfoundation.org> References: <20180129123839.842860149@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Aaron Ma commit f5d07b9e98022d50720e38aa936fc11c67868ece upstream. Lenovo introduced trackpoint compatible sticks with minimum PS/2 commands. They supposed to reply with 0x02, 0x03, or 0x04 in response to the "Read Extended ID" command, so we would know not to try certain extended commands. Unfortunately even some trackpoints reporting the original IBM version (0x01 firmware 0x0e) now respond with incorrect data to the "Get Extended Buttons" command: thinkpad_acpi: ThinkPad BIOS R0DET87W (1.87 ), EC unknown thinkpad_acpi: Lenovo ThinkPad E470, model 20H1004SGE psmouse serio2: trackpoint: IBM TrackPoint firmware: 0x0e, buttons: 0/0 Since there are no trackpoints without buttons, let's assume the trackpoint has 3 buttons when we get 0 response to the extended buttons query. Signed-off-by: Aaron Ma Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=196253 Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/trackpoint.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/input/mouse/trackpoint.c +++ b/drivers/input/mouse/trackpoint.c @@ -383,6 +383,9 @@ int trackpoint_detect(struct psmouse *ps if (trackpoint_read(&psmouse->ps2dev, TP_EXT_BTN, &button_info)) { psmouse_warn(psmouse, "failed to get extended button data, assuming 3 buttons\n"); button_info = 0x33; + } else if (!button_info) { + psmouse_warn(psmouse, "got 0 in extended button data, assuming 3 buttons\n"); + button_info = 0x33; } psmouse->private = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL);