From: Alistair Popple <apopple@nvidia.com>
To: sashiko-reviews@lists.linux.dev
Cc: dri-devel@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
amd-gfx@lists.freedesktop.org, linux-rdma@vger.kernel.org,
linux-nvme@lists.infradead.org, media-ci@linuxtv.org
Subject: Re: [PATCH v3 24/24] dma-buf: Add kunit tests for mapping type selection
Date: Mon, 23 Nov 2026 15:26:57 +1100 [thread overview]
Message-ID: <awO8FGMeDLMfDgv9@nvdebian.thelocal> (raw)
In-Reply-To: <sashiko-outbox-226692@kernel.org>
On 2026-11-21 at 16:58 +1100, sashiko-bot@kernel.org wrote...
> Thank you for your contribution! Sashiko AI review found 3 potential
> issues to consider:
> - [High] dma-buf: build failure from mapping2->type access in selection
> KUnit tests
[ ... ]
> > + /* A second map does not reselect. */
> > + mock_select_idx = 0;
> > + mapping2 = dma_buf_mapping_map(attach, DMA_BIDIRECTIONAL);
> > + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, mapping2);
> > + KUNIT_EXPECT_PTR_EQ(test, mapping2->type, &mock_type_b);
>
> [Severity: High]
> Does accessing mapping2->type break the build when CONFIG_DMABUF_KUNIT_TEST
> is enabled?
>
> struct dma_buf_mapping only has a match member, not type, so these two
> checks in test_unmap_uses_own_type() and
> test_select_survives_own_invalidate() should use
> dma_buf_mapping_type_of(mapping2).
Ugh. I made an accessor for the type in my final iteration before sending this
and clearly forgot to do a full module rebuild and retest. It's a trivial fix,
and I just re-tested to ensure the kunit tests pass.
I have also been writing and running some basic tests that exercise the new
dma-buf paths via vfio-pci and iommufd, nvme or nic rdma which are working. I
haven't posted these as part of the series as they are user-space tests that
require fairly specific HW setups. If anyone is interested I can put them
somewhere though.
---
index 42e6748f0ae6..6e88c36d8c9b 100644
--- a/drivers/dma-buf/st-dma-mapping.c
+++ b/drivers/dma-buf/st-dma-mapping.c
@@ -950,7 +950,7 @@ static void test_unmap_uses_own_type(struct kunit *test)
mock_select_idx = 0;
mapping2 = dma_buf_mapping_map(attach, DMA_BIDIRECTIONAL);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, mapping2);
- KUNIT_EXPECT_PTR_EQ(test, mapping2->type, &mock_type_a);
+ KUNIT_EXPECT_PTR_EQ(test, dma_buf_mapping_type_of(mapping2), &mock_type_a);
KUNIT_EXPECT_TRUE(test, attach->selected);
KUNIT_EXPECT_EQ(test, mock_select_count, 2);
KUNIT_EXPECT_PTR_EQ(test, dma_buf_attach_map_type(attach)->type,
@@ -1043,7 +1043,7 @@ static void test_select_survives_own_invalidate(struct kunit *test)
mock_select_idx = 0;
mapping2 = dma_buf_mapping_map(attach, DMA_BIDIRECTIONAL);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, mapping2);
- KUNIT_EXPECT_PTR_EQ(test, mapping2->type, &mock_type_b);
+ KUNIT_EXPECT_PTR_EQ(test, dma_buf_mapping_type_of(mapping2), &mock_type_b);
KUNIT_EXPECT_TRUE(test, attach->selected);
KUNIT_EXPECT_EQ(test, mock_select_count, 1);
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20261120-dma_mapping_type_v4-v3-0-c0183a409bdf@nvidia.com?part=24
next prev parent reply other threads:[~2026-11-23 4:27 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 5:55 [PATCH v3 00/24] DMA-buf mapping types Alistair Popple
2026-11-20 5:55 ` [PATCH v3 01/24] treewide: Rename dma_buf_(un)map_attachment() to dma_buf_(un)map_sgt() Alistair Popple
2026-11-23 13:28 ` Christian König
2026-11-24 2:55 ` Alistair Popple
2026-11-20 5:55 ` [PATCH v3 02/24] dma-buf: Introduce DMA-buf mapping types Alistair Popple
2026-11-20 5:55 ` [PATCH v3 03/24] dma-buf: Add the SGT DMA mapping type Alistair Popple
2026-11-23 13:36 ` Christian König
2026-11-23 16:57 ` Jason Gunthorpe
2026-11-23 18:37 ` Christian König
2026-11-24 6:23 ` Alistair Popple
2026-11-24 12:36 ` Christian König
2026-11-24 14:20 ` Jason Gunthorpe
2026-11-24 16:02 ` Christian König
2026-11-24 19:46 ` Jason Gunthorpe
2026-11-25 7:18 ` Alistair Popple
2026-11-25 11:19 ` Christian König
2026-11-25 15:55 ` Jason Gunthorpe
2026-11-25 18:17 ` Christian König
2026-11-25 19:07 ` Jason Gunthorpe
2026-11-26 6:24 ` Alistair Popple
2026-11-26 9:58 ` Christian König
2026-11-27 0:37 ` Jason Gunthorpe
2026-11-27 4:10 ` Alistair Popple
2026-11-26 22:29 ` Dave Airlie
2026-11-27 8:04 ` Christian König
2026-11-27 12:57 ` Jason Gunthorpe
2026-11-27 13:44 ` Christian König
2026-11-30 11:52 ` Alistair Popple
2026-12-01 4:05 ` Dave Airlie
2026-12-01 7:13 ` Alistair Popple
2026-12-01 8:11 ` Christian König
2026-12-01 9:33 ` Alistair Popple
2026-12-01 13:24 ` Christian König
2026-12-01 16:22 ` Jason Gunthorpe
2026-12-02 0:47 ` Dave Airlie
2026-12-02 1:30 ` Jason Gunthorpe
2026-12-02 1:41 ` Dave Airlie
2026-12-02 3:54 ` Alistair Popple
2026-11-24 14:00 ` Jason Gunthorpe
2026-11-20 5:55 ` [PATCH v3 04/24] dma-buf: Negotiate the mapping type in dma_buf_dynamic_attach() Alistair Popple
2026-11-20 5:55 ` [PATCH v3 05/24] dma-buf: Route SGT related actions through the attachment's mapping type Alistair Popple
2026-11-20 5:55 ` [PATCH v3 06/24] dma-buf: Allow single exporter drivers to avoid the match_mapping function Alistair Popple
2026-11-20 5:55 ` [PATCH v3 07/24] dma-buf: Convert exporters allocating a table per map to the SGT mapping type Alistair Popple
2026-11-20 9:02 ` Karol Wachowski
2026-11-20 5:55 ` [PATCH v3 08/24] iommufd/selftest: Convert the test exporter " Alistair Popple
2026-11-20 5:55 ` [PATCH v3 09/24] dma-buf: Convert exporters keeping a table per attachment " Alistair Popple
2026-11-20 5:55 ` [PATCH v3 10/24] drm: Convert drm_gem_map_dma_buf() and its users " Alistair Popple
2026-11-20 5:55 ` [PATCH v3 11/24] drm/xe/dma-buf: Use " Alistair Popple
2026-11-20 5:55 ` [PATCH v3 12/24] drm/amdgpu: " Alistair Popple
2026-11-20 5:55 ` [PATCH v3 13/24] udmabuf: Convert to " Alistair Popple
2026-11-21 5:58 ` sashiko-bot
2026-11-20 5:55 ` [PATCH v3 14/24] drm/omapdrm: " Alistair Popple
2026-11-20 5:55 ` [PATCH v3 15/24] accel/ivpu: Convert the userptr exporter " Alistair Popple
2026-11-20 5:55 ` [PATCH v3 16/24] drm/vmwgfx: Use match_mapping instead of dummy calls Alistair Popple
2026-11-20 5:55 ` [PATCH v3 17/24] dma-buf: Convert dma_buf_phys_vec_to_sgt() and its users to the SGT mapping type Alistair Popple
2026-11-20 5:55 ` [PATCH v3 18/24] iio: buffer: convert to use " Alistair Popple
2026-11-20 5:55 ` [PATCH v3 19/24] functionfs: " Alistair Popple
2026-11-20 5:55 ` [PATCH v3 20/24] dma-buf: Remove unused SGT stuff from the common structures Alistair Popple
2026-11-20 5:55 ` [PATCH v3 21/24] dma-buf: Add kunit tests for mapping type Alistair Popple
2026-11-20 5:56 ` [PATCH v3 22/24] dma-buf: Let the exporter select mapping type at pin/map Alistair Popple
2026-11-20 5:56 ` [PATCH v3 23/24] dma-buf: Add dma_buf_mapping_map() returning a type-tagged mapping and implement it for sgt Alistair Popple
2026-11-21 5:58 ` sashiko-bot
2026-11-20 5:56 ` [PATCH v3 24/24] dma-buf: Add kunit tests for mapping type selection Alistair Popple
2026-11-21 5:58 ` sashiko-bot
2026-11-23 4:26 ` Alistair Popple [this message]
2026-11-21 5:58 ` [PATCH v3 00/24] DMA-buf mapping types sashiko-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=awO8FGMeDLMfDgv9@nvdebian.thelocal \
--to=apopple@nvidia.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-rdma@vger.kernel.org \
--cc=media-ci@linuxtv.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.