Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2521641imm; Mon, 28 May 2018 09:39:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrpumqsXKLZJ1xklUazDh+gGE+DYeCjV/pLOyd3hRb/ZIz0gOu6R6faagdfcMiKL+BbqNX9 X-Received: by 2002:a63:3c4b:: with SMTP id i11-v6mr11047247pgn.414.1527525595433; Mon, 28 May 2018 09:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527525595; cv=none; d=google.com; s=arc-20160816; b=QXTBNIx7VHS8lv3apnkw/zrYf7qVrFjGaPUlW40IvIrl7aFdD6sDNH4olIU6B3tXB+ YWeEc9TX9ZycxrqexLAeKpnVSPTtp5+6ORVyQTRsvLIWwWuLndv0nvLmgen5bde3z31N OaGtBw0WmFD9kuEqReCbYayQui4dZ8WU+KUdOHYesKipzG5ZM/2J665hVx9laSsMSIGX cUtWQqf6/jgc5JdrMsJjwfFqBh0BsE+H+2oEopjFhDdN9nLwtm0x2Qs1cH6vLujcJLVh cvrSGiT778y1ede7FPblI/a+yZo9AtMaSh8UyW1tYyWVQXJgRYC9B1VILkqz+KtmiwcT mdVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:arc-authentication-results; bh=zqWAB0gCk/LBwJ6QxtUdGdfybMGsAC2JLg0z2eYQ6E0=; b=bDWN2sXlewq1uhbQVi4epDNHjdHmpgiAu+KKunOkEqAr8lGw+9r6ObiJQMky75J83d LBqBDBa21I50DRFn2PsXtXlx34CxP9xgdLBl1H/lsI9bfmvl8WVdLVrHYzZkZACk6vZs IMApV4hUyHSeJ6yvzxSkWSOLaT/zRgrGHH9opPOb9/4aCnQZh2FwA6zhvNr4NvLQQ68o Tkbwu193JdrqOQapzzymQw+NWTMn+hZ6RhjN2Kq5ptbo+monwRBfBnkLBMW1YOFFnMaN vHDTpXHdI6X0ASfex3yGQS25rwHw7fPpXJ0A1blEM2PGGsakMcPJ8B8utQ2Bpm615brV ZE3g== 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 k14-v6si8816061pgn.99.2018.05.28.09.39.10; Mon, 28 May 2018 09:39:55 -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 S1425456AbeE1QiH (ORCPT + 99 others); Mon, 28 May 2018 12:38:07 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:37330 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425461AbeE1QiB (ORCPT ); Mon, 28 May 2018 12:38:01 -0400 Received: by mail-qk0-f195.google.com with SMTP id j12-v6so6166800qkk.4 for ; Mon, 28 May 2018 09:38:01 -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:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zqWAB0gCk/LBwJ6QxtUdGdfybMGsAC2JLg0z2eYQ6E0=; b=AzZXt9eeVO0QUPn9niFbTWNL7R8VlnB8taeSX4pF2j6mxbkRtb14D/BxpHXQOX3wDZ HGaE7P27/RRL9ibkmkLHpacQRBVcxPiF+Bv0xnx91heYOaFrb8OCKFJckZbCNQ/ZgQRp a5mfWs9WokJXU9dC77xvY24EtBqkmEVWHHIw9qCBOD9Yvr31HMJsneb9YlRLNqaSCdUa 5OefO4NqVI5HoCrlaaVTSC5KBmvIhgCJqLVl7VJCcOb+yBkZ1J9AkQj+oNTAID7eJk+f dIchzkTuuquMX+eJprA794zplyoVxsqvpFF/V0w4yZj03gUjcjlk6EES9s7NRIbW4PGe j4Iw== X-Gm-Message-State: ALKqPwftrQVSp//MtwSjC1zAbFndSpRCHs39Vytq4OeV9xxoX6wH7Cki uEVMHpYaBeTvJh7yWIXfqACCUa1FGVvhMYaaPIuPHA== X-Received: by 2002:a37:8484:: with SMTP id g126-v6mr12497619qkd.273.1527525480926; Mon, 28 May 2018 09:38:00 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:aed:2bc7:0:0:0:0:0 with HTTP; Mon, 28 May 2018 09:38:00 -0700 (PDT) In-Reply-To: <20180525125106.18008-1-benjamin.tissoires@redhat.com> References: <20180525125106.18008-1-benjamin.tissoires@redhat.com> From: Benjamin Tissoires Date: Mon, 28 May 2018 18:38:00 +0200 Message-ID: Subject: Re: [PATCH] HID: rmi: use HID_QUIRK_NO_INPUT_SYNC To: Jiri Kosina , Andrew Duggan Cc: Oscar Morante , Peter Hutterer , "open list:HID CORE LAYER" , lkml , Benjamin Tissoires 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 On Fri, May 25, 2018 at 2:51 PM, 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 > --- > > Hi, > > Oscar, do you mind if we add your "Tested-by: Oscar Morante "? As mentioned in comment 25 of the bug above (https://bugs.freedesktop.org/show_bug.cgi?id=100436#c25), oscar is fine adding his tested-by line. Cheers, Benjamin > > 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 >