Skip to contentSkip to conversation

drm/panel: ronbo-rb070d30: Ignore DCS errors in disable()

PATCH Applied Hsieh Hung-En 2 participants 3 messages Oct 1 – Oct 2

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/panel: ronbo-rb070d30: Ignore DCS errors in disable()

If rb070d30_panel_disable() returns an error, drm_panel_disable() skips clearing panel->enabled. unprepare() still powers the panel off, but the next drm_panel_enable() sees the panel as already enabled and does nothing, so the panel stays dark.

Always return 0 from disable(). A failed ENTER_SLEEP_MODE is still logged by mipi_dsi_dcs_enter_sleep_mode_multi().

---

Notes:
Changes in v2:
- Add a comment explaining why the error is ignored (Doug)

This applies on top of:
https://lore.kernel.org/all/[email protected]/

v1:
https://lore.kernel.org/all/[email protected]/

Compile-tested on arm64 with W=1; not tested on hardware.

 drivers/gpu/drm/panel/panel-ronbo-rb070d30.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-ronbo-rb070d30.c +7 -1
index ebe6352db..9adf97aba 100644
@@ -87,7 +87,13 @@ static int rb070d30_panel_disable(struct drm_panel *panel)
 	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
 
 	mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
-	return dsi_ctx.accum_err;
+
+	/*
+	 * Returning an error would leave panel->enabled set, causing the
+	 * next enable to be skipped even after unprepare powers off the panel.
+	 * The helper above already logs any command failure.
+	 */
+	return 0;
 }
 
 /* Default timings */
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 36 lines · Hsieh Hung-En

If rb070d30_panel_disable() returns an error, drm_panel_disable() skips clearing panel->enabled. unprepare() still powers the panel off, but the next drm_panel_enable() sees the panel as already enabled and does nothing, so the panel stays dark.

Always return 0 from disable(). A failed ENTER_SLEEP_MODE is still logged by mipi_dsi_dcs_enter_sleep_mode_multi().

---

Notes:
Changes in v2:
- Add a comment explaining why the error is ignored (Doug)

This applies on top of:
https://lore.kernel.org/all/[email protected]/

v1:
https://lore.kernel.org/all/[email protected]/

Compile-tested on arm64 with W=1; not tested on hardware.

  drivers/gpu/drm/panel/panel-ronbo-rb070d30.c | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-ronbo-rb070d30.c +0 -1
index ebe6352db..9adf97aba 100644
@@ -87,7 +87,13 @@ static int rb070d30_panel_disable(struct drm_panel *panel)
  	struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
 
  	mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
-	return dsi_ctx.accum_err;

drivers/gpu/drm/panel/panel-ronbo-rb070d30.c static int rb070d30_panel_disable(struct drm_panel *panel) · line 99

Quoted 10 lines
drivers/gpu/drm/panel/panel-ronbo-rb070d30.c +7 -0
+
+	/*
+	 * Returning an error would leave panel->enabled set, causing the
+	 * next enable to be skipped even after unprepare powers off the panel.
+	 * The helper above already logs any command failure.
+	 */
+	return 0;
  }
 
  /* Default timings */

Thanks,
Neil

maintainer Applied
#2 lore raw
In reply to Hsieh Hung-En

Hi,

Quoted 9 lines · Hsieh Hung-En

If rb070d30_panel_disable() returns an error, drm_panel_disable() skips clearing panel->enabled. unprepare() still powers the panel off, but the next drm_panel_enable() sees the panel as already enabled and does nothing, so the panel stays dark.

Always return 0 from disable(). A failed ENTER_SLEEP_MODE is still logged by mipi_dsi_dcs_enter_sleep_mode_multi().

[...]

Thanks, Applied to https://gitlab.freedesktop.org/drm/misc/kernel.git (drm-misc-next)

[1/1] drm/panel: ronbo-rb070d30: Ignore DCS errors in disable()

      https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/00efe8a685658deb7033d68fcdbf0a7e6796352e
Signature · 1 line
Neil