Skip to contentSkip to conversation

lima, panfrost: multiple definition of `of_devfreq_cooling_register_power'

DISCUSSION Thomas Zimmermann 2 participants 4 messages Apr 2, 2020 – Apr 4, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

building lima and panfrost drivers from drm-tip, I currently get the following linker error

Quoted 2 lines

make clean
make

[...]
LD vmlinux.o
arm-suse-linux-gnueabi-ld: drivers/gpu/drm/panfrost
/panfrost_devfreq.o: in function `of_devfreq_cooling_register_power':
panfrost_devfreq.c:(.text+0x18c): multiple definition of

	`of_devfreq_cooling_register_power'; drivers/gpu/drm/lima
	/lima_devfreq.o:lima_devfreq.c:(.text+0x1a0): first defined here

make[1]: *** [/home/tzimmermann/Projekte/linux/Makefile:1078: vmlinux]
Error 1
make[1]: Leaving directory '/home/tzimmermann/Projekte/linux/build-
arm'
make: *** [Makefile:180: sub-make] Error 2

Seems related to

commit 1996970773a323533e1cc1b6b97f00a95d675f32
Author: Martin Blumenstingl <[email protected]>
Date: Thu Mar 19 21:34:27 2020 +0100

drm/lima: Add optional devfreq and cooling device support

https://cgit.freedesktop.org/drm/drm-tip/commit/?id=1996970773a323533e1cc1b6b97f00a95d675f32

Best regards
Thomas

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

Hi Thomas,

Quoted 14 lines · Thomas Zimmermann

Hi,

building lima and panfrost drivers from drm-tip, I currently get the following linker error

Quoted 2 lines

make clean
make

[...]
LD vmlinux.o
arm-suse-linux-gnueabi-ld: drivers/gpu/drm/panfrost
/panfrost_devfreq.o: in function `of_devfreq_cooling_register_power':
panfrost_devfreq.c:(.text+0x18c): multiple definition of

Quoted 7 lines
        `of_devfreq_cooling_register_power'; drivers/gpu/drm/lima
        /lima_devfreq.o:lima_devfreq.c:(.text+0x1a0): first defined here

make[1]: *** [/home/tzimmermann/Projekte/linux/Makefile:1078: vmlinux]
Error 1
make[1]: Leaving directory '/home/tzimmermann/Projekte/linux/build-
arm'
make: *** [Makefile:180: sub-make] Error 2

can you please try building again with the attached patch?

Quoted 9 lines

Seems related to

commit 1996970773a323533e1cc1b6b97f00a95d675f32
Author: Martin Blumenstingl <[email protected]>
Date: Thu Mar 19 21:34:27 2020 +0100

drm/lima: Add optional devfreq and cooling device support

https://cgit.freedesktop.org/drm/drm-tip/commit/?id=1996970773a323533e1cc1b6b97f00a95d675f32

it's also possible that this was originally caused by a76caf55e5b356 ("thermal: Add devfreq cooling") and that my commit only exposes this bug

Thank you in advance!
Regards
Martin

arch/arm/boot/dts/meson8.dtsi +8 -0
index a06a9fb35d72..94a487e05d35 100644
@@ -107,18 +107,22 @@ opp-816000000 {
 			opp-microvolt = <875000>;
 		};
 		opp-1008000000 {
+			status = "disabled";
 			opp-hz = /bits/ 64 <1008000000>;
 			opp-microvolt = <925000>;
 		};
 		opp-1200000000 {
+			status = "disabled";
 			opp-hz = /bits/ 64 <1200000000>;
 			opp-microvolt = <975000>;
 		};
 		opp-1416000000 {
+			status = "disabled";
 			opp-hz = /bits/ 64 <1416000000>;
 			opp-microvolt = <1025000>;
 		};
 		opp-1608000000 {
+			status = "disabled";
 			opp-hz = /bits/ 64 <1608000000>;
 			opp-microvolt = <1100000>;
 		};
@@ -144,19 +148,23 @@ opp-182142857 {
 		opp-318750000 {
 			opp-hz = /bits/ 64 <318750000>;
 			opp-microvolt = <1150000>;
+			status = "disabled";
 		};
 		opp-425000000 {
 			opp-hz = /bits/ 64 <425000000>;
 			opp-microvolt = <1150000>;
+			status = "disabled";
 		};
 		opp-510000000 {
 			opp-hz = /bits/ 64 <510000000>;
 			opp-microvolt = <1150000>;
+			status = "disabled";
 		};
 		opp-637500000 {
 			opp-hz = /bits/ 64 <637500000>;
 			opp-microvolt = <1150000>;
 			turbo-mode;
+			status = "disabled";
 		};
 	};
 
arch/arm/boot/dts/meson8b.dtsi +0 -1
index 2b49a6bb8718..eaf4d61e5043 100644
@@ -349,7 +349,6 @@ vpu: vpu@100000 {
 			nvmem-cell-names = "cvbs_trimming";
 			#address-cells = <1>;
 			#size-cells = <0>;
-			status = "disabled";
 
 			/* CVBS VDAC output port */
 			cvbs_vdac_port: port@0 {
include/linux/devfreq_cooling.h +1 -1
index 4635f95000a4..79a6e37a1d6f 100644
@@ -75,7 +75,7 @@ void devfreq_cooling_unregister(struct thermal_cooling_device *dfc);
 
 #else /* !CONFIG_DEVFREQ_THERMAL */
 
-struct thermal_cooling_device *
+static inline struct thermal_cooling_device *
 of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
 				  struct devfreq_cooling_power *dfc_power)
 {

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

Hi Martin

Am 02.04.20 um 09:39 schrieb Martin Blumenstingl:

Quoted 24 lines

Hi Thomas,

Quoted 14 lines · Thomas Zimmermann

Hi,

building lima and panfrost drivers from drm-tip, I currently get the following linker error

Quoted 2 lines

make clean
make

[...]
LD vmlinux.o
arm-suse-linux-gnueabi-ld: drivers/gpu/drm/panfrost
/panfrost_devfreq.o: in function `of_devfreq_cooling_register_power':
panfrost_devfreq.c:(.text+0x18c): multiple definition of

Quoted 7 lines
        `of_devfreq_cooling_register_power'; drivers/gpu/drm/lima
        /lima_devfreq.o:lima_devfreq.c:(.text+0x1a0): first defined here

make[1]: *** [/home/tzimmermann/Projekte/linux/Makefile:1078: vmlinux]
Error 1
make[1]: Leaving directory '/home/tzimmermann/Projekte/linux/build-
arm'
make: *** [Makefile:180: sub-make] Error 2

Quoted 1 line

can you please try building again with the attached patch?

Yes, fixes the bug. Thanks for responding quickly.

Quoted 7 lines
Quoted 7 lines

Seems related to

commit 1996970773a323533e1cc1b6b97f00a95d675f32
Author: Martin Blumenstingl <[email protected]>
Date: Thu Mar 19 21:34:27 2020 +0100

Quoted 6 lines
Quoted 3 lines

drm/lima: Add optional devfreq and cooling device support

https://cgit.freedesktop.org/drm/drm-tip/commit/?id=1996970773a323533e1cc1b6b97f00a95d675f32

it's also possible that this was originally caused by a76caf55e5b356 ("thermal: Add devfreq cooling") and that my commit only exposes this bug

True. This must have been an oversight in the original patch, as the other placeholder functions have their static inline declared already.

Best regards
Thomas

Quoted 6 lines

Thank you in advance!
Regards
Martin

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 28 lines · Thomas Zimmermann

Hi Martin

Am 02.04.20 um 09:39 schrieb Martin Blumenstingl:

Quoted 24 lines

Hi Thomas,

Quoted 21 lines · Thomas Zimmermann

Hi,

building lima and panfrost drivers from drm-tip, I currently get the following linker error

Quoted 2 lines

make clean
make

[...]
LD vmlinux.o
arm-suse-linux-gnueabi-ld: drivers/gpu/drm/panfrost
/panfrost_devfreq.o: in function `of_devfreq_cooling_register_power':
panfrost_devfreq.c:(.text+0x18c): multiple definition of

        `of_devfreq_cooling_register_power'; drivers/gpu/drm/lima
        /lima_devfreq.o:lima_devfreq.c:(.text+0x1a0): first defined here

make[1]: *** [/home/tzimmermann/Projekte/linux/Makefile:1078: vmlinux]
Error 1
make[1]: Leaving directory '/home/tzimmermann/Projekte/linux/build-
arm'
make: *** [Makefile:180: sub-make] Error 2

Quoted 3 lines
Quoted 1 line

can you please try building again with the attached patch?

Yes, fixes the bug. Thanks for responding quickly.

I just sent a fix to the correct mailing lists: [0] it would be awesome if you could give it your "Tested-by"

Regards
Martin

[0] https://lore.kernel.org/patchwork/patch/1220292/
_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel