From patchwork Tue Oct 24 10:13:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13434179 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 67C26C07545 for ; Tue, 24 Oct 2023 10:14:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234234AbjJXKOR (ORCPT ); Tue, 24 Oct 2023 06:14:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233942AbjJXKOQ (ORCPT ); Tue, 24 Oct 2023 06:14:16 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D05A7F9 for ; Tue, 24 Oct 2023 03:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698142407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Dtg521BhlHRYZpYI/GoDYq57pNzpBDycFFiOThZpktE=; b=Vl6xEJEKt4sNsLn3cxixjWkVCbfzIVUf0riqXEyoGi4yejotDMZEEgOZXgdExBtZsCh1W4 W3IrExih55rR3k3uslkEXaU81Ahuz0fd/hbH7JsBcjcag+QtFKJC6td8Hb849w8B8ciLnB F0CshMSlTWSM5U8IDTGkfwbqtB4pJyA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-111-fpN5vz7aOYy1ySs_SCml2g-1; Tue, 24 Oct 2023 06:13:22 -0400 X-MC-Unique: fpN5vz7aOYy1ySs_SCml2g-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 88BE28021B1; Tue, 24 Oct 2023 10:13:22 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.194.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1DE8492BFB; Tue, 24 Oct 2023 10:13:21 +0000 (UTC) From: Hans de Goede To: Mauro Carvalho Chehab , Sakari Ailus , Wentong Wu Cc: Hans de Goede , Kate Hsuan , linux-media@vger.kernel.org Subject: [PATCH 1/2] media: mei_csi: Fix driver modalias not matching device modalias Date: Tue, 24 Oct 2023 12:13:18 +0200 Message-ID: <20231024101319.11878-2-hdegoede@redhat.com> In-Reply-To: <20231024101319.11878-1-hdegoede@redhat.com> References: <20231024101319.11878-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The name field of struct mei_cl_device_id is only intended for use with NFC devices where different devices share the same GUID, see drivers/misc/mei/bus-fixup.c which sets the name field to "microread" or "pn544". For all other mei devices the name field is unset and specifying it in the drivers mei_cl_device_id MODULE_DEVICE_TABLE() leads to the driver not properly being autoloaded by modprobe since it causes the module's alias to not match: cat .../spi-INTC1094:00-92335fcf-3203-4472-af93-7b4453ac29da/modalias mei::92335fcf-3203-4472-af93-7b4453ac29da:01: modinfo mei_csi | grep alias mei:vsc_csi:92335fcf-3203-4472-af93-7b4453ac29da:*:* Things still work when manually loading the module because mei_cl_device_find() only matches the name when the *device* has a name set, so setting it in the id_table of the driver does not matter. Drop setting the name in mei_csi_tbl[] so that modprobe will properly autoload the module. This makes the mei_cl_device_id use identical to all the other non NFC mei drivers: drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c drivers/misc/mei/hdcp/mei_hdcp.c drivers/misc/mei/pxp/mei_pxp.c drivers/watchdog/mei_wdt.c Signed-off-by: Hans de Goede --- drivers/media/pci/intel/ivsc/mei_csi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/intel/ivsc/mei_csi.c b/drivers/media/pci/intel/ivsc/mei_csi.c index 00ba611e0f68..dab89b0f417e 100644 --- a/drivers/media/pci/intel/ivsc/mei_csi.c +++ b/drivers/media/pci/intel/ivsc/mei_csi.c @@ -804,7 +804,7 @@ static void mei_csi_remove(struct mei_cl_device *cldev) 0xAF, 0x93, 0x7b, 0x44, 0x53, 0xAC, 0x29, 0xDA) static const struct mei_cl_device_id mei_csi_tbl[] = { - { MEI_CSI_DRIVER_NAME, MEI_CSI_UUID, MEI_CL_VERSION_ANY }, + { .uuid = MEI_CSI_UUID, .version = MEI_CL_VERSION_ANY }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(mei, mei_csi_tbl); From patchwork Tue Oct 24 10:13:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 13434180 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 9AAACC07545 for ; Tue, 24 Oct 2023 10:14:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234428AbjJXKOV (ORCPT ); Tue, 24 Oct 2023 06:14:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234316AbjJXKOU (ORCPT ); Tue, 24 Oct 2023 06:14:20 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4525F109 for ; Tue, 24 Oct 2023 03:13:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698142413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jhf+zih70iLYmxsfOGmu6Bkx6txhyZ4Vq4nAhrEWTdA=; b=do12yd8+aG4c8CkPKD1n90TFEq1QHYezmeTUnIZVbBeXpepQ/K/YK8NcTri4cI3cT93M8z YssfZT8rZxJVmQ1HciO8S+5nb0vAn5X9kAAcW7qk4qKcOBOo/4H3GzrpNk1q/InAMTrkqE p9uiMq7uF92o+wphHyupr0EmqrnaFWY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-539-EmnB8n_zOdCjSI4iha6BKg-1; Tue, 24 Oct 2023 06:13:24 -0400 X-MC-Unique: EmnB8n_zOdCjSI4iha6BKg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9C6A9891F21; Tue, 24 Oct 2023 10:13:23 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.194.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA66F492BFB; Tue, 24 Oct 2023 10:13:22 +0000 (UTC) From: Hans de Goede To: Mauro Carvalho Chehab , Sakari Ailus , Wentong Wu Cc: Hans de Goede , Kate Hsuan , linux-media@vger.kernel.org Subject: [PATCH 2/2] media: mei_ace: Fix driver modalias not matching device modalias Date: Tue, 24 Oct 2023 12:13:19 +0200 Message-ID: <20231024101319.11878-3-hdegoede@redhat.com> In-Reply-To: <20231024101319.11878-1-hdegoede@redhat.com> References: <20231024101319.11878-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The name field of struct mei_cl_device_id is only intended for use with NFC devices where different devices share the same GUID, see drivers/misc/mei/bus-fixup.c which sets the name field to "microread" or "pn544". For all other mei devices the name field is unset and specifying it in the drivers mei_cl_device_id MODULE_DEVICE_TABLE() leads to the driver not properly being autoloaded by modprobe since it causes the module's alias to not match: cat .../spi-INTC1094:00-5db76cf6-0a68-4ed6-9b78-0361635e2447/modalias mei::5db76cf6-0a68-4ed6-9b78-0361635e2447:01: modinfo mei_ace | grep alias mei:vsc_ace:5db76cf6-0a68-4ed6-9b78-0361635e2447:*:* Things still work when manually loading the module because mei_cl_device_find() only matches the name when the *device* has a name set, so setting it in the id_table of the driver does not matter. Drop setting the name in mei_ace_tbl[] so that modprobe will properly autoload the module. This makes the mei_cl_device_id use identical to all the other non NFC mei drivers: drivers/misc/mei/gsc_proxy/mei_gsc_proxy.c drivers/misc/mei/hdcp/mei_hdcp.c drivers/misc/mei/pxp/mei_pxp.c drivers/watchdog/mei_wdt.c Signed-off-by: Hans de Goede --- drivers/media/pci/intel/ivsc/mei_ace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/pci/intel/ivsc/mei_ace.c b/drivers/media/pci/intel/ivsc/mei_ace.c index a0491f307831..e0a4deb9dc16 100644 --- a/drivers/media/pci/intel/ivsc/mei_ace.c +++ b/drivers/media/pci/intel/ivsc/mei_ace.c @@ -554,7 +554,7 @@ static const struct dev_pm_ops mei_ace_pm_ops = { 0x9B, 0x78, 0x03, 0x61, 0x63, 0x5E, 0x24, 0x47) static const struct mei_cl_device_id mei_ace_tbl[] = { - { MEI_ACE_DRIVER_NAME, MEI_ACE_UUID, MEI_CL_VERSION_ANY }, + { .uuid = MEI_ACE_UUID, .version = MEI_CL_VERSION_ANY }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(mei, mei_ace_tbl);