From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/gem-dma: Add flag for bidirectional mapping of non-coherent GEM DMA buffers Date: Mon, 09 Mar 2026 08:49:21 +1000 Message-ID: In-Reply-To: <20260306-neutron-v2-1-3019bd8c91ef@nxp.com> References: <20260306-neutron-v2-0-3019bd8c91ef@nxp.com> <20260306-neutron-v2-1-3019bd8c91ef@nxp.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Design concern:** Adding a second boolean `map_bidirectional` that is onl= y valid when `map_noncoherent` is true is fragile. A better approach would = be to replace both booleans with a single enum or store the `dma_dir` direc= tly: ```c dma_obj->map_bidirectional =3D true; ``` If a driver ever sets `map_bidirectional =3D true` without `map_noncoherent= =3D true`, the flag is silently ignored. Consider either: - Storing a `enum dma_data_direction map_dir` field instead, or - Adding a WARN if `map_bidirectional` is set without `map_noncoherent`. **Missing sync path:** The `drm_gem_dma_helper.c` also has `dma_mmap_noncoh= erent()` and sg_table export paths. Are those also affected? If the buffer = is bidirectional, the `drm_gem_dma_mmap()` call to `dma_mmap_noncoherent()`= also passes `DMA_TO_DEVICE` =E2=80=94 this should be updated for consisten= cy. Check around line 350 of `drm_gem_dma_helper.c`. Otherwise the mechanical change is correct. --- Generated by Claude Code Patch Reviewer