Skip to contentSkip to conversation

drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m

PATCH Applied Arnd Bergmann 5 participants 9 messages Jul 11, 2018 – Sep 12, 2018

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

PATCH v3 1/1 drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m

Having DRM_SUN4I built-in but DRM_SUN8I_MIXER as a loadable module results in a link error, as we try to access a symbol from the sun8i_tcon_top.ko module:

ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!

This solves the problem by adding a silent symbol for the tcon_top module, building it as a separate module in exactly the cases that we need it, but in a way that it is reachable by the other modules.

Fixes 57e23de02f48 ("drm/sun4i: DW HDMI: Expand algorithm for possible crtcs")
Fixes ef0cf6441fbb ("drm/sun4i: Add support for traversing graph with TCON TOP")

---
v2: link the tcon top module separately instead of into the mixer
v3: rebased on top of the latest git://anongit.freedesktop.org/drm/drm-misc for-linux-next

---
 drivers/gpu/drm/sun4i/Kconfig         | 7 +++++++
 drivers/gpu/drm/sun4i/Makefile        | 3 ++-
 drivers/gpu/drm/sun4i/sun4i_drv.c     | 3 ++-
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c | 3 ++-
 4 files changed, 13 insertions(+), 3 deletions(-)
drivers/gpu/drm/sun4i/Kconfig +7 -0
index 156a865c3e6d..c2c042287c19 100644
@@ -68,4 +68,11 @@ config DRM_SUN8I_MIXER
 	  graphics mixture and feed graphics to TCON, If M is
 	  selected the module will be called sun8i-mixer.
 
+config DRM_SUN8I_TCON_TOP
+	tristate
+	default DRM_SUN4I if DRM_SUN8I_MIXER!=n
+	help
+	  TCON TOP is responsible for configuring display pipeline for
+	  HTMI, TVE and LCD.
+
 endif
drivers/gpu/drm/sun4i/Makefile +2 -1
index cd27d02c94e2..0eb38ac8e86e 100644
@@ -39,4 +39,5 @@ endif
 obj-$(CONFIG_DRM_SUN4I_HDMI)	+= sun4i-drm-hdmi.o
 obj-$(CONFIG_DRM_SUN6I_DSI)	+= sun6i-dsi.o
 obj-$(CONFIG_DRM_SUN8I_DW_HDMI)	+= sun8i-drm-hdmi.o
-obj-$(CONFIG_DRM_SUN8I_MIXER)	+= sun8i-mixer.o sun8i_tcon_top.o
+obj-$(CONFIG_DRM_SUN8I_MIXER)	+= sun8i-mixer.o
+obj-$(CONFIG_DRM_SUN8I_TCON_TOP) += sun8i_tcon_top.o
drivers/gpu/drm/sun4i/sun4i_drv.c +2 -1
index a15feb807393..03ffbcc98dd0 100644
@@ -216,7 +216,8 @@ static bool sun4i_drv_node_is_tcon_with_ch0(struct device_node *node)
 
 static bool sun4i_drv_node_is_tcon_top(struct device_node *node)
 {
-	return !!of_match_node(sun8i_tcon_top_of_table, node);
+	return IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) &&
+		!!of_match_node(sun8i_tcon_top_of_table, node);
 }
 
 static int compare_of(struct device *dev, void *data)
drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c +2 -1
index 21dc9ebad0b4..e184cb17690b 100644
@@ -44,7 +44,8 @@ sun8i_dw_hdmi_mode_valid(struct drm_connector *connector,
 
 static bool sun8i_dw_hdmi_node_is_tcon_top(struct device_node *node)
 {
-	return !!of_match_node(sun8i_tcon_top_of_table, node);
+	return IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) &&
+		!!of_match_node(sun8i_tcon_top_of_table, node);
 }
 
 static u32 sun8i_dw_hdmi_find_possible_crtcs(struct drm_device *drm,
Signature · 1 line
2.9.0
#1 lore raw
Quoted 6 lines · Arnd Bergmann

Having DRM_SUN4I built-in but DRM_SUN8I_MIXER as a loadable module results in a link error, as we try to access a symbol from the sun8i_tcon_top.ko module:

ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!

Quoted 7 lines

This solves the problem by adding a silent symbol for the tcon_top module, building it as a separate module in exactly the cases that we need it, but in a way that it is reachable by the other modules.

Fixes 57e23de02f48 ("drm/sun4i: DW HDMI: Expand algorithm for possible crtcs")
Fixes ef0cf6441fbb ("drm/sun4i: Add support for traversing graph with TCON TOP")

Applied, thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180712/58c9be1d/attachment.sig>
#2 lore raw
In reply to Arnd Bergmann
Quoted 6 lines · Arnd Bergmann

Having DRM_SUN4I built-in but DRM_SUN8I_MIXER as a loadable module results in a link error, as we try to access a symbol from the sun8i_tcon_top.ko module:

ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!

Quoted 7 lines

This solves the problem by adding a silent symbol for the tcon_top module, building it as a separate module in exactly the cases that we need it, but in a way that it is reachable by the other modules.

Fixes 57e23de02f48 ("drm/sun4i: DW HDMI: Expand algorithm for possible crtcs")
Fixes ef0cf6441fbb ("drm/sun4i: Add support for traversing graph with TCON TOP")

I am seeing the following on today's -next (20180907) as well the last few -next versions for that matter ...

ERROR: "sun8i_tcon_top_de_config" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
ERROR: "sun8i_tcon_top_set_hdmi_src" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!

Seems like this issue has cropped up again as Arnd's fix is present. I am seeing this on ARM64 builds.

Cheers
Jon

Signature · 1 line
nvpublic
#3 lore raw
Quoted 19 lines · Jon Hunter
Quoted 6 lines · Arnd Bergmann

Having DRM_SUN4I built-in but DRM_SUN8I_MIXER as a loadable module results in a link error, as we try to access a symbol from the sun8i_tcon_top.ko module:

ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!

Quoted 7 lines

This solves the problem by adding a silent symbol for the tcon_top module, building it as a separate module in exactly the cases that we need it, but in a way that it is reachable by the other modules.

Fixes 57e23de02f48 ("drm/sun4i: DW HDMI: Expand algorithm for possible crtcs")
Fixes ef0cf6441fbb ("drm/sun4i: Add support for traversing graph with TCON TOP")

I am seeing the following on today's -next (20180907) as well the last few -next versions for that matter ...

Quoted 6 lines

ERROR: "sun8i_tcon_top_de_config" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
ERROR: "sun8i_tcon_top_set_hdmi_src" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!

Seems like this issue has cropped up again as Arnd's fix is present. I am seeing this on ARM64 builds.

I have not started build testing on linux-next since the merge window, but looking at the changes that got queued up, I find commits cf77d79b4e29 ("drm/sun4i: tcon: Add another way for matching mixers with tcon") and 0305189afb32 ("drm/sun4i: tcon: Add support for R40 TCON") that both introduced a reference to the tcon_top file from sun4i_tcon.c.

More IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) checks in
the caller like I did in my patch would help, or alternatively one could decide to give up and just always include the TCON_TOP.

Arnd

#4 lore raw
Quoted 33 lines · Arnd Bergmann
Quoted 19 lines · Jon Hunter
Quoted 6 lines · Arnd Bergmann

Having DRM_SUN4I built-in but DRM_SUN8I_MIXER as a loadable module results in a link error, as we try to access a symbol from the sun8i_tcon_top.ko module:

ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!

Quoted 7 lines

This solves the problem by adding a silent symbol for the tcon_top module, building it as a separate module in exactly the cases that we need it, but in a way that it is reachable by the other modules.

Fixes 57e23de02f48 ("drm/sun4i: DW HDMI: Expand algorithm for possible crtcs")
Fixes ef0cf6441fbb ("drm/sun4i: Add support for traversing graph with TCON TOP")

I am seeing the following on today's -next (20180907) as well the last few -next versions for that matter ...

Quoted 6 lines

ERROR: "sun8i_tcon_top_de_config" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
ERROR: "sun8i_tcon_top_set_hdmi_src" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!

Seems like this issue has cropped up again as Arnd's fix is present. I am seeing this on ARM64 builds.

I have not started build testing on linux-next since the merge window, but looking at the changes that got queued up, I find commits cf77d79b4e29 ("drm/sun4i: tcon: Add another way for matching mixers with tcon") and 0305189afb32 ("drm/sun4i: tcon: Add support for R40 TCON") that both introduced a reference to the tcon_top file from sun4i_tcon.c.

Quoted 3 lines

More IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) checks in
the caller like I did in my patch would help, or alternatively one could decide to give up and just always include the TCON_TOP.

Sorry for the breakage.

Can you test:

----8<----

drivers/gpu/drm/sun4i/sun4i_tcon.c +11 -3
index 4834c90b4912..c78cd35a1294 100644
@@ -974,7 +974,8 @@ static bool sun4i_tcon_connected_to_tcon_top(struct device_node *node)
 
 	remote = of_graph_get_remote_node(node, 0, -1);
 	if (remote) {
-		ret = !!of_match_node(sun8i_tcon_top_of_table, remote);
+		ret = !!(IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) &&
+			 of_match_node(sun8i_tcon_top_of_table, remote));
 		of_node_put(remote);
 	}
 
@@ -1402,13 +1403,20 @@ static int sun8i_r40_tcon_tv_set_mux(struct sun4i_tcon *tcon,
 	if (!pdev)
 		return -EINVAL;
 
-	if (encoder->encoder_type == DRM_MODE_ENCODER_TMDS) {
+	if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) &&
+	    encoder->encoder_type == DRM_MODE_ENCODER_TMDS) {
 		ret = sun8i_tcon_top_set_hdmi_src(&pdev->dev, id);
 		if (ret)
 			return ret;
 	}
 
-	return sun8i_tcon_top_de_config(&pdev->dev, tcon->id, id);
+	if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP)) {
+		ret = sun8i_tcon_top_de_config(&pdev->dev, tcon->id, id);
+		if (ret)
+			return ret;
+	}
+
+	return 0;
 }
 
 static const struct sun4i_tcon_quirks sun4i_a10_quirks = {

----8<----

Thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180907/f78dfb80/attachment.sig>
#8 lore raw
In reply to Jon Hunter
Quoted 18 lines · Jon Hunter
Quoted 6 lines · Arnd Bergmann

Having DRM_SUN4I built-in but DRM_SUN8I_MIXER as a loadable module results in a link error, as we try to access a symbol from the sun8i_tcon_top.ko module:

ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!

Quoted 7 lines

This solves the problem by adding a silent symbol for the tcon_top module, building it as a separate module in exactly the cases that we need it, but in a way that it is reachable by the other modules.

Fixes 57e23de02f48 ("drm/sun4i: DW HDMI: Expand algorithm for possible crtcs")
Fixes ef0cf6441fbb ("drm/sun4i: Add support for traversing graph with TCON TOP")

I am seeing the following on today's -next (20180907) as well the last few -next versions for that matter ...

Quoted 6 lines

ERROR: "sun8i_tcon_top_de_config" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
ERROR: "sun8i_tcon_top_set_hdmi_src" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!

Seems like this issue has cropped up again as Arnd's fix is present. I am seeing this on ARM64 builds.

I do notice these failures on ARM64 builds on linux next 20180906 and 20180907.

11:40:55 | ERROR: "sun8i_tcon_top_de_config"
[drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
11:40:55 | ERROR: "sun8i_tcon_top_set_hdmi_src"
[drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
11:40:55 | ERROR: "sun8i_tcon_top_of_table"
[drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!

Build full log can be found on this link.
https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-next/DISTRO=rpb,MACHINE=dragonboard-410c,label=docker-stretch-amd64/346/console

- Naresh

Quoted 6 lines

Cheers
Jon

--
nvpublic

#5 lore raw
In reply to Maxime Ripard
Quoted 71 lines · Maxime Ripard
Quoted 33 lines · Arnd Bergmann
Quoted 19 lines · Jon Hunter
Quoted 6 lines · Arnd Bergmann

Having DRM_SUN4I built-in but DRM_SUN8I_MIXER as a loadable module results in a link error, as we try to access a symbol from the sun8i_tcon_top.ko module:

ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!

Quoted 7 lines

This solves the problem by adding a silent symbol for the tcon_top module, building it as a separate module in exactly the cases that we need it, but in a way that it is reachable by the other modules.

Fixes 57e23de02f48 ("drm/sun4i: DW HDMI: Expand algorithm for possible crtcs")
Fixes ef0cf6441fbb ("drm/sun4i: Add support for traversing graph with TCON TOP")

I am seeing the following on today's -next (20180907) as well the last few -next versions for that matter ...

Quoted 6 lines

ERROR: "sun8i_tcon_top_de_config" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
ERROR: "sun8i_tcon_top_set_hdmi_src" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!

Seems like this issue has cropped up again as Arnd's fix is present. I am seeing this on ARM64 builds.

I have not started build testing on linux-next since the merge window, but looking at the changes that got queued up, I find commits cf77d79b4e29 ("drm/sun4i: tcon: Add another way for matching mixers with tcon") and 0305189afb32 ("drm/sun4i: tcon: Add support for R40 TCON") that both introduced a reference to the tcon_top file from sun4i_tcon.c.

Quoted 3 lines

More IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) checks in
the caller like I did in my patch would help, or alternatively one could decide to give up and just always include the TCON_TOP.

Sorry for the breakage.

Can you test:

----8<----

drivers/gpu/drm/sun4i/sun4i_tcon.c +5 -3
index 4834c90b4912..c78cd35a1294 100644
@@ -974,7 +974,8 @@ static bool sun4i_tcon_connected_to_tcon_top(struct device_node *node)
 
 	remote = of_graph_get_remote_node(node, 0, -1);
 	if (remote) {
-		ret = !!of_match_node(sun8i_tcon_top_of_table, remote);
+		ret = !!(IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) &&
+			 of_match_node(sun8i_tcon_top_of_table, remote));
 		of_node_put(remote);
 	}
 
@@ -1402,13 +1403,20 @@ static int sun8i_r40_tcon_tv_set_mux(struct sun4i_tcon *tcon,
 	if (!pdev)
 		return -EINVAL;
 
-	if (encoder->encoder_type == DRM_MODE_ENCODER_TMDS) {
+	if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) &&
+	    encoder->encoder_type == DRM_MODE_ENCODER_TMDS) {
 		ret = sun8i_tcon_top_set_hdmi_src(&pdev->dev, id);
 		if (ret)
 			return ret;
 	}
 
-	return sun8i_tcon_top_de_config(&pdev->dev, tcon->id, id);
+	if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP)) {

drivers/gpu/drm/sun4i/sun4i_tcon.c static int sun8i_r40_tcon_tv_set_mux(struct sun4i_tcon *tcon,

Quoted 10 lines
drivers/gpu/drm/sun4i/sun4i_tcon.c +6 -1
+		ret = sun8i_tcon_top_de_config(&pdev->dev, tcon->id, id);
+		if (ret)
+			return ret;
+	}
+
+	return 0;
 }
 
 static const struct sun4i_tcon_quirks sun4i_a10_quirks = {
----8<----

Yes works for me! Thanks, Jon

Signature · 1 line
nvpublic
#6 lore raw
In reply to Maxime Ripard
Quoted 71 lines · Maxime Ripard
Quoted 33 lines · Arnd Bergmann
Quoted 19 lines · Jon Hunter
Quoted 6 lines · Arnd Bergmann

Having DRM_SUN4I built-in but DRM_SUN8I_MIXER as a loadable module results in a link error, as we try to access a symbol from the sun8i_tcon_top.ko module:

ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!

Quoted 7 lines

This solves the problem by adding a silent symbol for the tcon_top module, building it as a separate module in exactly the cases that we need it, but in a way that it is reachable by the other modules.

Fixes 57e23de02f48 ("drm/sun4i: DW HDMI: Expand algorithm for possible crtcs")
Fixes ef0cf6441fbb ("drm/sun4i: Add support for traversing graph with TCON TOP")

I am seeing the following on today's -next (20180907) as well the last few -next versions for that matter ...

Quoted 6 lines

ERROR: "sun8i_tcon_top_de_config" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
ERROR: "sun8i_tcon_top_set_hdmi_src" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!

Seems like this issue has cropped up again as Arnd's fix is present. I am seeing this on ARM64 builds.

I have not started build testing on linux-next since the merge window, but looking at the changes that got queued up, I find commits cf77d79b4e29 ("drm/sun4i: tcon: Add another way for matching mixers with tcon") and 0305189afb32 ("drm/sun4i: tcon: Add support for R40 TCON") that both introduced a reference to the tcon_top file from sun4i_tcon.c.

Quoted 3 lines

More IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) checks in
the caller like I did in my patch would help, or alternatively one could decide to give up and just always include the TCON_TOP.

Sorry for the breakage.

Can you test:

----8<----

drivers/gpu/drm/sun4i/sun4i_tcon.c +5 -3
index 4834c90b4912..c78cd35a1294 100644
@@ -974,7 +974,8 @@ static bool sun4i_tcon_connected_to_tcon_top(struct device_node *node)
 
        remote = of_graph_get_remote_node(node, 0, -1);
        if (remote) {
-               ret = !!of_match_node(sun8i_tcon_top_of_table, remote);
+               ret = !!(IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) &&
+                        of_match_node(sun8i_tcon_top_of_table, remote));
                of_node_put(remote);
        }
 
@@ -1402,13 +1403,20 @@ static int sun8i_r40_tcon_tv_set_mux(struct sun4i_tcon *tcon,
        if (!pdev)
                return -EINVAL;
 
-       if (encoder->encoder_type == DRM_MODE_ENCODER_TMDS) {
+       if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) &&
+           encoder->encoder_type == DRM_MODE_ENCODER_TMDS) {
                ret = sun8i_tcon_top_set_hdmi_src(&pdev->dev, id);
                if (ret)
                        return ret;
        }
 
-       return sun8i_tcon_top_de_config(&pdev->dev, tcon->id, id);
+       if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP)) {

drivers/gpu/drm/sun4i/sun4i_tcon.c static int sun8i_r40_tcon_tv_set_mux(struct sun4i_tcon *tcon,

Quoted 10 lines
drivers/gpu/drm/sun4i/sun4i_tcon.c +6 -1
+               ret = sun8i_tcon_top_de_config(&pdev->dev, tcon->id, id);
+               if (ret)
+                       return ret;
+       }
+
+       return 0;
 }
 
 static const struct sun4i_tcon_quirks sun4i_a10_quirks = {
----8<----

Works for me, and still broken in todays next

Quoted 8 lines

Thanks!
Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#7 lore raw
Quoted 80 lines · Matt Hart
Quoted 79 lines · Maxime Ripard
Quoted 33 lines · Arnd Bergmann
Quoted 19 lines · Jon Hunter
Quoted 6 lines · Arnd Bergmann

Having DRM_SUN4I built-in but DRM_SUN8I_MIXER as a loadable module results in a link error, as we try to access a symbol from the sun8i_tcon_top.ko module:

ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined!

Quoted 7 lines

This solves the problem by adding a silent symbol for the tcon_top module, building it as a separate module in exactly the cases that we need it, but in a way that it is reachable by the other modules.

Fixes 57e23de02f48 ("drm/sun4i: DW HDMI: Expand algorithm for possible crtcs")
Fixes ef0cf6441fbb ("drm/sun4i: Add support for traversing graph with TCON TOP")

I am seeing the following on today's -next (20180907) as well the last few -next versions for that matter ...

Quoted 6 lines

ERROR: "sun8i_tcon_top_de_config" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
ERROR: "sun8i_tcon_top_set_hdmi_src" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!

Seems like this issue has cropped up again as Arnd's fix is present. I am seeing this on ARM64 builds.

I have not started build testing on linux-next since the merge window, but looking at the changes that got queued up, I find commits cf77d79b4e29 ("drm/sun4i: tcon: Add another way for matching mixers with tcon") and 0305189afb32 ("drm/sun4i: tcon: Add support for R40 TCON") that both introduced a reference to the tcon_top file from sun4i_tcon.c.

Quoted 3 lines

More IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) checks in
the caller like I did in my patch would help, or alternatively one could decide to give up and just always include the TCON_TOP.

Sorry for the breakage.

Can you test:

----8<----

drivers/gpu/drm/sun4i/sun4i_tcon.c +11 -3
index 4834c90b4912..c78cd35a1294 100644
@@ -974,7 +974,8 @@ static bool sun4i_tcon_connected_to_tcon_top(struct device_node *node)
 
        remote = of_graph_get_remote_node(node, 0, -1);
        if (remote) {
-               ret = !!of_match_node(sun8i_tcon_top_of_table, remote);
+               ret = !!(IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) &&
+                        of_match_node(sun8i_tcon_top_of_table, remote));
                of_node_put(remote);
        }
 
@@ -1402,13 +1403,20 @@ static int sun8i_r40_tcon_tv_set_mux(struct sun4i_tcon *tcon,
        if (!pdev)
                return -EINVAL;
 
-       if (encoder->encoder_type == DRM_MODE_ENCODER_TMDS) {
+       if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) &&
+           encoder->encoder_type == DRM_MODE_ENCODER_TMDS) {
                ret = sun8i_tcon_top_set_hdmi_src(&pdev->dev, id);
                if (ret)
                        return ret;
        }
 
-       return sun8i_tcon_top_de_config(&pdev->dev, tcon->id, id);
+       if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP)) {
+               ret = sun8i_tcon_top_de_config(&pdev->dev, tcon->id, id);
+               if (ret)
+                       return ret;
+       }
+
+       return 0;
 }
 
Quoted 4 lines

drivers/gpu/drm/sun4i/sun4i_tcon.c static int sun8i_r40_tcon_tv_set_mux(struct sun4i_tcon *tcon,

Quoted 2 lines
drivers/gpu/drm/sun4i/sun4i_tcon.c +0 -1
 static const struct sun4i_tcon_quirks sun4i_a10_quirks = {
----8<----

Works for me, and still broken in todays next

I pushed that fix, thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180912/6d5097b9/attachment.sig>