Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp618901img; Wed, 20 Mar 2019 07:31:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpFIgt2J6pN4XASE5KUZBAHVF6WOs2THVUoXN7zadi3UIOOsxXZ6lZVMdez8cpFDuoXdD8 X-Received: by 2002:a63:fd12:: with SMTP id d18mr27896685pgh.88.1553092265970; Wed, 20 Mar 2019 07:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553092265; cv=none; d=google.com; s=arc-20160816; b=Wnc+HiV9hOvj9UM8siK/GQApwZYUvFk3PJV9SSUzuXXUlvc1s+fzracINoF1gaRvqX ZFzb5ob3KkUM9PSTKZ5rMlt0PpwHSMS9W4GaQc8FNIltEq0Bu71Hs2T1Tie1xssJxZSc hWeDvtXTF+2Bemx47auHZMnmllpO+GyEXH6xIT5FhAemoKDyhbm6YT/VKzsHc8oh3BMX 1t2IWfneVEEbwf5yx0YethZe1HckmQPsmJgM8iKbpSVSJm5GlPtO+CgqHF/d092vni0E UZxtHLm+9pZ0KEpo8CtDyhKK/Lmas77kUwmTKVhkt0OfWdn52yrPfeC5S+fcjGtHzhad xrJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=8uppqVvC3o7Dj95CoLZCkwoDztLnQh96jLpPd1Hgu98=; b=LhJoJTkHZ6TpQ2T50KX5ExoqLlDla1ekcC5TZ7I9ECnjRHvXkEFzoQuRuS8buhI5Kf 0ILZ8aXnwGp39sgtwUV7gtUkSPKfpHeoPCjlE+PNKflVBvfset5JgCaNY99YTXUtyzZ4 J1T+St/GJut87XKaM9HoZZ1IE5TBMMLs+6esLoiKKboHdK33bKEL8IYmlxBxirB5SNro g2vuI3j1MvMSbMzrxhSLXnGOlcsNd8xaSsdN+c/zF4tMihNEIN/3LcPJEtF0SuBn3glb ckbY9PG2wJUfCQWjF4dm91WTMqlyVYqYllUVUKt0WeHCmFnQ93SXhsCcw6YVjVOnLMCR Ezmw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e96si2023424plb.123.2019.03.20.07.30.50; Wed, 20 Mar 2019 07:31:05 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727405AbfCTOaL convert rfc822-to-8bit (ORCPT + 99 others); Wed, 20 Mar 2019 10:30:11 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:34824 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726169AbfCTOaK (ORCPT ); Wed, 20 Mar 2019 10:30:10 -0400 Received: by mail-qk1-f194.google.com with SMTP id z13so14219636qki.2 for ; Wed, 20 Mar 2019 07:30:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=QAfR56u9ah6iPy2ZaYD48292R6ocZ1r5g2CXJ/8Dj9s=; b=GWjUaKE5kBq3AQ0hVcQXXPG1+2So07x7qprW7qQLnGTI7InXsYJz1TWy+N4ZRw0LTz CWGECTCHjsDCkIMujBElNm+QLP7mAcqDvSilrorIryKrMXX0Ao+ARuQxeIWG3Qpvhqjv 8mrQCTwmUBU7fx6tfUw1Ai9S7kvVw6voLAD6gOmLm0iilMQAFKon9z0CsTesoQtzfeHR yr14xx2nxX4SjOzpZvRZIa17g/zWF6W38/cA2Tn/YtTmrSAM4zxwbGeByopzrqUEOgXk wxRBDUXRPYSfsxrZt22SROGF0MQes4NpUSFSbIJ4R10run5oZOmvrJHzeadFTo9zxToP /o2g== X-Gm-Message-State: APjAAAX7kXuIEiNR1MlcLQghS8qssT+fy0d25qUHkV0GNq1vMaOG2Pb+ vuueXr5u9CThzOzS0TOBcnaZW0HhNEwO8x/8lG1/Jg== X-Received: by 2002:a37:4b49:: with SMTP id y70mr6894862qka.134.1553092209956; Wed, 20 Mar 2019 07:30:09 -0700 (PDT) MIME-Version: 1.0 References: <20190319224823.GA26366@jelly> In-Reply-To: <20190319224823.GA26366@jelly> From: Benjamin Tissoires Date: Wed, 20 Mar 2019 15:29:58 +0100 Message-ID: Subject: Re: [PATCH] HID: logitech: Handle 0 scroll events for the m560 To: Peter Hutterer Cc: "open list:HID CORE LAYER" , =?UTF-8?B?QWltbyBNZXRzw6Rsw6Q=?= , Nestor Lopez Casado , Jiri Kosina , lkml Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 19, 2019 at 11:48 PM Peter Hutterer wrote: > > 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 > --- Added the 'Fixes' and "cc: stable" tags and patch applied to for-5.1/upstream-fixes Cheers, Benjamin > 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 >