Message ID | 20230622101813.3453772-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4959546vqr; Thu, 22 Jun 2023 03:21:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7khChKH68zu2UfuVQdipUbFsF5qHVVcGTAe0trRY0ywAgpnU7XWmwrq8z/qbdzT385RBXY X-Received: by 2002:a17:90a:470f:b0:259:dda1:bee1 with SMTP id h15-20020a17090a470f00b00259dda1bee1mr16813298pjg.46.1687429302555; Thu, 22 Jun 2023 03:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687429302; cv=none; d=google.com; s=arc-20160816; b=IKftOZcZvspLMTZRYpCcwvboLHCxA4KPY6Hs2Aw/MtkK52f2KdRp4kyLJ2DADf7zPZ B4XH00JfN+rFl5xukIiSDMuOJxWR4kjfWkeDmZJ1ICY1HD4GVl2WK8eaLVCFFohwQ0Pc /QQB+0gB/grLpwefj7TDII+zkiZIH/2TgtoGKF02xJsq8Y8s37LNDYm1N8/8miWcH97L WhdTWK+olEGmDH6CTiIsI4LVDAn+EAaeeokkjSmWpZ8HsyEi9YPQV6NAgFvAaLpufK3M 9XEcBeKTwoH30VtD5uU+kMvOMHoK8fLv9m66QjsuEd5h4k0UIhlKyC/yNJC1fxd0nNNS UhvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=XDXRbGQrgHMo8zuCmd2yitscKbzwPSdTj1/zwUGoCvc=; b=w6CYCFMzyXN8i0K1jwpqrj4XYgVVwqJbtLL4RPN7J3ZqFpB2476In4iL2mXBBhg09T xysbUZH+jDpEVfge9r9obfajCXB5es3rDLNNmDMF+8P51UfiBbH750oVBbkqEWN70NUR KzF1o+orquAzxGz083EjHtsLNqX6bk1YPiwFp/99mXGbKfkvNnc69+oVjlj1SaQCmBKK jUBrsLIjGsD1meGvjylKg4KIMx9COaaXs5jssAVCYU08hM5uu1ZhDGh1aVqZF7PGUWaa QKNe5wyc3qI/WTuBjyZppswBJpkIByeAPkw8CZlypLkd1sIhgPyhmGe0Jz7YJMZd9OKz Y5Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=igRdryfE; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y6-20020a17090a154600b0024e12dc1e4csi14053865pja.86.2023.06.22.03.21.29; Thu, 22 Jun 2023 03:21:42 -0700 (PDT) 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=igRdryfE; 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 S230445AbjFVKSW (ORCPT <rfc822;maxin.john@gmail.com> + 99 others); Thu, 22 Jun 2023 06:18:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbjFVKSU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 22 Jun 2023 06:18:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9107FDD; Thu, 22 Jun 2023 03:18:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2D8B5617C8; Thu, 22 Jun 2023 10:18:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCD4DC433C8; Thu, 22 Jun 2023 10:18:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687429098; bh=ON66HbfJ1HJ3YKs4MkYfePaKxVL3lLiSW463cMoqJN4=; h=From:To:Cc:Subject:Date:From; b=igRdryfErkXMOmpAXCPL6+iCdcz1mTZRIYVlWMjPI8b0SqJC69hTsbH+P/YSsAHai XP7sqjUe/IKYNNB+3suFT2wCKtmI25VVLv5GPH/pbDbdY3W6RKGBu4AHgH3mDUB1L4 TSlqXiW2Gbzk0kUakH7H1bF4MPnIV017QO2Mtf2ZIqJwRgu6QRYbua6Y6zNC/802uD Bcrlt3rKaoeT1toTidzbR8C6lSKx7br+blH7glaHq1bGY9DEd5Vzmvd1uaazGqDPJy otbwxq/Gs5Hg6u5WmoO+aOhtm781Nux25vjrlV9h0lfFe/GluICxaHSHrXHmfGlV+J geWn76zimRrxg== From: Arnd Bergmann <arnd@kernel.org> To: Heikki Krogerus <heikki.krogerus@linux.intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Neil Armstrong <neil.armstrong@linaro.org>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Cc: Arnd Bergmann <arnd@arndb.de>, Bjorn Andersson <andersson@kernel.org>, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: typec: nb7vpq904m: add CONFIG_DRM dependency Date: Thu, 22 Jun 2023 12:18:09 +0200 Message-Id: <20230622101813.3453772-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769397868065216006?= X-GMAIL-MSGID: =?utf-8?q?1769397868065216006?= |
Series |
usb: typec: nb7vpq904m: add CONFIG_DRM dependency
|
|
Commit Message
Arnd Bergmann
June 22, 2023, 10:18 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de> This driver calls directly into DRM functions and fails to link if that is disabled: ld.lld: error: undefined symbol: devm_drm_bridge_add ld.lld: error: undefined symbol: devm_drm_of_get_bridge >>> referenced by nb7vpq904m.c >>> drivers/usb/typec/mux/nb7vpq904m.o:(nb7vpq904m_probe) in archive vmlinux.a Fixes: 88d8f3ac9c67e ("usb: typec: add support for the nb7vpq904m Type-C Linear Redriver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/usb/typec/mux/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi, On 22/06/2023 12:18, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > This driver calls directly into DRM functions and fails to link if > that is disabled: > > ld.lld: error: undefined symbol: devm_drm_bridge_add > ld.lld: error: undefined symbol: devm_drm_of_get_bridge >>>> referenced by nb7vpq904m.c >>>> drivers/usb/typec/mux/nb7vpq904m.o:(nb7vpq904m_probe) in archive vmlinux.a > > Fixes: 88d8f3ac9c67e ("usb: typec: add support for the nb7vpq904m Type-C Linear Redriver") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > drivers/usb/typec/mux/Kconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/mux/Kconfig b/drivers/usb/typec/mux/Kconfig > index 8c4d6b8fb75c3..f53ae24b6c048 100644 > --- a/drivers/usb/typec/mux/Kconfig > +++ b/drivers/usb/typec/mux/Kconfig > @@ -37,7 +37,7 @@ config TYPEC_MUX_INTEL_PMC > > config TYPEC_MUX_NB7VPQ904M > tristate "On Semiconductor NB7VPQ904M Type-C redriver driver" > - depends on I2C > + depends on I2C && DRM > select REGMAP_I2C > help > Say Y or M if your system has a On Semiconductor NB7VPQ904M Type-C I think it could be : + depends on DRM || DRM=n + select DRM_PANEL_BRIDGE if DRM Neil
On Thu, Jun 22, 2023, at 12:39, Neil Armstrong wrote: > Hi, > > On 22/06/2023 12:18, Arnd Bergmann wrote: >> From: Arnd Bergmann <arnd@arndb.de> >> >> This driver calls directly into DRM functions and fails to link if >> that is disabled: >> >> ld.lld: error: undefined symbol: devm_drm_bridge_add >> ld.lld: error: undefined symbol: devm_drm_of_get_bridge >>>>> referenced by nb7vpq904m.c >>>>> drivers/usb/typec/mux/nb7vpq904m.o:(nb7vpq904m_probe) in archive vmlinux.a >> >> Fixes: 88d8f3ac9c67e ("usb: typec: add support for the nb7vpq904m Type-C Linear Redriver") >> Signed-off-by: Arnd Bergmann <arnd@arndb.de> >> --- >> drivers/usb/typec/mux/Kconfig | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/usb/typec/mux/Kconfig b/drivers/usb/typec/mux/Kconfig >> index 8c4d6b8fb75c3..f53ae24b6c048 100644 >> --- a/drivers/usb/typec/mux/Kconfig >> +++ b/drivers/usb/typec/mux/Kconfig >> @@ -37,7 +37,7 @@ config TYPEC_MUX_INTEL_PMC >> >> config TYPEC_MUX_NB7VPQ904M >> tristate "On Semiconductor NB7VPQ904M Type-C redriver driver" >> - depends on I2C >> + depends on I2C && DRM >> select REGMAP_I2C >> help >> Say Y or M if your system has a On Semiconductor NB7VPQ904M Type-C > > I think it could be : > > + depends on DRM || DRM=n > + select DRM_PANEL_BRIDGE if DRM As far as I can tell, this would only avoid the link error against devm_drm_of_get_bridge(), but not the one against devm_drm_bridge_add(), which is defined in drm.ko through drivers/gpu/drm/drm_bridge.c. Arnd
Hi, On 22/06/2023 13:24, Arnd Bergmann wrote: > On Thu, Jun 22, 2023, at 12:39, Neil Armstrong wrote: >> Hi, >> >> On 22/06/2023 12:18, Arnd Bergmann wrote: >>> From: Arnd Bergmann <arnd@arndb.de> >>> >>> This driver calls directly into DRM functions and fails to link if >>> that is disabled: >>> >>> ld.lld: error: undefined symbol: devm_drm_bridge_add >>> ld.lld: error: undefined symbol: devm_drm_of_get_bridge >>>>>> referenced by nb7vpq904m.c >>>>>> drivers/usb/typec/mux/nb7vpq904m.o:(nb7vpq904m_probe) in archive vmlinux.a >>> >>> Fixes: 88d8f3ac9c67e ("usb: typec: add support for the nb7vpq904m Type-C Linear Redriver") >>> Signed-off-by: Arnd Bergmann <arnd@arndb.de> >>> --- >>> drivers/usb/typec/mux/Kconfig | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/usb/typec/mux/Kconfig b/drivers/usb/typec/mux/Kconfig >>> index 8c4d6b8fb75c3..f53ae24b6c048 100644 >>> --- a/drivers/usb/typec/mux/Kconfig >>> +++ b/drivers/usb/typec/mux/Kconfig >>> @@ -37,7 +37,7 @@ config TYPEC_MUX_INTEL_PMC >>> >>> config TYPEC_MUX_NB7VPQ904M >>> tristate "On Semiconductor NB7VPQ904M Type-C redriver driver" >>> - depends on I2C >>> + depends on I2C && DRM >>> select REGMAP_I2C >>> help >>> Say Y or M if your system has a On Semiconductor NB7VPQ904M Type-C >> >> I think it could be : >> >> + depends on DRM || DRM=n >> + select DRM_PANEL_BRIDGE if DRM > > As far as I can tell, this would only avoid the link error > against devm_drm_of_get_bridge(), but not the one against > devm_drm_bridge_add(), which is defined in drm.ko through > drivers/gpu/drm/drm_bridge.c. I'm trying to reproduce such situation, but so fail I fail. In the driver there's a guard to avoid calling into DRM functions when disabled: #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_PANEL_BRIDGE) so I wonder which kind on config leaded to that since CONFIG_DRM_PANEL_BRIDGE is only enabled when DRM_PANEL and DRM are. Neil > > Arnd
On Thu, Jun 22, 2023, at 17:39, Neil Armstrong wrote: > On 22/06/2023 13:24, Arnd Bergmann wrote: >> On Thu, Jun 22, 2023, at 12:39, Neil Armstrong wrote: >>>> >>>> config TYPEC_MUX_NB7VPQ904M >>>> tristate "On Semiconductor NB7VPQ904M Type-C redriver driver" >>>> - depends on I2C >>>> + depends on I2C && DRM >>>> select REGMAP_I2C >>>> help >>>> Say Y or M if your system has a On Semiconductor NB7VPQ904M Type-C >>> >>> I think it could be : >>> >>> + depends on DRM || DRM=n >>> + select DRM_PANEL_BRIDGE if DRM >> >> As far as I can tell, this would only avoid the link error >> against devm_drm_of_get_bridge(), but not the one against >> devm_drm_bridge_add(), which is defined in drm.ko through >> drivers/gpu/drm/drm_bridge.c. > > I'm trying to reproduce such situation, but so fail I fail. > > In the driver there's a guard to avoid calling into DRM functions > when disabled: > #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_PANEL_BRIDGE) Ah, you are right. I got confused because the check is in header file for devm_drm_of_get_bridge(), but not for devm_drm_bridge_add(), which has the check in the source file as you point out. > so I wonder which kind on config leaded to that since > CONFIG_DRM_PANEL_BRIDGE is only enabled when DRM_PANEL and DRM are. I only saw the original issue with CONFIG_DRM=m CONFIG_DRM_PANEL=y CONFIG_DRM_BRIDGE=y CONFIG_DRM_PANEL_BRIDGE=y CONFIG_TYPEC_MUX_NB7VPQ904M=y and since CONFIG_DRM_PANEL_BRIDGE already depends on CONFIG_DRM, I think that is the only one that can go wrong, so your suggestion of depends on DRM || DRM=n should be sufficient. I see that DRM_PANEL, DRM_BRIDGE and DRM_PANEL_BRIDGE are now always =y whenever DRM is enabled, so I don't think the 'select CONFIG_DRM_PANEL_BRIDGE' serves any purpose any more, but it's also harmless if you think it helps for clarification. Can you send the updated patch, or should I? Arnd
On 22/06/2023 17:57, Arnd Bergmann wrote: > On Thu, Jun 22, 2023, at 17:39, Neil Armstrong wrote: >> On 22/06/2023 13:24, Arnd Bergmann wrote: >>> On Thu, Jun 22, 2023, at 12:39, Neil Armstrong wrote: >>>>> >>>>> config TYPEC_MUX_NB7VPQ904M >>>>> tristate "On Semiconductor NB7VPQ904M Type-C redriver driver" >>>>> - depends on I2C >>>>> + depends on I2C && DRM >>>>> select REGMAP_I2C >>>>> help >>>>> Say Y or M if your system has a On Semiconductor NB7VPQ904M Type-C >>>> >>>> I think it could be : >>>> >>>> + depends on DRM || DRM=n >>>> + select DRM_PANEL_BRIDGE if DRM >>> >>> As far as I can tell, this would only avoid the link error >>> against devm_drm_of_get_bridge(), but not the one against >>> devm_drm_bridge_add(), which is defined in drm.ko through >>> drivers/gpu/drm/drm_bridge.c. >> >> I'm trying to reproduce such situation, but so fail I fail. >> >> In the driver there's a guard to avoid calling into DRM functions >> when disabled: >> #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_PANEL_BRIDGE) > > Ah, you are right. I got confused because the check is in > header file for devm_drm_of_get_bridge(), but not for > devm_drm_bridge_add(), which has the check in the source > file as you point out. > >> so I wonder which kind on config leaded to that since >> CONFIG_DRM_PANEL_BRIDGE is only enabled when DRM_PANEL and DRM are. > > I only saw the original issue with > > CONFIG_DRM=m > CONFIG_DRM_PANEL=y > CONFIG_DRM_BRIDGE=y > CONFIG_DRM_PANEL_BRIDGE=y > CONFIG_TYPEC_MUX_NB7VPQ904M=y Ok now I see it > > and since CONFIG_DRM_PANEL_BRIDGE already depends on CONFIG_DRM, > I think that is the only one that can go wrong, so your > suggestion of > > depends on DRM || DRM=n > > should be sufficient. I see that DRM_PANEL, DRM_BRIDGE and > DRM_PANEL_BRIDGE are now always =y whenever DRM is enabled, > so I don't think the 'select CONFIG_DRM_PANEL_BRIDGE' serves > any purpose any more, but it's also harmless if you think it > helps for clarification. Yes DRM || DRM=n seems sufficient, but having select DRM_PANEL_BRIDGE if DRM could clarify things. > > Can you send the updated patch, or should I? I'll send an updated patch, Thanks, Neil > > > Arnd
diff --git a/drivers/usb/typec/mux/Kconfig b/drivers/usb/typec/mux/Kconfig index 8c4d6b8fb75c3..f53ae24b6c048 100644 --- a/drivers/usb/typec/mux/Kconfig +++ b/drivers/usb/typec/mux/Kconfig @@ -37,7 +37,7 @@ config TYPEC_MUX_INTEL_PMC config TYPEC_MUX_NB7VPQ904M tristate "On Semiconductor NB7VPQ904M Type-C redriver driver" - depends on I2C + depends on I2C && DRM select REGMAP_I2C help Say Y or M if your system has a On Semiconductor NB7VPQ904M Type-C