[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230920194117.ghllpy7ubghakdrv@mercury.elektranox.org>
Date: Wed, 20 Sep 2023 21:41:17 +0200
From: Sebastian Reichel <sebastian.reichel@...labora.com>
To: "H. Nikolaus Schaller" <hns@...delico.com>
Cc: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>, tony@...mide.com,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Douglas Anderson <dianders@...omium.org>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Arnd Bergmann <arnd@...db.de>, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, linux-omap@...r.kernel.org,
letux-kernel@...nphoenux.org, kernel@...a-handheld.com
Subject: Re: [PATCH] omap: dsi: do not WARN on detach if dsidev was never
attached
Hi,
On Tue, Sep 19, 2023 at 03:37:28PM +0200, H. Nikolaus Schaller wrote:
> dsi_init_output() called by dsi_probe() may fail. In that
> case mipi_dsi_host_unregister() is called which may call
> omap_dsi_host_detach() with uninitialized dsi->dsidev
> because omap_dsi_host_attach() was never called before.
>
> This happens if the panel driver asks for an EPROBE_DEFER.
>
> So let's suppress the WARN() in this special case.
...
> Signed-off-by: H. Nikolaus Schaller <hns@...delico.com>
> ---
Reviewed-by: Sebastian Reichel <sebastian.reichel@...labora.com>
-- Sebastian
> drivers/gpu/drm/omapdrm/dss/dsi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index ea63c64d3a1ab..c37eb6b1b9a39 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -4411,7 +4411,7 @@ static int omap_dsi_host_detach(struct mipi_dsi_host *host,
> {
> struct dsi_data *dsi = host_to_omap(host);
>
> - if (WARN_ON(dsi->dsidev != client))
> + if (!dsi->dsidev || WARN_ON(dsi->dsidev != client))
> return -EINVAL;
>
> cancel_delayed_work_sync(&dsi->dsi_disable_work);
> --
> 2.42.0
>
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists