* [PATCH v2 -next] drm/vc4: Fix build error when CONFIG_DRM_VC4=y && CONFIG_RASPBERRYPI_FIRMWARE=m
@ 2022-03-25 2:18 Zheng Bin
2022-03-25 13:05 ` Maxime Ripard
0 siblings, 1 reply; 4+ messages in thread
From: Zheng Bin @ 2022-03-25 2:18 UTC (permalink / raw)
To: emma, mripard, maxime, airlied, daniel, dri-devel, linux-kernel
Cc: zhengbin13, tangyizhou
If CONFIG_DRM_VC4=y, CONFIG_RASPBERRYPI_FIRMWARE=m, CONFIG_COMPILE_TEST=n,
bulding fails:
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_CALL26 against undefined symbol `rpi_firmware_get'
vc4_drv.c:(.text+0x34c): undefined reference to `rpi_firmware_property'
vc4_drv.c:(.text+0x34c): relocation truncated to fit: R_AARCH64_CALL26 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_CALL26 against undefined symbol `rpi_firmware_put'
Make DRM_VC4 depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST to fix this.
Fixes: c406ad5e4a85 ("drm/vc4: Notify the firmware when DRM is in charge")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
---
v2: follow Maxime's advise, add RASPBERRYPI_FIRMWARE as an additional depends
drivers/gpu/drm/vc4/Kconfig | 1 +
1 file changed, 1 insertion(+)
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
depends on DRM
depends on SND && SND_SOC
depends on COMMON_CLK
--
2.31.1
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH v2 -next] drm/vc4: Fix build error when CONFIG_DRM_VC4=y && CONFIG_RASPBERRYPI_FIRMWARE=m 2022-03-25 2:18 [PATCH v2 -next] drm/vc4: Fix build error when CONFIG_DRM_VC4=y && CONFIG_RASPBERRYPI_FIRMWARE=m Zheng Bin @ 2022-03-25 13:05 ` Maxime Ripard 2022-03-28 2:22 ` Zhengbin (OSKernel) 0 siblings, 1 reply; 4+ messages in thread From: Maxime Ripard @ 2022-03-25 13:05 UTC (permalink / raw) To: Zheng Bin; +Cc: emma, airlied, daniel, dri-devel, linux-kernel, tangyizhou [-- Attachment #1: Type: text/plain, Size: 1824 bytes --] Hi, On Fri, Mar 25, 2022 at 10:18:31AM +0800, Zheng Bin wrote: > If CONFIG_DRM_VC4=y, CONFIG_RASPBERRYPI_FIRMWARE=m, CONFIG_COMPILE_TEST=n, > bulding fails: > > 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_CALL26 against undefined symbol `rpi_firmware_get' > vc4_drv.c:(.text+0x34c): undefined reference to `rpi_firmware_property' > vc4_drv.c:(.text+0x34c): relocation truncated to fit: R_AARCH64_CALL26 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_CALL26 against undefined symbol `rpi_firmware_put' > > Make DRM_VC4 depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST to fix this. > > Fixes: c406ad5e4a85 ("drm/vc4: Notify the firmware when DRM is in charge") > Reported-by: Hulk Robot <hulkci@huawei.com> > Signed-off-by: Zheng Bin <zhengbin13@huawei.com> > --- > v2: follow Maxime's advise, add RASPBERRYPI_FIRMWARE as an additional depends > drivers/gpu/drm/vc4/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > 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? 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? Maxime [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 -next] drm/vc4: Fix build error when CONFIG_DRM_VC4=y && CONFIG_RASPBERRYPI_FIRMWARE=m 2022-03-25 13:05 ` Maxime Ripard @ 2022-03-28 2:22 ` Zhengbin (OSKernel) 2022-04-06 10:06 ` Maxime Ripard 0 siblings, 1 reply; 4+ messages in thread From: Zhengbin (OSKernel) @ 2022-03-28 2:22 UTC (permalink / raw) To: Maxime Ripard; +Cc: emma, airlied, daniel, dri-devel, linux-kernel, tangyizhou On 2022/3/25 21:05, Maxime Ripard wrote: > Hi, > > On Fri, Mar 25, 2022 at 10:18:31AM +0800, Zheng Bin wrote: >> If CONFIG_DRM_VC4=y, CONFIG_RASPBERRYPI_FIRMWARE=m, CONFIG_COMPILE_TEST=n, >> bulding fails: >> >> 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_CALL26 against undefined symbol `rpi_firmware_get' >> vc4_drv.c:(.text+0x34c): undefined reference to `rpi_firmware_property' >> vc4_drv.c:(.text+0x34c): relocation truncated to fit: R_AARCH64_CALL26 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_CALL26 against undefined symbol `rpi_firmware_put' >> >> Make DRM_VC4 depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST to fix this. >> >> Fixes: c406ad5e4a85 ("drm/vc4: Notify the firmware when DRM is in charge") >> Reported-by: Hulk Robot <hulkci@huawei.com> >> Signed-off-by: Zheng Bin <zhengbin13@huawei.com> >> --- >> v2: follow Maxime's advise, add RASPBERRYPI_FIRMWARE as an additional depends >> drivers/gpu/drm/vc4/Kconfig | 1 + >> 1 file changed, 1 insertion(+) >> >> 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? > > 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? include/soc/bcm2835/raspberrypi-firmware.h #if IS_ENABLED(CONFIG_RASPBERRYPI_FIRMWARE) struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node);/_property/_put #else -->empty function static inline struct rpi_firmware *rpi_firmware_get(struct device_node *firmware_node)/_property/_put { return NULL; } #endif We can refer to drivers/pwm/Kconfig config PWM_RASPBERRYPI_POE tristate "Raspberry Pi Firwmware PoE Hat PWM support" # Make sure not 'y' when RASPBERRYPI_FIRMWARE is 'm'. This can only # happen when COMPILE_TEST=y, hence the added !RASPBERRYPI_FIRMWARE. depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && !RASPBERRYPI_FIRMWARE) -->There is no need to add (&& !RASPBERRYPI_FIRMWARE) > > Maxime ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 -next] drm/vc4: Fix build error when CONFIG_DRM_VC4=y && CONFIG_RASPBERRYPI_FIRMWARE=m 2022-03-28 2:22 ` Zhengbin (OSKernel) @ 2022-04-06 10:06 ` Maxime Ripard 0 siblings, 0 replies; 4+ messages in thread From: Maxime Ripard @ 2022-04-06 10:06 UTC (permalink / raw) To: Zhengbin (OSKernel) Cc: emma, airlied, daniel, dri-devel, linux-kernel, tangyizhou [-- Attachment #1: Type: text/plain, Size: 3246 bytes --] 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=y, CONFIG_RASPBERRYPI_FIRMWARE=m, CONFIG_COMPILE_TEST=n, > > > bulding fails: > > > > > > 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_CALL26 against undefined symbol `rpi_firmware_get' > > > vc4_drv.c:(.text+0x34c): undefined reference to `rpi_firmware_property' > > > vc4_drv.c:(.text+0x34c): relocation truncated to fit: R_AARCH64_CALL26 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_CALL26 against undefined symbol `rpi_firmware_put' > > > > > > Make DRM_VC4 depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST to fix this. > > > > > > Fixes: c406ad5e4a85 ("drm/vc4: Notify the firmware when DRM is in charge") > > > Reported-by: Hulk Robot <hulkci@huawei.com> > > > Signed-off-by: Zheng Bin <zhengbin13@huawei.com> > > > --- > > > v2: follow Maxime's advise, add RASPBERRYPI_FIRMWARE as an additional depends > > > drivers/gpu/drm/vc4/Kconfig | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > 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? > > > > 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? > > include/soc/bcm2835/raspberrypi-firmware.h > > #if IS_ENABLED(CONFIG_RASPBERRYPI_FIRMWARE) > > struct rpi_firmware *rpi_firmware_get(struct device_node > *firmware_node);/_property/_put > > #else -->empty function > > static inline struct rpi_firmware *rpi_firmware_get(struct device_node > *firmware_node)/_property/_put > { > return NULL; > } > #endif > > > We can refer to drivers/pwm/Kconfig > > config PWM_RASPBERRYPI_POE > tristate "Raspberry Pi Firwmware PoE Hat PWM support" > # Make sure not 'y' when RASPBERRYPI_FIRMWARE is 'm'. This can only > # happen when COMPILE_TEST=y, hence the added !RASPBERRYPI_FIRMWARE. > depends on RASPBERRYPI_FIRMWARE || (COMPILE_TEST && > !RASPBERRYPI_FIRMWARE) -->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 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-04-06 14:09 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-03-25 2:18 [PATCH v2 -next] drm/vc4: Fix build error when CONFIG_DRM_VC4=y && CONFIG_RASPBERRYPI_FIRMWARE=m Zheng Bin 2022-03-25 13:05 ` Maxime Ripard 2022-03-28 2:22 ` Zhengbin (OSKernel) 2022-04-06 10:06 ` Maxime Ripard
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®