Skip to contentSkip to conversation

drm/bridge: stm_lvds: Do not fail atomic_check on disabled connector

PATCH Applied Marek Vasut 2 participants 3 messages Apr 9 – Apr 13

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

PATCH 1/1 drm/bridge: stm_lvds: Do not fail atomic_check on disabled connector

If the connector is disabled, the new connector state has .crtc field set to NULL and there is nothing more to validate after that point. The .crtc field being NULL is not an error. Test for .crtc being NULL, and if it is NULL, exit early with return 0.

This fixes a failure in suspend/resume path, where the connector is already disabled, but .atomic_check is called, fails, returns -EINVAL and blocks the suspend entry.

Fixes aca1cbc1c986 ("drm/stm: lvds: add new STM32 LVDS Display Interface Transmitter driver")

---
Cc: Alexandre Torgue <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Maarten Lankhorst <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Philippe Cornu <[email protected]>
Cc: Raphael Gallais-Pou <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: Yannick Fertre <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 drivers/gpu/drm/stm/lvds.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/stm/lvds.c +3 -3
index fe38c0984b2b5..25e2ba98f36ae 100644
@@ -897,14 +897,14 @@ static int lvds_connector_atomic_check(struct drm_connector *connector,
 	if (!conn_state)
 		return -EINVAL;
 
+	if (!conn_state->crtc)
+		return 0;
+
 	if (list_empty(&connector->modes)) {
 		drm_dbg(connector->dev, "connector: empty modes list\n");
 		return -EINVAL;
 	}
 
-	if (!conn_state->crtc)
-		return -EINVAL;
-
 	panel_mode = list_first_entry(&connector->modes,
 				      struct drm_display_mode, head);
 
Signature · 1 line
2.53.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Marek Vasut

If the connector is disabled, the new connector state has .crtc field set to NULL and there is nothing more to validate after that point. The .crtc field being NULL is not an error. Test for .crtc being NULL, and if it is NULL, exit early with return 0.

Quoted 7 lines

This fixes a failure in suspend/resume path, where the connector is already disabled, but .atomic_check is called, fails, returns -EINVAL and blocks the suspend entry.

Fixes aca1cbc1c986 ("drm/stm: lvds: add new STM32 LVDS Display Interface Transmitter driver")

---

Hi Marek,

Thanks,
Best regards,
Raphaël

Quoted 40 lines
Cc Alexandre Torgue <[email protected]>
Cc David Airlie <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Coquelin <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Philippe Cornu <[email protected]>
Cc Raphael Gallais-Pou <[email protected]>
Cc Simona Vetter <[email protected]>
Cc Thomas Zimmermann <[email protected]>
Cc Yannick Fertre <[email protected]>
---
 drivers/gpu/drm/stm/lvds.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/stm/lvds.c +3 -3
index fe38c0984b2b5..25e2ba98f36ae 100644
@@ -897,14 +897,14 @@ static int lvds_connector_atomic_check(struct drm_connector *connector,
 	if (!conn_state)
 		return -EINVAL;
 
+	if (!conn_state->crtc)
+		return 0;
+
 	if (list_empty(&connector->modes)) {
 		drm_dbg(connector->dev, "connector: empty modes list\n");
 		return -EINVAL;
 	}
 
-	if (!conn_state->crtc)
-		return -EINVAL;
-
 	panel_mode = list_first_entry(&connector->modes,
 				      struct drm_display_mode, head);
 
maintainer Applied
#2 lore raw
In reply to Marek Vasut
Quoted 10 lines · Marek Vasut

If the connector is disabled, the new connector state has .crtc field set to NULL and there is nothing more to validate after that point. The .crtc field being NULL is not an error. Test for .crtc being NULL, and if it is NULL, exit early with return 0.

This fixes a failure in suspend/resume path, where the connector is already disabled, but .atomic_check is called, fails, returns -EINVAL and blocks the suspend entry.

[...]

Applied, thanks!

[1/1] drm/bridge: stm_lvds: Do not fail atomic_check on disabled connector

      commit: eecdd4bd6e47bf0c8ff1e049771fa5bab7074c7c

Best regards,

Signature · 1 line
Raphael Gallais-Pou <[email protected]>