Received: by 10.223.176.5 with SMTP id f5csp3358049wra; Mon, 29 Jan 2018 12:08:58 -0800 (PST) X-Google-Smtp-Source: AH8x227NlaT+KB67UIjwtp1KD05te0pWyD/V2zQ79oTQPIGjw/VYyz0zI8XO15FByBOxRXCCxTM6 X-Received: by 10.98.171.7 with SMTP id p7mr28250853pff.138.1517256537974; Mon, 29 Jan 2018 12:08:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517256537; cv=none; d=google.com; s=arc-20160816; b=cXl5X1Zj+TAYo42/supiC/wXQ73fi/lTvkRf4j5SQQa3PWqFs3lf9jKmrgZ4MB4rdj midNmrP0IobbEFOqAUBiONIZ5MOCALyVkplwcb8Xd+AbGbRAAAWthdd0yzBKLsZinEhB KiFH8DsAIWP0YTMop8K/z/4XuMdMdnoSzEdsT8X2bitQbjNUikmB5rlpLas6Oljr0Lv6 g9M0bmx1XBmTSSgrBiHmZCwY9Ou8GHMVWiVELXHB/iQmfjbt+om5P/JoiU5ckNh9kc5b yaeE6RV9xy0wjZgSNUJJNaDWnvaqhVmTbqi69EuzbQON+eYqORxtucgvJpg+7/QlIAQc 30Ew== 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=uZDkMTNcbKcfWfg5sVPb5DwHHe1PxLj+NAEFm0VsB3c=; b=EBeZubvqzN7Z2RYThuR3+fqHKaA+i6VMO4fogmhgm8/aePEii5qYIeuJ/L1VbyroXw f41IAXit96uiL0sE8nVJ25LV1RyXjmJw8AQqO+O9/dzk2M1LnBkSjBaHaWWWCK+6lLhZ TQBLaV27bGVfJHZXf5ReicSK/FOrmHVGwvQg0VKkEvT+YauzJysRXD1LHxKSaDaj2hLM OJoT3vS0U6X5LmsXbplnf6snpIUhsy85WrrHJsP083uyNbIM6uGn3laqUDyqbLPdXk8C +mB/5gsclkq+0/MNJgYKd6mR2zS1S84CyB1Uel/nTM7QPkC9bkXLXZJw5vaeu3VnjurV yQ4A== 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 p12si284044pgd.256.2018.01.29.12.08.43; Mon, 29 Jan 2018 12:08:57 -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 S1753053AbeA2UIR (ORCPT + 99 others); Mon, 29 Jan 2018 15:08:17 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:52330 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753037AbeA2UIO (ORCPT ); Mon, 29 Jan 2018 15:08:14 -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 0E68A3005; Mon, 29 Jan 2018 13:09:09 +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.14 09/71] Input: trackpoint - force 3 buttons if 0 button is reported Date: Mon, 29 Jan 2018 13:56:37 +0100 Message-Id: <20180129123827.965342780@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180129123827.271171825@linuxfoundation.org> References: <20180129123827.271171825@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.14-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(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);