Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp64528img; Tue, 19 Mar 2019 15:49:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9T6eAzPRUN2yHy4aUhwfelXCl7eX/7Ed7MMxifBJfFWJut5ar3yKWDIYsZFaJjLCOlPB2 X-Received: by 2002:aa7:8102:: with SMTP id b2mr4316625pfi.69.1553035763744; Tue, 19 Mar 2019 15:49:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553035763; cv=none; d=google.com; s=arc-20160816; b=XAdyDD7p8ygh8QXa0EwLdDVGf/SutytnF7+K2iRmjrOxMeJKSp8bWlYWu2GsaeOoDS 0ja8yIIVqoCR5Mjq9ylXggqwgUZg4HLd1iQelRpLLPcATiCvwmS/fO4b9s3nXbSiqkpE 1eSc+iWWCDwDVZQg7hYBTd/y5Seogf5z09fYFoltGZGx3CgTxJEtMrBV8aUIy5Jn5Qum URftLxiv/0z8c9PEH7LEoDobKh1PrFZbOTdYY1VFSQEKlwrKk79WWpJzIApt0Mzc2410 luodsS0T2mm9jCb/FtLMHIC8UlTZ8HrAU0XTBtWEL4bD+pzh1wQ1igp1WULQQv38i/03 E5UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=8cJoxKnn8Sw9D7HK8T6WWot8f+suZDUi6lSQ+EboyaU=; b=Yt3QMiLE38ahfjMmZKjQt1qSmjlX8plvR6fZmr3mQgnZooj8MDraN6gq5JAhdwqcs7 GTg23mrvTCWER5dPYkD6lT3+iDFgDJ+JC8ifMhUXIpDk0rceIYapx6gMFuZYrd1pr7sD wpbz2EXDKxzzniW3no3G2bw6lWtc/qIPhOzvIgpCasB/0i2cy2EuSNIJnFR2jqbRT0mx QFKaV+Z8Lqac2iEFJ7jmfRvJTLvjB+nbGTvxI5JbFzjvtQd6I1pegGJ5GY0zHzCrAESp /Enk8IoAldufAo6JZNEDANTNAefbgwRV0wrtvwitExYOrri0YerElfCP3YHfifiUV/n+ q38g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@who-t.net header.s=fm2 header.b="vf7//+5r"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=tWyhRtCh; 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 v17si67837pgj.574.2019.03.19.15.49.05; Tue, 19 Mar 2019 15:49:23 -0700 (PDT) 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; dkim=pass header.i=@who-t.net header.s=fm2 header.b="vf7//+5r"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=tWyhRtCh; 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 S1726969AbfCSWs0 (ORCPT + 99 others); Tue, 19 Mar 2019 18:48:26 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:53235 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726823AbfCSWs0 (ORCPT ); Tue, 19 Mar 2019 18:48:26 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 0232922203; Tue, 19 Mar 2019 18:48:25 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 19 Mar 2019 18:48:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=who-t.net; h= date:from:to:cc:subject:message-id:mime-version:content-type :content-transfer-encoding; s=fm2; bh=8cJoxKnn8Sw9D7HK8T6WWot8f+ suZDUi6lSQ+EboyaU=; b=vf7//+5rtJkAVAat0LP2T692Dm2CmqOrnI75k18Nxq JSR8taS4NGgkpuKpsQP68eKApoYle63kQCDULOmeTEkaPa6r9PaJsqulDsg8hWwZ h20SfQrUF3xp/oszRvKTXuGa7oYqBCntr3qGcENNKaiVteq88s2PEu//NrG0SsMa L4SmkE0sX4BVT6/aVL3gU0XXEjN5Uu6KFTVKbo/soEGggv7a6VNKg/1iFcRLYz5X XK4sfB5AqMwcKuM8GhL78HPwhu1yXFmsCAd6cVeuYUQ7IIfemxjnskTvd76Y9Elr wtlFFWvC1IYKklvhZtOQtEgYOMaIl3HcGCu+jhHAlD8w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=8cJoxK nn8Sw9D7HK8T6WWot8f+suZDUi6lSQ+EboyaU=; b=tWyhRtChlhxtKIzpmPkHQh 2qgtdtpQYCAwOANwBN/oKsUC5Zbq7dtpLP8tQOpM0QV74u+CNrV9Nipneho4mV66 wHW1YpBHau2VeCNDzBVT9Oykllm3OfMYPsf5rmgCxl4pi5nlnTfhrMraRItCZJYB EZmuEb19Ak02Yc/x15MepcsiJyFsrdF0BNJxgrD37d1g3rlUCGvOcLMQ1SdiwJYx 9piw0UxVm9ffI/qKtxVTpo550zgHwnz4hrnJY39pct/Yh6X97SJATUyaNBvk2g6W oeSx0J70xCT1zRWHMWyO/jM045uU3mre+kydn01/eKqAylQ1zNagwo5zrHB1fp6g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrieehgddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgfgesthekredttderudenucfhrhhomheprfgvthgvrhcu jfhuthhtvghrvghruceophgvthgvrhdrhhhuthhtvghrvghrseifhhhoqdhtrdhnvghtqe enucfkphepudektddrudehtddrleefrddugedvnecurfgrrhgrmhepmhgrihhlfhhrohhm pehpvghtvghrrdhhuhhtthgvrhgvrhesfihhohdqthdrnhgvthenucevlhhushhtvghruf hiiigvpedt X-ME-Proxy: Received: from jelly (unknown [180.150.93.142]) by mail.messagingengine.com (Postfix) with ESMTPA id 252AAE49D6; Tue, 19 Mar 2019 18:48:21 -0400 (EDT) Date: Wed, 20 Mar 2019 08:48:23 +1000 From: Peter Hutterer To: linux-input@vger.kernel.org Cc: Benjamin Tissoires , Aimo =?iso-8859-1?Q?Mets=E4l=E4?= , nlopezcasad@logitech.com, Jiri Kosina , linux-kernel@vger.kernel.org Subject: [PATCH] HID: logitech: Handle 0 scroll events for the m560 Message-ID: <20190319224823.GA26366@jelly> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hidpp_scroll_counter_handle_scroll() doesn't expect a 0-value scroll event, it gets interpreted as a negative scroll direction event. This can cause scroll direction resets and thus broken scrolling. Reported-and-tested-by: Aimo Mets?l? Signed-off-by: Peter Hutterer --- drivers/hid/hid-logitech-hidpp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 15ed6177a7a3..f040c8a7f9a9 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c @@ -2608,8 +2608,9 @@ static int m560_raw_event(struct hid_device *hdev, u8 *data, int size) input_report_rel(mydata->input, REL_Y, v); v = hid_snto32(data[6], 8); - hidpp_scroll_counter_handle_scroll( - &hidpp->vertical_wheel_counter, v); + if (v != 0) + hidpp_scroll_counter_handle_scroll( + &hidpp->vertical_wheel_counter, v); input_sync(mydata->input); } -- 2.20.1