From: jonathanh@nvidia.com (Jon Hunter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] [v3] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
Date: Mon, 10 Sep 2018 13:35:33 +0100 [thread overview]
Message-ID: <27a7c704-26c9-5b51-68d4-e6b57b30cadf@nvidia.com> (raw)
In-Reply-To: <20180907114255.7j7r6wzolnz5qkk7@flea>
On 07/09/18 12:42, Maxime Ripard wrote:
> On Fri, Sep 07, 2018 at 01:26:30PM +0200, Arnd Bergmann wrote:
>> On Fri, Sep 7, 2018 at 11:41 AM Jon Hunter <jonathanh@nvidia.com> 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@arndb.de>
>>> 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.
>
> Sorry for the breakage.
>
> Can you test:
>
> ----8<----
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index 4834c90b4912..c78cd35a1294 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -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<----
Yes works for me! Thanks, Jon
--
nvpublic
next prev parent reply other threads:[~2018-09-10 12:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-11 14:43 [PATCH] [v3] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m Arnd Bergmann
2018-07-12 7:35 ` Maxime Ripard
2018-09-07 9:41 ` Jon Hunter
2018-09-07 11:26 ` Arnd Bergmann
2018-09-07 11:42 ` Maxime Ripard
2018-09-10 12:35 ` Jon Hunter [this message]
2018-09-12 11:25 ` Matt Hart
2018-09-12 14:34 ` Maxime Ripard
2018-09-07 17:23 ` Naresh Kamboju
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=27a7c704-26c9-5b51-68d4-e6b57b30cadf@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).