Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1105292pxb; Wed, 6 Apr 2022 08:51:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmb6oIY49n+olcT9IxLU/FbQfZg/CuAxUPGh0K/7NoV6YmVxb3bEYa0VXzzpa4pp7Od/iO X-Received: by 2002:a17:902:b590:b0:153:a243:3331 with SMTP id a16-20020a170902b59000b00153a2433331mr9631163pls.129.1649260291662; Wed, 06 Apr 2022 08:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649260291; cv=none; d=google.com; s=arc-20160816; b=kt0zVNEeaaE6Sb8pA6gcpIMhRX6i4LGgXrLQT8CSCCljjbO1B3I+iaunhRM5z5rBlb Icgm6vTyFynFQPMj3TQtmKUCSn2DX64XcoxG2zqdodLD/KgoAu/RiCzRZ7pjWbQPFs7N 9yyoCjUV+6Ly5YaPYEN8uTvU1QG32EGedyCfCLygShB1Z2UqK4EEtT6Wb/RIkDuLU1F8 bbo4BGcK3WKzn8bHragXpGK8kBTKpJYnAZ1RIGBUj0OjI57leI1EG54cCLGYdyAy89ZT uHZmPZF/0pcaBWhMDRKWFGRF50AZKbm/ZxYXSnTrnjFhfFBxcFRdnpA45MluSlvuc/cH qsQg== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=rzh+YVo8AjmVzXYtwCOyrTTWQiWeb9VJ0DWPZZBZogk=; b=Co1LhMyii3LN8+j3asBYZZ0iRGwQTiTkoLaEE8Kk23E78ayQKstU8iUw2uNEEhGxU+ huLft52S35gSkkLA4su0ERlHrHzJlIHnJQ6OstKZChaZmIVSeT7SA3xLw+f+Qa1IsOCm lobqxbWpSvXUf5Mj67V4q7lC4cvK7YrUcKUhe2tnIaBUVwphoH7kuUFoY/LC2Gge3VOA fuNum5hr+Mm22K/eTnv89N66DqNQ6vUiZrAwSPecEbpuykHkfFJ0GFoUh1nMz18nJyJb TN1PsT8x/CjBRTMt443WChIoR2WU2wSPkEL7Rr8SU8UFGICDKO1+8z+PKiV34DOZto7L PLag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b="Iwl/Hcis"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=oJmVUCYa; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w37-20020a634765000000b003989e3ed584si15890831pgk.856.2022.04.06.08.51.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 08:51:31 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b="Iwl/Hcis"; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=oJmVUCYa; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 25A1835785E; Wed, 6 Apr 2022 07:10:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234630AbiDFOLp (ORCPT + 99 others); Wed, 6 Apr 2022 10:11:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234526AbiDFOLH (ORCPT ); Wed, 6 Apr 2022 10:11:07 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5837428253F for ; Wed, 6 Apr 2022 03:06:48 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 3EECF3202069; Wed, 6 Apr 2022 06:06:15 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 06 Apr 2022 06:06:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc: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=fm3; bh=rzh+YVo8AjmVzXYtwCOyrTTWQiWeb9VJ0DWPZZ BZogk=; b=Iwl/Hcis915YuxuSYdtKUaM/emcwdNwLUmOhK6Uz82oFFtNQo63baz Ff5WVmMH4CgIgB7Mjfc5roxPZ0JdXi0pY34k5ZIeLjH3enh4PdbqE3fxuGXU4pHV 3hdnWggWcpKE6ptGCcatiyrWEHik3RVX22Vpulup6f6z/FberTjC3fiBs/BaUMP2 niwV6K24YkECzfaWDbiKrXjqT+cuw3wK/0wd/7NWxLp4iZdqkn59yFYerh4SfVtl QvKs0QQ0rjf86CoCz+GhX9FldByRRlCzIVxn6PQLtl8fE/vvyg9uP7RXCDhZHRXa 9AbPtGKycpgEyc73ClOkJmrdbu7HaqGg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date: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=fm3; bh=rzh+YVo8AjmVzXYtw COyrTTWQiWeb9VJ0DWPZZBZogk=; b=oJmVUCYa8RfGhDk7IDvEzqizOrCriQbxv WdMHs6fMqIyIi3LPz6EI/scjODZShthbGt7AcwVMnlmsQwqNKQbqtrk7p/PcipWC ecVAyKG61Np/F1E+MIxcWHz3ZPHLYas2VHt9DmPa2RBmZxClg91IlIiAr4Q53YuR l/y5XAFHyRvZh8n9FDiyNhq8VW9Q2oQT3GfmHfgIJZkK0YLqP6fEK1t1sFSThi4E YHFU+5HU0XY6nGnJXU/voDMb2tmchA5A6ZagEFAYDI+MDrQ4knCFrAg3M90fVEbw 2Jd5MVa9ixw40lX5/Vcm7UzV83wl3vCgbZFRkRAfy16QetfoY1Btg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudejiedgvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddunecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepuddvudfhkeekhefgffetffelgffftdehffduffegveetffehueeivddvjedv gfevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Apr 2022 06:06:14 -0400 (EDT) Date: Wed, 6 Apr 2022 12:06:12 +0200 From: Maxime Ripard To: "Zhengbin (OSKernel)" Cc: emma@anholt.net, airlied@linux.ie, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, tangyizhou@huawei.com Subject: Re: [PATCH v2 -next] drm/vc4: Fix build error when CONFIG_DRM_VC4=y && CONFIG_RASPBERRYPI_FIRMWARE=m Message-ID: <20220406100612.2nuvjcc2oxo54n5j@houat> References: <20220325021831.2812735-1-zhengbin13@huawei.com> <20220325130541.tjxq4kjgmkaz32en@houat> <601a9682-6afc-d87b-cfa7-5c683271f7a5@huawei.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="m2ydzgbnjwzzthnm" Content-Disposition: inline In-Reply-To: <601a9682-6afc-d87b-cfa7-5c683271f7a5@huawei.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 --m2ydzgbnjwzzthnm Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon, Mar 28, 2022 at 10:22:11AM +0800, Zhengbin (OSKernel) wrote: > On 2022/3/25 21:05, Maxime Ripard wrote: > > On Fri, Mar 25, 2022 at 10:18:31AM +0800, Zheng Bin wrote: > > > If CONFIG_DRM_VC4=3Dy, CONFIG_RASPBERRYPI_FIRMWARE=3Dm, CONFIG_COMPIL= E_TEST=3Dn, > > > bulding fails: > > >=20 > > > drivers/gpu/drm/vc4/vc4_drv.o: In function `vc4_drm_bind': > > > vc4_drv.c:(.text+0x320): undefined reference to `rpi_firmware_get' > > > vc4_drv.c:(.text+0x320): relocation truncated to fit: R_AARCH64_CALL2= 6 against undefined symbol `rpi_firmware_get' > > > vc4_drv.c:(.text+0x34c): undefined reference to `rpi_firmware_propert= y' > > > vc4_drv.c:(.text+0x34c): relocation truncated to fit: R_AARCH64_CALL2= 6 against undefined symbol `rpi_firmware_property' > > > vc4_drv.c:(.text+0x354): undefined reference to `rpi_firmware_put' > > > vc4_drv.c:(.text+0x354): relocation truncated to fit: R_AARCH64_CALL2= 6 against undefined symbol `rpi_firmware_put' > > >=20 > > > Make DRM_VC4 depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST to fix t= his. > > >=20 > > > Fixes: c406ad5e4a85 ("drm/vc4: Notify the firmware when DRM is in cha= rge") > > > Reported-by: Hulk Robot > > > Signed-off-by: Zheng Bin > > > --- > > > v2: follow Maxime's advise, add RASPBERRYPI_FIRMWARE as an additional= depends > > > drivers/gpu/drm/vc4/Kconfig | 1 + > > > 1 file changed, 1 insertion(+) > > >=20 > > > diff --git a/drivers/gpu/drm/vc4/Kconfig b/drivers/gpu/drm/vc4/Kconfig > > > index de3424fed2fc..92d74ba7c449 100644 > > > --- a/drivers/gpu/drm/vc4/Kconfig > > > +++ b/drivers/gpu/drm/vc4/Kconfig > > > @@ -2,6 +2,7 @@ > > > config DRM_VC4 > > > tristate "Broadcom VC4 Graphics" > > > depends on ARCH_BCM || ARCH_BCM2835 || COMPILE_TEST > > > + depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST > > Why do we need the || COMPILE_TEST here? > >=20 > > The rpi_firmware_get, _property and _put functions aren't define if > > RASPBERRYPI_FIRMWARE, so we need that dependency every time, even if > > COMPILE_TEST is set? >=20 > include/soc/bcm2835/raspberrypi-firmware.h >=20 > #if IS_ENABLED(CONFIG_RASPBERRYPI_FIRMWARE) >=20 > struct rpi_firmware *rpi_firmware_get(struct device_node > *firmware_node);/_property/_put >=20 > #else=A0=A0=A0 -->empty function >=20 > =A0static inline struct rpi_firmware *rpi_firmware_get(struct device_node > *firmware_node)/_property/_put > { > =A0=A0=A0=A0=A0=A0=A0=A0 return NULL; > =A0} > #endif >=20 >=20 > We can refer to drivers/pwm/Kconfig >=20 > config PWM_RASPBERRYPI_POE > =A0=A0=A0=A0=A0=A0=A0=A0 tristate "Raspberry Pi Firwmware PoE Hat PWM sup= port" > =A0=A0=A0=A0=A0=A0=A0=A0 # Make sure not 'y' when RASPBERRYPI_FIRMWARE is= 'm'. This can only > =A0=A0=A0=A0=A0=A0=A0 # happen when COMPILE_TEST=3Dy, hence the added !RA= SPBERRYPI_FIRMWARE. > =A0=A0=A0=A0=A0=A0=A0=A0 depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST= && > !RASPBERRYPI_FIRMWARE)=A0 -->There is no need to add (&& > !RASPBERRYPI_FIRMWARE) Oh, so you're fixing the case where vc4 would be built-in, but the firmware driver a module? I guess that makes sense, but the comment definitely helps there. And the (COMPILE_TEST && !RASPBERRYPI_FIRMWARE) is also needed, since it wouldn't fix the issue you're trying to fix for COMPILE_TEST otherwise. Maxime --m2ydzgbnjwzzthnm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYk1mFAAKCRDj7w1vZxhR xT80AQC7Tm+NmNDitAW/WPTe7zEurlBuKyI80CaozozVmnmeUgD/ZdkwChF2xf3c k1aWDhJy5q1hEMUagUb6QAuZLV0lMAM= =wzKX -----END PGP SIGNATURE----- --m2ydzgbnjwzzthnm--