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/bridge: cdns-dsi: Replace deprecated UNIVERSAL_DEV_PM_OPS()
Date: Sun, 12 Apr 2026 13:22:18 +1000	[thread overview]
Message-ID: <review-patch1-20260407144142.1420354-2-ivitro@gmail.com> (raw)
In-Reply-To: <20260407144142.1420354-2-ivitro@gmail.com>

Patch Review

**Correctness: Good**

The core change is replacing:
```c
static UNIVERSAL_DEV_PM_OPS(cdns_dsi_pm_ops, cdns_dsi_suspend, cdns_dsi_resume, NULL);
```
with:
```c
static const struct dev_pm_ops cdns_dsi_pm_ops = {
    RUNTIME_PM_OPS(cdns_dsi_suspend, cdns_dsi_resume, NULL)
};
```

This is correct because:

1. `UNIVERSAL_DEV_PM_OPS` (pm.h:458-462) expands to both `SET_SYSTEM_SLEEP_PM_OPS` and `SET_RUNTIME_PM_OPS` using the *same* callbacks, which is exactly what causes the double-disable bug described in the commit message.

2. The bridge's `atomic_pre_enable` calls `pm_runtime_get_sync()` (line 736) and `atomic_post_disable` calls `pm_runtime_put()` (line 631). This means the DRM framework already handles bringing the device in/out of runtime PM around display usage. During system suspend, the DRM core will call `atomic_post_disable` which triggers `pm_runtime_put` → runtime suspend → `cdns_dsi_suspend`. There is no need for separate system sleep PM ops.

3. The `__maybe_unused` removal from `cdns_dsi_resume` and `cdns_dsi_suspend` is correct. The old `SET_RUNTIME_PM_OPS` macro was conditionally compiled (guarded by `#ifdef CONFIG_PM`), which could leave the functions unreferenced when PM was disabled, requiring `__maybe_unused`. The new `RUNTIME_PM_OPS` macro (pm.h:338-341) unconditionally expands regardless of CONFIG_PM, so the functions are always referenced. The `pm_ptr()` wrapper on the driver side handles the compile-out when CONFIG_PM is disabled.

4. The change from `.pm = &cdns_dsi_pm_ops` to `.pm = pm_ptr(&cdns_dsi_pm_ops)` is the correct modern pattern — it compiles out the PM ops pointer when `CONFIG_PM` is not enabled, allowing the compiler to dead-code-eliminate the entire `cdns_dsi_pm_ops` structure and the suspend/resume functions.

**Minor note on commit message:** The commit message text says "SET_RUNTIME_PM_OPS()" but the actual code uses `RUNTIME_PM_OPS()`. These are functionally equivalent (`SET_RUNTIME_PM_OPS` is just an alias per pm.h:365-366), but ideally the commit message would match the code. This is a very minor nit and not worth respinning the patch for, especially since it already has a Reviewed-by.

**No issues found. Patch is ready to merge.**

---
Generated by Claude Code Patch Reviewer

      parent reply	other threads:[~2026-04-12  3:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07 14:41 [PATCH v4] drm/bridge: cdns-dsi: Replace deprecated UNIVERSAL_DEV_PM_OPS() Vitor Soares
2026-04-12  3:22 ` Claude review: " Claude Code Review Bot
2026-04-12  3:22 ` Claude Code Review Bot [this message]

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-patch1-20260407144142.1420354-2-ivitro@gmail.com \
    --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