Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1792615imm; Sun, 27 May 2018 16:33:30 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrqRdJvy10a+PVGaX3qGJaU72e+wj1rePlJD375EBF80GDqZDicHHlSO/d5pbNTjtyeejPN X-Received: by 2002:a63:7405:: with SMTP id p5-v6mr8625047pgc.289.1527464010237; Sun, 27 May 2018 16:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527464010; cv=none; d=google.com; s=arc-20160816; b=fFEbjFr6iVGng/AA8oQNm44PGOMvhKJSWVXVtlNjU7uKEDM+Q2wotrswpNS5QscZ6n kmIZBcF6ZKNzWz4dRJnqGeviPsNTwYyqFjGmd6ZYNuLHg3vInx+5L4VY+iKc4WwoBM5R ErD/u5ozRFKOARTBze0scXsPmgLLelZ5RZ7/HC1ghSnMlK3SY3e5U6vKgadDDRxUMqQ6 96Hhg7m3eMPxkHQtYi5hKlsy7S2He+6NSvhsW8tcyCRNCIHs/lCvSPKAme1l6XrQFp/L UeBl3Q0aVi32hkeUtzO/QjQzNfd8pU+Cc5kakPfuJm4T/y75X/zkQOLBemCXx62rgpvf /XBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=CpUDp7SNyaKxR9Q4X3FattssMArAj7kCnsvOxeI2GaY=; b=U08eKDO8LsjxV4vF6L514Zc0mja9YptQDQY6KcJ07jHWHVDLDUcyib8iAJQ1s7PNtN 2tHuhLopDLjCxJ6KbwZW28Qmz1MXElL2ugLP+WmMkzVucvKlfecBJmj8D1QfXRMrwWw2 oZnRqYukDUoEnyYc1CIqx4dBRQfzuFH/Eznc3YXhLzdRFL6LdWGqAq8sDVuUpevPukQJ h93VcXytt5Zlkc/SlanBdyuiyMVnoal/nhwRFKZPaaIrt2lpkpwwoS1R/AZZoZSGY+ze 5h1EQtmMDzEKfPeMpo5d/ikLb7j+D80+VTDp90ZdoasvZ693+6X+ksgblUfnRbClmf9u P26A== 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 b3-v6si8623335pls.119.2018.05.27.16.33.13; Sun, 27 May 2018 16:33:30 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752707AbeE0XdE (ORCPT + 99 others); Sun, 27 May 2018 19:33:04 -0400 Received: from leo.clearchain.com ([199.73.29.74]:36601 "EHLO mail.clearchain.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752466AbeE0XdB (ORCPT ); Sun, 27 May 2018 19:33:01 -0400 X-Greylist: delayed 1127 seconds by postgrey-1.27 at vger.kernel.org; Sun, 27 May 2018 19:33:01 EDT Received: from leo.clearchain.com (localhost [127.0.0.1]) by mail.clearchain.com (8.15.2/8.15.2) with ESMTPS id w4RNC4FO002570 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 28 May 2018 08:42:05 +0930 (CST) (envelope-from peter.hutterer@who-t.net) X-Authentication-Warning: leo.clearchain.com: Host localhost [127.0.0.1] claimed to be leo.clearchain.com Received: (from whot@localhost) by leo.clearchain.com (8.15.2/8.15.2/Submit) id w4RNC4lZ002567; Mon, 28 May 2018 08:42:04 +0930 (CST) (envelope-from peter.hutterer@who-t.net) X-Authentication-Warning: leo.clearchain.com: whot set sender to peter.hutterer@who-t.net using -f Date: Mon, 28 May 2018 09:12:00 +1000 From: Peter Hutterer To: Benjamin Tissoires Cc: Jiri Kosina , Andrew Duggan , Oscar Morante , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] HID: rmi: use HID_QUIRK_NO_INPUT_SYNC Message-ID: <20180527231200.GA13676@jelly> References: <20180525125106.18008-1-benjamin.tissoires@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180525125106.18008-1-benjamin.tissoires@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.4.3 (mail.clearchain.com [127.0.0.1]); Mon, 28 May 2018 08:42:05 +0930 (CST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 25, 2018 at 02:51:06PM +0200, Benjamin Tissoires wrote: > When we receive a RMI4 report, we should not unconditionally send an > input_sync event. Instead, we should let the rmi4 transport layer do it > for us. > > This fixes a situation where we might receive X in a report and the rest > in a subsequent one. And this messes up user space. > > Link: https://bugs.freedesktop.org/show_bug.cgi?id=100436 > > Signed-off-by: Benjamin Tissoires > --- yes please! Acked-by: Peter Hutterer Cheers, Peter > > Hi, > > Oscar, do you mind if we add your "Tested-by: Oscar Morante "? > > Andrew, can you check for any sides effects please? > > Cheers, > Benjamin > > drivers/hid/hid-rmi.c | 20 ++++++++++++++++++++ > 1 file changed, 20 insertions(+) > > diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c > index 9c9362149641..9e33165250a3 100644 > --- a/drivers/hid/hid-rmi.c > +++ b/drivers/hid/hid-rmi.c > @@ -413,6 +413,24 @@ static int rmi_event(struct hid_device *hdev, struct hid_field *field, > return 0; > } > > +static void rmi_report(struct hid_device *hid, struct hid_report *report) > +{ > + struct hid_field *field = report->field[0]; > + > + if (!(hid->claimed & HID_CLAIMED_INPUT)) > + return; > + > + switch (report->id) { > + case RMI_READ_DATA_REPORT_ID: > + /* fall-through */ > + case RMI_ATTN_REPORT_ID: > + return; > + } > + > + if (field && field->hidinput && field->hidinput->input) > + input_sync(field->hidinput->input); > +} > + > #ifdef CONFIG_PM > static int rmi_suspend(struct hid_device *hdev, pm_message_t message) > { > @@ -637,6 +655,7 @@ static int rmi_probe(struct hid_device *hdev, const struct hid_device_id *id) > hid_set_drvdata(hdev, data); > > hdev->quirks |= HID_QUIRK_NO_INIT_REPORTS; > + hdev->quirks |= HID_QUIRK_NO_INPUT_SYNC; > > ret = hid_parse(hdev); > if (ret) { > @@ -744,6 +763,7 @@ static struct hid_driver rmi_driver = { > .remove = rmi_remove, > .event = rmi_event, > .raw_event = rmi_raw_event, > + .report = rmi_report, > .input_mapping = rmi_input_mapping, > .input_configured = rmi_input_configured, > #ifdef CONFIG_PM > -- > 2.14.3 >