summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2026-10-28 10:41:35 -0600
committerJens Axboe <axboe@kernel.dk>2026-10-29 07:15:47 -0600
commit035236c9e135a2ce7d0f68cb56e63d4a3da2abe1 (patch)
tree3341acc00524abbccfb4f6fe1b7b33dc35200412
parent0db9f8968a8941d4fc9fddf220d4983d9b68deaf (diff)
downloadlinux-035236c9e135a2ce7d0f68cb56e63d4a3da2abe1.tar.gz
linux-035236c9e135a2ce7d0f68cb56e63d4a3da2abe1.zip
blk-mq-dma: initialize the dma state for P2P, too
blk_rq_dma_map_iter_start() promises that the caller need not initialize the dma_iova_state, but the P2P bus address path returns before it does so. The state then holds what the last request with that tag left, and blk_rq_dma_map_coalesce() describes a transfer as one IOVA range that it isn't. Clear it on that path too. Fixes: 858299dc6160 ("block: add scatterlist-less DMA mapping helpers") Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20261028164415.1262013-33-axboe@kernel.dk Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/blk-mq-dma.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-mq-dma.c b/block/blk-mq-dma.c
index 88fd9cbc951f..e0e7a18790b5 100644
--- a/block/blk-mq-dma.c
+++ b/block/blk-mq-dma.c
@@ -181,6 +181,8 @@ static bool blk_dma_map_iter_start(struct request *req, struct device *dma_dev,
switch (pci_p2pdma_state(&iter->p2pdma, dma_dev,
phys_to_page(vec.paddr))) {
case PCI_P2PDMA_MAP_BUS_ADDR:
+ /* don't leave the state of an earlier mapping to the caller */
+ memset(state, 0, sizeof(*state));
return blk_dma_map_bus(iter, &vec);
case PCI_P2PDMA_MAP_THRU_HOST_BRIDGE:
/*