From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/sun4i: Use backend/mixer as dedicated DMA device
Date: Wed, 11 Mar 2026 13:45:58 +1000 [thread overview]
Message-ID: <review-patch4-20260310032511.2545500-5-wenst@chromium.org> (raw)
In-Reply-To: <20260310032511.2545500-5-wenst@chromium.org>
Patch Review
This patch replaces the `of_dma_configure()` hack with proper `drm_dev_set_dma_dev()` calls in both `sun4i_backend.c` and `sun8i_mixer.c`. The pattern is identical in both files:
```c
- if (of_property_present(dev->of_node, "interconnects")) {
- ret = of_dma_configure(drm->dev, dev->of_node, true);
- if (ret)
- return ret;
- }
+ if (drm_dev_dma_dev(drm) == drm->dev)
+ drm_dev_set_dma_dev(drm, dev);
```
**Behavioral change worth noting**: The old code was conditional on the DT property (`"interconnects"` for backend, `"iommus"` for mixer). The new code unconditionally sets the DMA device (on first bind). This means even devices without IOMMU or interconnect properties will now use the backend/mixer as the DMA device instead of the virtual display device. This should be fine since the backend/mixer is the actual device doing DMA regardless of whether an IOMMU is present, but it is a subtle change from the original behavior.
**Comment nit**: The comment in the mixer says "backends" but should say "mixers":
```c
+ * Always use the first bound backend as the DMA device. While
```
The backend comment is correct for `sun4i_backend.c`, but this same text was copied into `sun8i_mixer.c` where it should say "mixer" instead of "backend". This is a minor copy-paste issue in the comments.
**Unbind consideration**: Neither the backend nor the mixer `unbind` function resets the DMA device. If the component providing the DMA device is unbound while the DRM device persists, `drm_device.dma_dev` would point to a potentially freed device. However, looking at the existing code, the `of_dma_configure` approach had a similar issue (the DRM device would retain DMA configuration from a now-unbound component), and component unbind typically tears down the entire DRM device anyway. This is not a regression introduced by this patch.
No blocking issues, but the comment in `sun8i_mixer.c` should be fixed to say "mixer" instead of "backend".
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-11 3:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 3:25 [PATCH RESEND 0/4] drm/gem-dma: Support dedicated DMA device for allocation Chen-Yu Tsai
2026-03-10 3:25 ` [PATCH RESEND 1/4] drm/prime: Limit scatter list size with dedicated DMA device Chen-Yu Tsai
2026-03-10 8:00 ` Thomas Zimmermann
2026-03-11 3:45 ` Claude review: " Claude Code Review Bot
2026-03-10 3:25 ` [PATCH RESEND 2/4] drm/gem-dma: Support dedicated DMA device for allocation and mapping Chen-Yu Tsai
2026-03-10 8:02 ` Thomas Zimmermann
2026-03-11 3:45 ` Claude review: " Claude Code Review Bot
2026-03-10 3:25 ` [PATCH RESEND 3/4] drm/mediatek: Set dedicated DMA device and drop custom GEM callbacks Chen-Yu Tsai
2026-03-10 8:21 ` Thomas Zimmermann
2026-03-11 3:45 ` Claude review: " Claude Code Review Bot
2026-03-10 3:25 ` [PATCH RESEND 4/4] drm/sun4i: Use backend/mixer as dedicated DMA device Chen-Yu Tsai
2026-03-11 3:45 ` Claude Code Review Bot [this message]
2026-03-10 7:56 ` [PATCH RESEND 0/4] drm/gem-dma: Support dedicated DMA device for allocation Thomas Zimmermann
2026-03-11 3:45 ` Claude review: " Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-03-11 9:49 [PATCH v2 0/4] " Chen-Yu Tsai
2026-03-11 9:49 ` [PATCH v2 4/4] drm/sun4i: Use backend/mixer as dedicated DMA device Chen-Yu Tsai
2026-03-11 21:08 ` Claude review: " Claude Code Review Bot
2026-03-10 3:20 [PATCH 0/4] drm/gem-dma: Support dedicated DMA device for allocation Chen-Yu Tsai
2026-03-10 3:20 ` [PATCH 4/4] drm/sun4i: Use backend/mixer as dedicated DMA device Chen-Yu Tsai
2026-03-11 3:48 ` 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-patch4-20260310032511.2545500-5-wenst@chromium.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