dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/panel: feiyang-fy07024di26a30d: cleanup if panel attaching failed
@ 2020-11-28 12:52 Icenowy Zheng
  2021-01-06  9:47 ` Jagan Teki
  0 siblings, 1 reply; 4+ messages in thread
From: Icenowy Zheng @ 2020-11-28 12:52 UTC (permalink / raw)
  To: Jagan Teki, Thierry Reding, Sam Ravnborg, David Airlie, Daniel Vetter
  Cc: linux-kernel, dri-devel, Icenowy Zheng

Attaching the panel can fail, so cleanup work is necessary, otherwise
a pointer to freed struct drm_panel* will remain in drm_panel code.

Do the cleanup if panel attaching failed.

Fixes: 69dc678abc2b ("drm/panel: Add Feiyang FY07024DI26A30-D MIPI-DSI LCD panel")
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
 drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
index 581661b506f8..f9c1f7bc8218 100644
--- a/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
+++ b/drivers/gpu/drm/panel/panel-feiyang-fy07024di26a30d.c
@@ -227,7 +227,13 @@ static int feiyang_dsi_probe(struct mipi_dsi_device *dsi)
 	dsi->format = MIPI_DSI_FMT_RGB888;
 	dsi->lanes = 4;
 
-	return mipi_dsi_attach(dsi);
+	ret = mipi_dsi_attach(dsi);
+	if (ret < 0) {
+		drm_panel_remove(&ctx->panel);
+		return ret;
+	}
+
+	return 0;
 }
 
 static int feiyang_dsi_remove(struct mipi_dsi_device *dsi)
-- 
2.28.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/panel: feiyang-fy07024di26a30d: cleanup if panel attaching failed
  2020-11-28 12:52 [PATCH] drm/panel: feiyang-fy07024di26a30d: cleanup if panel attaching failed Icenowy Zheng
@ 2021-01-06  9:47 ` Jagan Teki
  2021-01-07  4:00   ` Icenowy Zheng
  0 siblings, 1 reply; 4+ messages in thread
From: Jagan Teki @ 2021-01-06  9:47 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: David Airlie, linux-kernel, dri-devel, Thierry Reding, Sam Ravnborg

On Sat, Nov 28, 2020 at 6:23 PM Icenowy Zheng <icenowy@aosc.io> wrote:
>
> Attaching the panel can fail, so cleanup work is necessary, otherwise
> a pointer to freed struct drm_panel* will remain in drm_panel code.
>
> Do the cleanup if panel attaching failed.
>
> Fixes: 69dc678abc2b ("drm/panel: Add Feiyang FY07024DI26A30-D MIPI-DSI LCD panel")

The fact that this has failed to probe due to recent changes in
sun6i_mipi_dsi.c I don't know how to put that into the commit message.
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---

Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/panel: feiyang-fy07024di26a30d: cleanup if panel attaching failed
  2021-01-06  9:47 ` Jagan Teki
@ 2021-01-07  4:00   ` Icenowy Zheng
  2021-01-07  6:49     ` Jagan Teki
  0 siblings, 1 reply; 4+ messages in thread
From: Icenowy Zheng @ 2021-01-07  4:00 UTC (permalink / raw)
  To: Jagan Teki
  Cc: David Airlie, linux-kernel, dri-devel, Thierry Reding, Sam Ravnborg



于 2021年1月6日 GMT+08:00 下午5:47:20, Jagan Teki <jagan@amarulasolutions.com> 写到:
>On Sat, Nov 28, 2020 at 6:23 PM Icenowy Zheng <icenowy@aosc.io> wrote:
>>
>> Attaching the panel can fail, so cleanup work is necessary, otherwise
>> a pointer to freed struct drm_panel* will remain in drm_panel code.
>>
>> Do the cleanup if panel attaching failed.
>>
>> Fixes: 69dc678abc2b ("drm/panel: Add Feiyang FY07024DI26A30-D
>MIPI-DSI LCD panel")
>
>The fact that this has failed to probe due to recent changes in
>sun6i_mipi_dsi.c I don't know how to put that into the commit message.

It's not related, we shouldn't assume this panel driver will always
be used with sunxi SoCs.

It's a panel driver bug that cannot deal with -EPROBE_DEFER well.

>> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
>> ---
>
>Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/panel: feiyang-fy07024di26a30d: cleanup if panel attaching failed
  2021-01-07  4:00   ` Icenowy Zheng
@ 2021-01-07  6:49     ` Jagan Teki
  0 siblings, 0 replies; 4+ messages in thread
From: Jagan Teki @ 2021-01-07  6:49 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: David Airlie, linux-kernel, dri-devel, Thierry Reding, Sam Ravnborg

On Thu, Jan 7, 2021 at 10:16 AM Icenowy Zheng <icenowy@aosc.io> wrote:
>
>
>
> 于 2021年1月6日 GMT+08:00 下午5:47:20, Jagan Teki <jagan@amarulasolutions.com> 写到:
> >On Sat, Nov 28, 2020 at 6:23 PM Icenowy Zheng <icenowy@aosc.io> wrote:
> >>
> >> Attaching the panel can fail, so cleanup work is necessary, otherwise
> >> a pointer to freed struct drm_panel* will remain in drm_panel code.
> >>
> >> Do the cleanup if panel attaching failed.
> >>
> >> Fixes: 69dc678abc2b ("drm/panel: Add Feiyang FY07024DI26A30-D
> >MIPI-DSI LCD panel")
> >
> >The fact that this has failed to probe due to recent changes in
> >sun6i_mipi_dsi.c I don't know how to put that into the commit message.
>
> It's not related, we shouldn't assume this panel driver will always
> be used with sunxi SoCs.

Well, I'm aware of it. What I'm trying to say is this panel has
referenced with one of exiting panel in a tree and that indeed return
mipi_dsi_attach and it verified with DSI host at that time.

>
> It's a panel driver bug that cannot deal with -EPROBE_DEFER well.

Yes, ie reason I have added Reviewed-by tag above.

Jagan.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-07  8:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-28 12:52 [PATCH] drm/panel: feiyang-fy07024di26a30d: cleanup if panel attaching failed Icenowy Zheng
2021-01-06  9:47 ` Jagan Teki
2021-01-07  4:00   ` Icenowy Zheng
2021-01-07  6:49     ` Jagan Teki

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).