Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2827156pxb; Thu, 3 Feb 2022 15:43:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyEEyF6q4sYkluisDHGL4VOHDTPzDSVIGmCRLuEnnEQM+b2pNQjnSuunOyv0E84K75g+oS X-Received: by 2002:a17:902:6945:: with SMTP id k5mr275180plt.141.1643931787954; Thu, 03 Feb 2022 15:43:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643931787; cv=none; d=google.com; s=arc-20160816; b=QlPgCc4/XAhAJ1yvN9019jYs27j1QPs8FwcAFfjHqKgRCBxuPkxf9JjAf3llIX/QTG I/d4L+D+1PxdLHmOJ+8Awr0T1rBASKhpnpL/zi9qBGFJIqipOokh5ZKu4V7QBx8p4oza RAfd1y51hMRblY6/zxITm5YUubSB9wjtg5kvLXcidso5IkLSBTzT1+qC48R+EF5t37C3 h3zjd4MaX/C/CquIkKIIZRgBQ6mXQcZIMas85LeIpiw0IcOUwKY+kFrU2RnNYjlt/XQx xieZvABzK/J5wOPAVLUrFs/NmwZiaSOQBxHMgfWI0tSwsrbMSv7PYEs48nfx7w04AZ3u SbCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=NzqngQah/vpoXgV4oVRc+8coNVZq7J6PpDAoqxG6QQs=; b=0eaU9jPq7n/oVhkBMsISClDytbbqPIAZhh+f1LxL+S9oa3HIPHKNtvuSczHwgBCBA0 VM49NucKshAOCtpostYkJM75qUrkl24BJjhso0dOKahFqjfHDxQ/MMhtPaaOn7wheBLW lYMsyHHf/dh5B3Dw2PoUqRvTyttbKfZyubn3aefyssk7HIaYZjGmBDfASeB7lP5Ssz5i WuWK7JEn0EPtj9MK9AA8aaTXXjqwsmxO8dl5ZgfXC+tJ42PZa5Bd6K4456AmLW9/jqsS RrjcsDF8pmd7p+eTdDpfON53yrS20MC5NrvvF1YgG2ELvgBmwiUvmYki3tp8NITtzsjc m0GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="T/ZSDiJe"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11si311428pgp.652.2022.02.03.15.42.55; Thu, 03 Feb 2022 15:43:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="T/ZSDiJe"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240707AbiBBN4j (ORCPT + 99 others); Wed, 2 Feb 2022 08:56:39 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:45408 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232613AbiBBN4i (ORCPT ); Wed, 2 Feb 2022 08:56:38 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E290EB830CE; Wed, 2 Feb 2022 13:56:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74964C004E1; Wed, 2 Feb 2022 13:56:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643810195; bh=i3Wl1PIcI1R8gZONAXMRTX8wXCIK09GZNAlBvHC4fQ8=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=T/ZSDiJe218DWQXungnNozQ68nnU0HzrBOnMFfY1WSWexVnpBIsRZkBJrXqvTfn3Y Op8O+tz8t3dyHq9+LOytosMmxPQ0mTRCIoBNyIHUzzd+wL/lKBJ1CFJeqvlH4JBvX5 C2y7WM5Vqjlx+EWliW4ocLVrRVu1E4/ysaA+FT/4sZpheVi5pjooZQVB+k+pBLmXpX 2/5Qohkx6k5oZdlh9tBKvZ2/mCAADiayQO2G9wvXgL87PFx84Jln5+qnhPt3DNgf+h gTB4kgAnaFs+bIkcsHjNYrMztZ58TT7vJA3V3qDKyXsD1ph7rqnTDT3GBgCYvtlmB+ v+tMNkPXqTSjA== Date: Wed, 2 Feb 2022 14:56:32 +0100 (CET) From: Jiri Kosina To: Dmitry Torokhov cc: Benjamin Tissoires , Angela Czubak , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/12] i2c-hid: fixes for unnumbered reports and other improvements In-Reply-To: <20220118072628.1617172-1-dmitry.torokhov@gmail.com> Message-ID: References: <20220118072628.1617172-1-dmitry.torokhov@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 Mon, 17 Jan 2022, Dmitry Torokhov wrote: > Hi, > > This series came about after I reviewed Angela's patch that fixed issues > with incorrect handling of high-numbered reports (15 and above) in > i2c-hid driver: > > - it appears to me that the driver did not handle unnumbered reports > correctly as the kernel internally expects unnumbered reports to be > still prepended with report number 0, but i2c_hid_get_raw_report() and > i2c_hid_output_raw_report() only expected report ID to be present for > numbered reports. > > - the driver tried to consolidate both command handling and sending > output reports in __i2c_hid_command() but the rules for different > commands vary significantly and because of that the logic was hard to > follow and it bled out from __i2c_hid_command() to callers. I decided > to introduce a few simple helpers and have the data encoding for > individual commands done at the call site. I believe this made it > easier to validate the rules and the logic and allowed to remove > special handling for the HID descriptor retrieval, among other things. > > - the driver does too many copying of data; encoding the data for > commands at the call site allowed to only copy data once into the > transfer buffers. > > I tested this on a couple of Chromebooks with i2c-hid touchscreens, but > it would be great if other folks tried it out as well. Benjamin, is this something you could feed into your testing machinery as well? (not sure whether it's handling i2c-hid specifics). Thanks! -- Jiri Kosina SUSE Labs