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: iov_iter: add iterator type for dmabuf maps
Date: Tue, 05 May 2026 11:26:00 +1000	[thread overview]
Message-ID: <review-patch2-20a233d2f35274817aa643cc0fe113707eb47e72.1777475843.git.asml.silence@gmail.com> (raw)
In-Reply-To: <20a233d2f35274817aa643cc0fe113707eb47e72.1777475843.git.asml.silence@gmail.com>

Patch Review

Introduces `ITER_DMABUF_MAP` iterator type. The approach of treating it as an opaque handle that only the target driver can interpret is sound.

**Issue: Pre-existing parenthesization bug perpetuated in `iov_iter_restore`**

The patch modifies the `WARN_ON_ONCE` in `iov_iter_restore` but does not fix the existing mis-parenthesization:

```c
if (WARN_ON_ONCE(!iov_iter_is_bvec(i) && !iter_is_iovec(i) &&
		 !iter_is_ubuf(i) && !iov_iter_is_kvec(i) &&
		 !iov_iter_is_dmabuf_map(i)))
```

The original code has:
```c
if (WARN_ON_ONCE(!iov_iter_is_bvec(i) && !iter_is_iovec(i) &&
		 !iter_is_ubuf(i)) && !iov_iter_is_kvec(i))
```

The closing paren of `WARN_ON_ONCE` comes after `!iter_is_ubuf(i)`, meaning `!iov_iter_is_kvec(i)` is checked *after* the WARN fires, not as part of the condition. The patched version fixes this by moving the closing paren to include all the checks, but this is done silently — it should be called out since it changes the existing behavior (kvec iterators would previously pass through without warning, now they'd warn if somehow removed from the list). This is actually a bugfix that should be noted in the commit message or split out.

**Minor: `iov_iter_alignment` shares ubuf path**

```c
if (likely(iter_is_ubuf(i)) || iov_iter_is_dmabuf_map(i)) {
    ...
    return ((unsigned long)i->ubuf + i->iov_offset) | size;
```

This accesses `i->ubuf` for a dmabuf_map iterator. Since `ubuf` and `dmabuf_map` are in a union, this is reading the `dmabuf_map` pointer as a `void __user *`, which works for alignment checking purposes but is semantically odd. The comment or code should clarify that alignment of dmabuf_map iterators is always satisfied, or this path should return 0 for dmabuf_map iterators explicitly.

---

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-05  1:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 15:25 [PATCH v3 00/10] Add dmabuf read/write via io_uring Pavel Begunkov
2026-04-29 15:25 ` [PATCH v3 01/10] file: add callback for creating long-term dmabuf maps Pavel Begunkov
2026-04-30  6:03   ` Christian König
2026-04-30 18:33     ` Pavel Begunkov
2026-05-04  7:14       ` Christian König
2026-05-05  1:25   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 02/10] iov_iter: add iterator type for " Pavel Begunkov
2026-05-05  1:26   ` Claude Code Review Bot [this message]
2026-04-29 15:25 ` [PATCH v3 03/10] block: move bvec init into __bio_clone Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 04/10] block: introduce dma map backed bio type Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 05/10] lib: add dmabuf token infrastructure Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 06/10] block: forward create_dmabuf_token to drivers Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 07/10] nvme-pci: implement dma_token backed requests Pavel Begunkov
2026-04-29 15:29   ` Pavel Begunkov
2026-04-29 16:07   ` Maurizio Lombardi
2026-04-30 18:18     ` Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 08/10] io_uring/rsrc: introduce buf registration structure Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 09/10] io_uring/rsrc: extend buffer update Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-04-29 15:25 ` [PATCH v3 10/10] io_uring/rsrc: add dmabuf backed registered buffers Pavel Begunkov
2026-05-05  1:26   ` Claude review: " Claude Code Review Bot
2026-05-05  1:25 ` Claude review: Add dmabuf read/write via io_uring 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-patch2-20a233d2f35274817aa643cc0fe113707eb47e72.1777475843.git.asml.silence@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