Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp11143644rwd; Thu, 22 Jun 2023 09:13:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6s/qd8MRNpTjV8avYgh/1P8eIwHNjdJr4edCuufP/YFRFAg06rXOb4pb7F3qcDLvucoQkh X-Received: by 2002:a92:c60a:0:b0:33d:16b6:3df8 with SMTP id p10-20020a92c60a000000b0033d16b63df8mr17068547ilm.24.1687450430855; Thu, 22 Jun 2023 09:13:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687450430; cv=none; d=google.com; s=arc-20160816; b=JVRzOxJmGCCLGOUhlZhqoAeWiFEOTVgasL+smylX4cJw+4v5F8CKGw/dDnsaMDR7lB 1Pb4jL+zAG9lKmvlEYYyuQlvrTyBQ+TkYLbJcfTkQvohvL+6kSdaIgbHvLe5SPgeko4X Zu9p55344tCCr5VYgB8TBwrJ1n1I8NKxHYriHqBMo2RSPe+jNINwXJo0ixNwEqfur9ar kD2zBBiLpE76SjJLPR0xZXN7FJmtlKHEEclVkAS0gEN/HbF6pjg8upf8EHiAL8nAjoqy YYUYmSSKasnNq6/Qp8gP65dMx074j8q1kuy4oJg1oYFaMpneFRqIPcdjRJy43lYBXhVr pbMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=SwWTzuTjlgQGVQR+2YmginMJTPMuluTbAtrwpUP0wfo=; b=W+IvD+jv79kBF0MTn74XWd+M+BMXl4tpYOeOsllncD7F0sjjQEMiW0ioz8WBEqqx74 hYyCCkT2wk/4NshtJ86A+SqYe8YPhwL0DMn5RpcrMMmah7vmD3eGqVZqRR+v6uzUba7P 7Pbf5IP2QaKBwm4VFHbcl2j8QRJ27bENdPaKya69f/Uxywgdbu+TsNFOLqJGUwbeWG8j 3eIwvNi2d5Ytr9frTjkcE9Gd6FDPnUxp1YQTynCsmWw7slO1fu1KSxCCvA7uQ0NuFFm4 FhtMwlF5IHxWulBu/62nBN1m7txK3lDlKtXoqcMot1K76EjWwLuvwy+raAWPW8AWaGh6 QVtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=z7WijLKX; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=JBsD8nlK; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g130-20020a636b88000000b00553ced07d17si6282423pgc.123.2023.06.22.09.13.38; Thu, 22 Jun 2023 09:13:50 -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=@arndb.de header.s=fm1 header.b=z7WijLKX; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=JBsD8nlK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230320AbjFVP6B (ORCPT + 99 others); Thu, 22 Jun 2023 11:58:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230072AbjFVP57 (ORCPT ); Thu, 22 Jun 2023 11:57:59 -0400 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEE18BC; Thu, 22 Jun 2023 08:57:58 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id EA96E3200392; Thu, 22 Jun 2023 11:57:57 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Thu, 22 Jun 2023 11:57:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1687449477; x=1687535877; bh=Sw WTzuTjlgQGVQR+2YmginMJTPMuluTbAtrwpUP0wfo=; b=z7WijLKX4mWQ20kxya fP5mjgLJYkoAAtf5A+yuY2kiC2I0TNyz8Gaas9gXfxooHjCQgW+BM7X51d2o7C0p AnUCyOJ2q9VvmA353KFSAHst6JqMHsnLvQ3gIYnsMcbnlIlnXAbrlL+Hbi7xntwg hZzZFfBqiaU4K0eKdFSksPhc4pcHW29roRhMMUQQKWf3kRvxLtP07pBg8zSNRPYU YJc7O8bFx5LBHARQ/UeSTTspqw+vK67xNEk938CI4aYas3fX2+D36JdWfBLngTsl /n+Msb5275QxmStpvoH6dPCkTapxN5ksXFirDfWx6nUpuiwpBCT1fFHHk9fDyhl3 DHiQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1687449477; x=1687535877; bh=SwWTzuTjlgQGV QR+2YmginMJTPMuluTbAtrwpUP0wfo=; b=JBsD8nlKZ1C/MCx5MeyjOivYet3sO Vjzv5dtZhLCDbya4bu+BUFevRMrXbmxsA8SbrfDVSFOUF8Q/LA5+TtYWj7l7YNmn XW4yap0yACnl1jNuRjKAZfMsofma7XJIBxw24kI6TcoHlenabieRkz1A5iVYHVq9 yqe7V0+taAmaBaGwux/UWwTgZuahKzD0COB34UmNF59CZWzI6k7X55c96Uph4LRW pgDWz/tbkxzW8LQ+pDEy51FqZqOwkpHdOP/NZCZcND4j9BFwxATD3qVz1BacBB3G P+VsG3YjQhtVgjutN1ShSSBLOBR5bKBKMnde4Qxv29/z3QtYJzM0KWxMQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgeeguddgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3710DB60089; Thu, 22 Jun 2023 11:57:57 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-499-gf27bbf33e2-fm-20230619.001-gf27bbf33 Mime-Version: 1.0 Message-Id: <227ff023-a0fb-476d-ae5c-0733cc6223eb@app.fastmail.com> In-Reply-To: <9c52ce87-f69c-e69c-ec43-6b2cc3b37c4a@linaro.org> References: <20230622101813.3453772-1-arnd@kernel.org> <286cf2d8-2da8-7203-ee53-bf08332fa519@linaro.org> <9c52ce87-f69c-e69c-ec43-6b2cc3b37c4a@linaro.org> Date: Thu, 22 Jun 2023 17:57:36 +0200 From: "Arnd Bergmann" To: "Neil Armstrong" , "Arnd Bergmann" , "Heikki Krogerus" , "Greg Kroah-Hartman" , "Dmitry Baryshkov" Cc: "Bjorn Andersson" , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: typec: nb7vpq904m: add CONFIG_DRM dependency Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, 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: X-Mailing-List: linux-kernel@vger.kernel.org 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