Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp2572444rwj; Mon, 19 Dec 2022 06:21:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf5zTuNrCOm7acT2rYtJVNRewk0Cx+LDnZFVhmS4UWlP8VTCPe7qulTK5xi6mEfcDvt7wBXk X-Received: by 2002:a05:6402:4cf:b0:463:c960:7589 with SMTP id n15-20020a05640204cf00b00463c9607589mr34183460edw.40.1671459705432; Mon, 19 Dec 2022 06:21:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671459705; cv=none; d=google.com; s=arc-20160816; b=XyvnzT3bqOycdvU6dSF3RdGFsljj7oi6kMPfppu9c82zjaUb88iZTkX3zjLQXi8dfr ctJzRYTqJkXG2kdcY37TpwO42gdiubkOr4ttTi7cfOtsHuJ/Z7Wej9BF77cGGIQLTZ0N 0Q4a15hUFZh875WHlVwMQo4k2voKBCgzz+Oye3G5lrEkKnPOhrs++FFqNLH2HPBFK1lA 0Zx+N24DyyEwJWh4NWO2XJEisR2ZSJTJdzTrG1FEyjhCNWOo68OGK2l92Pl0UfDzkxgS uiw07FI/O/+UYAqOprg/U4aaHahPDSS8/6qAXjO733GNDk18a4kA4Igp5tt7eFOAAezd 5EiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UEaKv7yOU9BXWyw4wC4hTR9UVbDzcTvgjzbUbtvzYDQ=; b=cyDx3KExkLOBRsQvWoFDyAKvj0omhsSN9ImZaZmabBwJ6qQtC58P03Dv8owSKUhfHX SRA5YRu2zLsobYH2weoCg0gtLoI0zpFFYljYnNdxK3v6IfYU8ARYaaIbuv1XDFICxg85 Lib9EImiaNxC2Iwhve96s3rLXFu49wlyXeZzkr1H0MYvL85eYGarfw2YPuwbfJEAqvgc 9pFq99VS3zMuDxFvQpxKt+9NGyaEsl5+nD9upM2BGqNd12GzHar1ODlQ7iS0oePUr7H0 K9XE6uBJPqfDZ1xLXHtPrVFbgPbucyPjvr68MVkO4dP5soG3YHnjodYO2KLicrIbTYvg vn6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=J8MbbqLv; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3-20020aa7c443000000b0046fbb48755csi7677527edr.600.2022.12.19.06.21.21; Mon, 19 Dec 2022 06:21:45 -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=@redhat.com header.s=mimecast20190719 header.b=J8MbbqLv; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231959AbiLSOMK (ORCPT + 71 others); Mon, 19 Dec 2022 09:12:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231856AbiLSOMJ (ORCPT ); Mon, 19 Dec 2022 09:12:09 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEEDBF5AE for ; Mon, 19 Dec 2022 06:11:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671459079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UEaKv7yOU9BXWyw4wC4hTR9UVbDzcTvgjzbUbtvzYDQ=; b=J8MbbqLvK1WCV3fwcXYb16hxMaFWnirt5PeMkZQSRaYGEVILtQlGmCxjKKSsMwJy8tUDP+ aTqea5fU3Nk3+HZ10/+c1G8rruDgH00PGdasZwGXMk3Nf7JgdGtSFA2SvAavTmzamwYI7G PkX9f9GvVAOVkO6aoGpyvoqeTiaVETI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-66-fF1zjqy-NbSq2otPhmIJMA-1; Mon, 19 Dec 2022 09:11:14 -0500 X-MC-Unique: fF1zjqy-NbSq2otPhmIJMA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 21C49802C1D; Mon, 19 Dec 2022 14:11:14 +0000 (UTC) Received: from mail.corp.redhat.com (unknown [10.39.195.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E03822026D4B; Mon, 19 Dec 2022 14:11:12 +0000 (UTC) Date: Mon, 19 Dec 2022 15:11:10 +0100 From: Benjamin Tissoires To: Enrik Berkhan Cc: linux-input@vger.kernel.org, linux-i2c@vger.kernel.org, Sven =?utf-8?Q?Z=C3=BChlsdorf?= , linux-kernel@vger.kernel.org, Rishi Gupta Subject: Re: [PATCH v2 1/3] HID: mcp2221: don't connect hidraw Message-ID: <20221219141110.svhxnmanmzf5fke3@mail.corp.redhat.com> References: <20220926202239.16379-1-Enrik.Berkhan@inka.de> <20221103222714.21566-1-Enrik.Berkhan@inka.de> <20221103222714.21566-2-Enrik.Berkhan@inka.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221103222714.21566-2-Enrik.Berkhan@inka.de> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Nov 03 2022, Enrik Berkhan wrote: > The MCP2221 driver should not connect to the hidraw userspace interface, > as it needs exclusive access to the chip. > > If you want to use /dev/hidrawX with the MCP2221, you need to avoid > binding this driver to the device and use the hid generic driver instead > (e.g. using udev rules). > > Signed-off-by: Enrik Berkhan > --- Given the NULL pointer deference report at https://lore.kernel.org/all/79152feb-bcbc-9e3e-e776-13170ae4ef40@vigem.de/ I have added: Reported-by: Sven Z?hlsdorf And applied this one only in the series in for-6.2/upstream-fixes. Before applying the rest I'd rather have some external reviews of this series. Cheers, Benjamin > drivers/hid/hid-mcp2221.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/drivers/hid/hid-mcp2221.c b/drivers/hid/hid-mcp2221.c > index 5886543b17f3..e61dd039354b 100644 > --- a/drivers/hid/hid-mcp2221.c > +++ b/drivers/hid/hid-mcp2221.c > @@ -1110,12 +1110,19 @@ static int mcp2221_probe(struct hid_device *hdev, > return ret; > } > > - ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW); > + /* > + * This driver uses the .raw_event callback and therefore does not need any > + * HID_CONNECT_xxx flags. > + */ > + ret = hid_hw_start(hdev, 0); > if (ret) { > hid_err(hdev, "can't start hardware\n"); > return ret; > } > > + hid_info(hdev, "USB HID v%x.%02x Device [%s] on %s\n", hdev->version >> 8, > + hdev->version & 0xff, hdev->name, hdev->phys); > + > ret = hid_hw_open(hdev); > if (ret) { > hid_err(hdev, "can't open device\n"); > @@ -1145,8 +1152,7 @@ static int mcp2221_probe(struct hid_device *hdev, > mcp->adapter.retries = 1; > mcp->adapter.dev.parent = &hdev->dev; > snprintf(mcp->adapter.name, sizeof(mcp->adapter.name), > - "MCP2221 usb-i2c bridge on hidraw%d", > - ((struct hidraw *)hdev->hidraw)->minor); > + "MCP2221 usb-i2c bridge"); > > ret = devm_i2c_add_adapter(&hdev->dev, &mcp->adapter); > if (ret) { > -- > 2.34.1 >