Re: [PATCH] drm/bridge: ti-sn65dsi83: Check link status register after enabling the bridge

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07.09.2021 04:39, Marek Vasut wrote:
> In rare cases, the bridge may not start up correctly, which usually
> leads to no display output. In case this happens, warn about it in
> the kernel log.
> 
> Signed-off-by: Marek Vasut <marex@xxxxxxx>
> Cc: Jagan Teki <jagan@xxxxxxxxxxxxxxxxxxxx>
> Cc: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> Cc: Linus Walleij <linus.walleij@xxxxxxxxxx>
> Cc: Robert Foss <robert.foss@xxxxxxxxxx>
> Cc: Sam Ravnborg <sam@xxxxxxxxxxxx>
> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> ---
> NOTE: See the following:
> https://e2e.ti.com/support/interface-group/interface/f/interface-forum/942005/sn65dsi83-dsi83-lvds-bridge---sporadic-behavior---no-video
> https://community.nxp.com/t5/i-MX-Processors/i-MX8M-MIPI-DSI-Interface-LVDS-Bridge-Initialization/td-p/1156533
> ---
>   drivers/gpu/drm/bridge/ti-sn65dsi83.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> index a32f70bc68ea4..4ea71d7f0bfbc 100644
> --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> @@ -520,6 +520,11 @@ static void sn65dsi83_atomic_enable(struct drm_bridge *bridge,
>   	/* Clear all errors that got asserted during initialization. */
>   	regmap_read(ctx->regmap, REG_IRQ_STAT, &pval);
>   	regmap_write(ctx->regmap, REG_IRQ_STAT, pval);


It does not look as correct error handling, maybe it would be good to 
analyze and optionally report 'unexpected' errors here as well.


> +
> +	usleep_range(10000, 12000);
> +	regmap_read(ctx->regmap, REG_IRQ_STAT, &pval);
> +	if (pval)
> +		dev_err(ctx->dev, "Unexpected link status 0x%02x\n", pval);


I am not sure what is the case here but it looks like 'we do not know 
what is going on, so let's add some diagnostic messages to gather info 
and figure it out later'.

Whole driver lacks IRQ handler which IMO could perform better diagnosis, 
and I guess it could also help in recovery, but this is just my guess.
So if this patch is enough for now you can add:

Reviewed-by: Andrzej Hajda <a.hajda@xxxxxxxxxxx>

Regards
Andrzej


>   }
>   
>   static void sn65dsi83_atomic_disable(struct drm_bridge *bridge,
> 




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux