Skip to contentSkip to conversation

drm/panel: panasonic-vvx10f034n00: Fix wuxga_nt_panel_disable() return value

PATCH In review Sean Paul 2 participants 3 messages Jan 16, 2018 – Jan 17, 2018

Subsystems (3)
lore
Share & tools
lore

Sean Paul

author
#0 lore raw

PATCH 1/1 drm/panel: panasonic-vvx10f034n00: Fix wuxga_nt_panel_disable() return value

Return value for mipi_dsi_shutdown_peripheral() is unchecked. Check it and return any errors if they come up. Even if mipi_dsi_shutdown_peripheral() fails, continue attempting to disable.

Cc Philippe Cornu <[email protected]>
---
 drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +3 -2
index 7f915f706fa6..91dc5a6b14f9 100644
@@ -72,11 +72,12 @@ static int wuxga_nt_panel_on(struct wuxga_nt_panel *wuxga_nt)
 static int wuxga_nt_panel_disable(struct drm_panel *panel)
 {
 	struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel);
+	int ret;
 
 	if (!wuxga_nt->enabled)
 		return 0;
 
-	mipi_dsi_shutdown_peripheral(wuxga_nt->dsi);
+	ret = mipi_dsi_shutdown_peripheral(wuxga_nt->dsi);
 
 	if (wuxga_nt->backlight) {
 		wuxga_nt->backlight->props.power = FB_BLANK_POWERDOWN;
@@ -86,7 +87,7 @@ static int wuxga_nt_panel_disable(struct drm_panel *panel)
 
 	wuxga_nt->enabled = false;
 
-	return 0;
+	return ret;
 }
 
 static int wuxga_nt_panel_unprepare(struct drm_panel *panel)
Signature · 6 lines
2.16.0.rc1.238.g530d649a79-goog

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

Hi Sean,

Quoted 31 lines · Sean Paul

Return value for mipi_dsi_shutdown_peripheral() is unchecked. Check it and return any errors if they come up. Even if mipi_dsi_shutdown_peripheral() fails, continue attempting to disable.

Cc Philippe Cornu <[email protected]>
---
  drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +2 -1
index 7f915f706fa6..91dc5a6b14f9 100644
@@ -72,11 +72,12 @@ static int wuxga_nt_panel_on(struct wuxga_nt_panel *wuxga_nt)
  static int wuxga_nt_panel_disable(struct drm_panel *panel)
  {
  	struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel);
+	int ret;
 
  	if (!wuxga_nt->enabled)
  		return 0;
 
-	mipi_dsi_shutdown_peripheral(wuxga_nt->dsi);
+	ret = mipi_dsi_shutdown_peripheral(wuxga_nt->dsi);
 
  	if (wuxga_nt->backlight) {
  		wuxga_nt->backlight->props.power = FB_BLANK_POWERDOWN;

drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c static int wuxga_nt_panel_disable(struct drm_panel *panel) · line 93

Quoted 8 lines
drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +1 -1
@@ -86,7 +87,7 @@ static int wuxga_nt_panel_disable(struct drm_panel *panel)
 
  	wuxga_nt->enabled = false;
 
-	return 0;
+	return ret;
  }
 
  static int wuxga_nt_panel_unprepare(struct drm_panel *panel)

Many thanks for the patch.

I agree it is better to continue attempting to disable if mipi_dsi_shutdown_peripheral() fails.

Looking more in details in this driver:
* backlight_update_status() may also use a ret value...
* wuxga_nt_panel_on() should simply do "return mipi_dsi_turn_on_peripheral(dsi);"
... but it is not really part of your patch (and mine initially), maybe TODOs for later : )

Philippe :-)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#2 lore raw
Quoted 48 lines · Philippe CORNU

Hi Sean,

Quoted 31 lines · Sean Paul

Return value for mipi_dsi_shutdown_peripheral() is unchecked. Check it and return any errors if they come up. Even if mipi_dsi_shutdown_peripheral() fails, continue attempting to disable.

Cc Philippe Cornu <[email protected]>
---
  drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +2 -1
index 7f915f706fa6..91dc5a6b14f9 100644
@@ -72,11 +72,12 @@ static int wuxga_nt_panel_on(struct wuxga_nt_panel *wuxga_nt)
  static int wuxga_nt_panel_disable(struct drm_panel *panel)
  {
  	struct wuxga_nt_panel *wuxga_nt = to_wuxga_nt_panel(panel);
+	int ret;
 
  	if (!wuxga_nt->enabled)
  		return 0;
 
-	mipi_dsi_shutdown_peripheral(wuxga_nt->dsi);
+	ret = mipi_dsi_shutdown_peripheral(wuxga_nt->dsi);
 
  	if (wuxga_nt->backlight) {
  		wuxga_nt->backlight->props.power = FB_BLANK_POWERDOWN;

drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c static int wuxga_nt_panel_disable(struct drm_panel *panel) · line 93

Quoted 8 lines
drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.c +1 -1
@@ -86,7 +87,7 @@ static int wuxga_nt_panel_disable(struct drm_panel *panel)
 
  	wuxga_nt->enabled = false;
 
-	return 0;
+	return ret;
  }
 
  static int wuxga_nt_panel_unprepare(struct drm_panel *panel)

Many thanks for the patch.

I agree it is better to continue attempting to disable if mipi_dsi_shutdown_peripheral() fails.

Quoted 7 lines

Looking more in details in this driver:
* backlight_update_status() may also use a ret value...
* wuxga_nt_panel_on() should simply do "return mipi_dsi_turn_on_peripheral(dsi);"
... but it is not really part of your patch (and mine initially), maybe TODOs for later : )

Thanks for your review, Philippe, I've applied this to -misc-next. I'm stuck in meetings all day today, so there's a good chance I'll get to the rest of the TODOs while I sit here :-)

Sean

Quoted 4 lines

Philippe :-)

Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel