public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/mode-config: Create drm_mode_config_create_initial_state()
Date: Wed, 27 May 2026 14:30:52 +1000	[thread overview]
Message-ID: <review-patch16-20260526-drm-mode-config-init-v6-16-852346394200@kernel.org> (raw)
In-Reply-To: <20260526-drm-mode-config-init-v6-16-852346394200@kernel.org>

Patch Review

This is the key patch introducing `drm_mode_config_create_initial_state()`.

**Main concern — no cleanup on partial failure:** If, say, plane state creation succeeds for all planes but a CRTC state allocation fails, the function returns an error but all the plane states that were already allocated are leaked. The caller gets an error with no way to know which objects got states. The `continue` for objects with existing states helps with re-entrance, but doesn't solve the forward-leak problem.

```c
drm_for_each_plane(plane, dev) {
    if (plane->state)
        continue;
    ret = drm_mode_config_plane_create_state(plane);
    if (ret)
        return ret;  // leaked: all privobj and colorop states allocated above
}
```

In practice, this is called during probe, so a failure here likely means the driver fails to load and the device gets torn down entirely (which would clean up via `drm_mode_config_cleanup()`). So this may be acceptable, but it would be cleaner to document this expectation or add cleanup.

The `if (privobj->state) continue` / `if (colorop->state) continue` guards are good for handling the case where `drm_atomic_private_obj_init()` already created the state, or where `drmm_connector_hdmi_init()` already set up a connector state.

The doc update to patch 1's lifetime documentation (splitting reset-time into init-time and resume-time) is correct.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-27  4:30 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 16:46 [PATCH v6 00/19] drm/atomic: Rework initial state allocation Maxime Ripard
2026-05-26 16:46 ` [PATCH v6 01/19] drm/atomic: Document atomic commit lifetime Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 02/19] drm/colorop: Fix typos in the doc Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 03/19] drm/atomic: Drop drm_private_obj.state assignment from create_state Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 04/19] drm/atomic: Expand atomic_create_state expectations for drm_private_obj Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 05/19] drm/mode-config: Document drm_private_obj exclusion from drm_mode_config_reset() Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 06/19] drm/colorop: Rename __drm_colorop_state_reset() Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 07/19] drm/colorop: Create drm_atomic_helper_colorop_create_state() Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 08/19] drm/atomic-state-helper: Fix __drm_atomic_helper_plane_reset() doc typo Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 09/19] drm/atomic-state-helper: Rename __drm_atomic_helper_plane_state_reset() Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 10/19] drm/plane: Add new atomic_create_state callback Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 11/19] drm/atomic-state-helper: Rename __drm_atomic_helper_crtc_state_reset() Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 12/19] drm/crtc: Add new atomic_create_state callback Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 13/19] drm/atomic-state-helper: Rename __drm_atomic_helper_connector_state_reset() Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 14/19] drm/hdmi: Rename __drm_atomic_helper_connector_hdmi_reset() Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 15/19] drm/connector: Add new atomic_create_state callback Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 16/19] drm/mode-config: Create drm_mode_config_create_initial_state() Maxime Ripard
2026-05-27  4:30   ` Claude Code Review Bot [this message]
2026-05-26 16:46 ` [PATCH v6 17/19] drm/drv: Switch skeleton to drm_mode_config_create_initial_state() Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 18/19] drm/tidss: Convert to atomic_create_state Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-26 16:46 ` [PATCH v6 19/19] drm/bridge_connector: " Maxime Ripard
2026-05-27  4:30   ` Claude review: " Claude Code Review Bot
2026-05-27  4:30 ` Claude review: drm/atomic: Rework initial state allocation Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-12 13:05 [PATCH v4 00/20] " Maxime Ripard
2026-05-12 13:06 ` [PATCH v4 16/20] drm/mode-config: Create drm_mode_config_create_initial_state() Maxime Ripard
2026-05-16  3:22   ` Claude review: " Claude Code Review Bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=review-patch16-20260526-drm-mode-config-init-v6-16-852346394200@kernel.org \
    --to=claude-review@example.com \
    --cc=dri-devel-reviews@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox