From patchwork Thu Nov 3 22:27:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enrik Berkhan X-Patchwork-Id: 621556 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 760B3C43217 for ; Thu, 3 Nov 2022 22:27:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231623AbiKCW1a (ORCPT ); Thu, 3 Nov 2022 18:27:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231559AbiKCW13 (ORCPT ); Thu, 3 Nov 2022 18:27:29 -0400 Received: from mail.inka.de (mail.inka.de [IPv6:2a04:c9c7:0:1073:217:a4ff:fe3b:e77c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C30D21802; Thu, 3 Nov 2022 15:27:27 -0700 (PDT) Received: from mail3.berkhan-weisser.de ([2a03:4000:54:b9a::4]) by mail.inka.de with esmtpsa id 1oqigH-005aIb-O6; Thu, 03 Nov 2022 23:27:25 +0100 Received: from 127.0.0.1 (helo=localhost.localdomain) by mail3.berkhan-weisser.de with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from ) id 1oqigH-005Ggn-9f; Thu, 03 Nov 2022 23:27:25 +0100 From: Enrik Berkhan To: linux-input@vger.kernel.org Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Rishi Gupta , Enrik Berkhan Subject: [PATCH v2 0/3] Fixes for the mcp2221 HID-to-I2C-bridge driver Date: Thu, 3 Nov 2022 23:27:11 +0100 Message-Id: <20221103222714.21566-1-Enrik.Berkhan@inka.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220926202239.16379-1-Enrik.Berkhan@inka.de> References: <20220926202239.16379-1-Enrik.Berkhan@inka.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org In this patch series are fixes for issues I found during recent tests of an MCP2221 board. - you can confuse the kernel driver when using the chip from user mode via /dev/hidrawX, typically leading to a NULL pointer dereference in the driver's HID raw event handler - the driver needs > 15s to initialize because the HID raw handling is not enabled during initialization of the GPIO part - the rxbuf pointer can become invalid or even stale if the device would send unsolicited reports Changes in v2: - removed: data shared with the bottom half code is not protected from concurrent access Feedback if this is actually needed or not would be appreciated. - rebased on linux-hid/for-6.2/mcp2221 Enrik Berkhan (3): HID: mcp2221: don't connect hidraw HID: mcp2221: enable HID I/O during GPIO probe HID: mcp2221: avoid stale rxbuf pointer drivers/hid/hid-mcp2221.c | 51 +++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 10 deletions(-) base-commit: 3d74c9eca1a2bda03e45f18d13154ac3e0dfba85