public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/bridge: stm_lvds: Do not fail atomic_check on disabled connector
@ 2026-04-09  2:48 Marek Vasut
  2026-04-12  1:47 ` Claude review: " Claude Code Review Bot
  2026-04-12  1:47 ` Claude Code Review Bot
  0 siblings, 2 replies; 3+ messages in thread
From: Marek Vasut @ 2026-04-09  2:48 UTC (permalink / raw)
  To: dri-devel
  Cc: Marek Vasut, Alexandre Torgue, David Airlie, Maarten Lankhorst,
	Maxime Coquelin, Maxime Ripard, Philippe Cornu,
	Raphael Gallais-Pou, Simona Vetter, Thomas Zimmermann,
	Yannick Fertre, linux-arm-kernel, linux-kernel, linux-stm32

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")
Signed-off-by: Marek Vasut <marex@nabladev.com>
---
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Philippe Cornu <philippe.cornu@foss.st.com>
Cc: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Yannick Fertre <yannick.fertre@foss.st.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
---
 drivers/gpu/drm/stm/lvds.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/stm/lvds.c b/drivers/gpu/drm/stm/lvds.c
index fe38c0984b2b5..25e2ba98f36ae 100644
--- a/drivers/gpu/drm/stm/lvds.c
+++ b/drivers/gpu/drm/stm/lvds.c
@@ -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);
 
-- 
2.53.0


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

* Claude review: drm/bridge: stm_lvds: Do not fail atomic_check on disabled connector
  2026-04-09  2:48 [PATCH] drm/bridge: stm_lvds: Do not fail atomic_check on disabled connector Marek Vasut
  2026-04-12  1:47 ` Claude review: " Claude Code Review Bot
@ 2026-04-12  1:47 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-04-12  1:47 UTC (permalink / raw)
  To: dri-devel-reviews

Overall Series Review

Subject: drm/bridge: stm_lvds: Do not fail atomic_check on disabled connector
Author: Marek Vasut <marex@nabladev.com>
Patches: 1
Reviewed: 2026-04-12T11:47:57.467444

---

This is a single-patch fix for the STM32 LVDS bridge driver. The change is small, correct, and well-motivated: when the connector is disabled (i.e., `conn_state->crtc` is NULL), the `atomic_check` callback should return success (0) rather than `-EINVAL`, because a disabled connector is a perfectly valid state. The original code treated a NULL crtc as an error, which caused suspend/resume to fail when `atomic_check` was called on an already-disabled connector.

The fix is clean and follows the same pattern used by other DRM drivers (analogix_dp, vmwgfx, vkms).

**Verdict: Looks good to apply.**

---
Generated by Claude Code Patch Reviewer

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

* Claude review: drm/bridge: stm_lvds: Do not fail atomic_check on disabled connector
  2026-04-09  2:48 [PATCH] drm/bridge: stm_lvds: Do not fail atomic_check on disabled connector Marek Vasut
@ 2026-04-12  1:47 ` Claude Code Review Bot
  2026-04-12  1:47 ` Claude Code Review Bot
  1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-04-12  1:47 UTC (permalink / raw)
  To: dri-devel-reviews

Patch Review

**Correctness: Good.**

The patch does two things:
1. Changes the `!conn_state->crtc` check from returning `-EINVAL` to returning `0`.
2. Moves the check *above* the `list_empty(&connector->modes)` check.

Both changes are correct:

- **Returning 0 instead of -EINVAL**: A NULL `crtc` in the new connector state simply means the connector is being disabled (or is already disabled). This is not an error. Other drivers in the tree follow the same pattern — e.g., `analogix_dp_core.c:906`, `vmwgfx_stdu.c:895`, `vkms_writeback.c:47` all do `if (!conn_state->crtc) return 0;`.

- **Moving the check earlier**: This is the right ordering. When the connector is disabled, there is no point validating modes or checking crtc state — none of that applies. Early-exit avoids a spurious "empty modes list" debug message or other irrelevant validation on a disabled connector.

Looking at the post-patch function (lines 896–923), the resulting flow is clean:

```c
conn_state = drm_atomic_get_new_connector_state(state, connector);
if (!conn_state)
    return -EINVAL;

if (!conn_state->crtc)        /* disabled connector — nothing to validate */
    return 0;

if (list_empty(&connector->modes)) {  /* only relevant when enabled */
    ...
}
```

The subsequent code at lines 912–921 dereferences `conn_state->crtc` (via `drm_atomic_get_crtc_state`), so the NULL check *must* precede it — which it did before and still does after the patch. No null-deref risk.

**Commit message**: Clear and well-written. The Fixes tag correctly references the original commit that introduced the driver. The explanation of the suspend/resume failure scenario is helpful.

**No issues found.**

---
Generated by Claude Code Patch Reviewer

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

end of thread, other threads:[~2026-04-12  1:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-09  2:48 [PATCH] drm/bridge: stm_lvds: Do not fail atomic_check on disabled connector Marek Vasut
2026-04-12  1:47 ` Claude review: " Claude Code Review Bot
2026-04-12  1:47 ` Claude Code Review Bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox