Re: [PATCH] [v3] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m

From: Arnd Bergmann
Date: Fri Sep 07 2018 - 07:26:49 EST


On Fri, Sep 7, 2018 at 11:41 AM Jon Hunter <jonathanh@xxxxxxxxxx> wrote:
>
>
> On 11/07/18 15:43, Arnd Bergmann wrote:
> > 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")
> > Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> 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.

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