linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Philippe CORNU <philippe.cornu@foss.st.com>
To: Jagan Teki <jagan@amarulasolutions.com>,
	Yannick Fertre <yannick.fertre@foss.st.com>,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: <dri-devel@lists.freedesktop.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-amarula@amarulasolutions.com>
Subject: Re: [PATCH] drm/stm: ltdc: Silence -EPROBE_DEFER till bridge attached
Date: Tue, 13 Jul 2021 18:43:24 +0200	[thread overview]
Message-ID: <9008c9b8-ae48-588c-cfb4-cda7323e15dd@foss.st.com> (raw)
In-Reply-To: <20210704135914.268308-1-jagan@amarulasolutions.com>

Hi Jagan,

On 7/4/21 3:59 PM, Jagan Teki wrote:
> As dw-mipi-dsi supported all possible ways to find the DSI
> devices. It can take multiple iterations for ltdc to find
> all components attached to the DSI bridge.
> 
> The current ltdc driver failed to find the endpoint as
> it returned -EINVAL for the first iteration itself. This leads
> to following error:
> 
> [    3.099289] [drm:ltdc_load] *ERROR* init encoder endpoint 0
> 
> So, check the return value and cleanup the encoder only if it's
> not -EPROBE_DEFER. This make all components in the attached DSI
> bridge found properly.
> 
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
>   drivers/gpu/drm/stm/ltdc.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
> index 08b71248044d..95e983d3ffb5 100644
> --- a/drivers/gpu/drm/stm/ltdc.c
> +++ b/drivers/gpu/drm/stm/ltdc.c
> @@ -1122,8 +1122,9 @@ static int ltdc_encoder_init(struct drm_device *ddev, struct drm_bridge *bridge)
>   
>   	ret = drm_bridge_attach(encoder, bridge, NULL, 0);
>   	if (ret) {
> -		drm_encoder_cleanup(encoder);
> -		return -EINVAL;
> +		if (ret != -EPROBE_DEFER)
> +			drm_encoder_cleanup(encoder);

Many thanks for your patch.

This means that we are counting on the future success of the deferred 
probe because we do not clean the encoder...
However, Yannick gave his "Tested-by" and this patch seems useful so

Acked-by: Philippe Cornu <philippe.cornu@foss.st.com>

I will merge it friday or early next week,

Thank you
Philippe :-)


> +		return ret;
>   	}
>   
>   	DRM_DEBUG_DRIVER("Bridge encoder:%d created\n", encoder->base.id);
> @@ -1266,7 +1267,8 @@ int ltdc_load(struct drm_device *ddev)
>   		if (bridge) {
>   			ret = ltdc_encoder_init(ddev, bridge);
>   			if (ret) {
> -				DRM_ERROR("init encoder endpoint %d\n", i);
> +				if (ret != -EPROBE_DEFER)
> +					DRM_ERROR("init encoder endpoint %d\n", i);
>   				goto err;
>   			}
>   		}
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-07-13 16:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-04 13:59 [PATCH] drm/stm: ltdc: Silence -EPROBE_DEFER till bridge attached Jagan Teki
2021-07-07 16:18 ` yannick Fertre
2021-07-13 16:43 ` Philippe CORNU [this message]
2021-07-19 13:40   ` Philippe CORNU

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=9008c9b8-ae48-588c-cfb4-cda7323e15dd@foss.st.com \
    --to=philippe.cornu@foss.st.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jagan@amarulasolutions.com \
    --cc=linux-amarula@amarulasolutions.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=yannick.fertre@foss.st.com \
    /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).