From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0D27C48BE5 for ; Tue, 15 Jun 2021 08:55:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B1FC061425 for ; Tue, 15 Jun 2021 08:55:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231209AbhFOI5a (ORCPT ); Tue, 15 Jun 2021 04:57:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:46232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231222AbhFOI52 (ORCPT ); Tue, 15 Jun 2021 04:57:28 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 95F2A61425; Tue, 15 Jun 2021 08:55:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623747323; bh=76DaaVnJe+WBkPEoWCtLhu5YWnCSPNQlkBxQn0hTDRM=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=p6ZXcjjJREAg+aG84s5JDo4DiIREDT7VyiVro9heI6ShI0mebg3RUp3nXV4jjbKuu r2v5T0Izr8U6PDd53kbvXzDJRvtr+gZ+iBpcaYsANf4Xz8leLgMURNr4XxrBOS53U0 wRJlPa41bXdvOaKwriwmStCercn8KYwShL1GuahTtoqPjTkz4tzORUF93giyG15Osk /8c0UA41tA78FHNUtQYqmxSZqTt0e/6GslmVgsIoinZ2E94CDr5kAwCwR9kmEcMItG LpB/BznPmpUib/GUw6M3OZSPRDid7Kk3/2nAwB5eQFO5grLWGaLvxVLHwdZEEl0A4+ MflHJhUw4eRjg== Date: Tue, 15 Jun 2021 10:55:20 +0200 (CEST) From: Jiri Kosina To: Maximilian Luz cc: Benjamin Tissoires , =?ISO-8859-15?Q?Bla=B8_Hrastnik?= , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] HID: surface-hid: Fix get-report request In-Reply-To: <20210608132951.1392303-1-luzmaximilian@gmail.com> Message-ID: References: <20210608132951.1392303-1-luzmaximilian@gmail.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 8 Jun 2021, Maximilian Luz wrote: > Getting a report (e.g. feature report) from a device requires us to send > a request indicating which report we want to retrieve and then waiting > for the corresponding response containing that report. We already > provide the response structure to the request call, but the request > isn't marked as a request that expects a response. Thus the request > returns before we receive the response and the response buffer indicates > a zero length response due to that. > > This essentially means that the get-report calls are broken and will > always indicate that a report of length zero has been read. > > Fix this by appropriately marking the request. > > Fixes: b05ff1002a5c ("HID: Add support for Surface Aggregator Module HID transport") > Signed-off-by: Maximilian Luz > --- > drivers/hid/surface-hid/surface_hid.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hid/surface-hid/surface_hid.c b/drivers/hid/surface-hid/surface_hid.c > index 3477b31611ae..a3a70e4f3f6c 100644 > --- a/drivers/hid/surface-hid/surface_hid.c > +++ b/drivers/hid/surface-hid/surface_hid.c > @@ -143,7 +143,7 @@ static int ssam_hid_get_raw_report(struct surface_hid_device *shid, u8 rprt_id, > rqst.target_id = shid->uid.target; > rqst.instance_id = shid->uid.instance; > rqst.command_id = SURFACE_HID_CID_GET_FEATURE_REPORT; > - rqst.flags = 0; > + rqst.flags = SSAM_REQUEST_HAS_RESPONSE; > rqst.length = sizeof(rprt_id); > rqst.payload = &rprt_id; Queued in for-5.13/upstream-fixes branch, thanks. -- Jiri Kosina SUSE Labs