]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
block-dma: properly take MMIO path
authorLeon Romanovsky <leonro@nvidia.com>
Fri, 14 Nov 2025 09:07:04 +0000 (11:07 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 14 Nov 2025 12:09:56 +0000 (05:09 -0700)
commit37f0c7a8df7ad719a68fa1c2dbf066cfebc391a7
tree4512b28a5e01e2d581381a7f75fce083be3e906b
parent61d43b1731e0bc122a0f78df42ce424db5b14a19
block-dma: properly take MMIO path

In commit eadaa8b255f3 ("dma-mapping: introduce new DMA attribute to
indicate MMIO memory"), DMA_ATTR_MMIO attribute was added to describe
MMIO addresses, which require to avoid any memory cache flushing, as
an outcome of the discussion pointed in Link tag below.

In case of PCI_P2PDMA_MAP_THRU_HOST_BRIDGE transfer, blk-mq-dm logic
treated this as regular page and relied on "struct page" DMA flow.
That flow performs CPU cache flushing, which shouldn't be done here,
and doesn't set IOMMU_MMIO flag in DMA-IOMMU case.

As a solution, let's encode peer-to-peer transaction type in NVMe IOD
flags variable and provide it to blk-mq-dma API.

Link: https://lore.kernel.org/all/f912c446-1ae9-4390-9c11-00dce7bf0fd3@arm.com/
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq-dma.c
drivers/nvme/host/pci.c
include/linux/bio-integrity.h
include/linux/blk-integrity.h
include/linux/blk-mq-dma.h
include/linux/blk_types.h