Re: [PATCH 7/8] docs: dma-api: update streaming DMA API physical address constraints

From: Christoph Hellwig
Date: Fri Jun 27 2025 - 08:52:24 EST


On Thu, Jun 26, 2025 at 07:06:02AM +0200, Petr Tesarik wrote:
> @Marek, @Robin Do you agree that device drivers should not be concerned
> about the physical address of a buffer passed to the streaming DMA API?
>
> I mean, are there any real-world systems with:
> * some RAM that is not DMA-addressable,
> * no IOMMU,
> * CONFIG_SWIOTLB is not set?
>
> FWIW if _I_ received a bug report that a device driver fails to submit
> I/O on such a system, I would politely explain the reporter that their
> kernel is misconfigured, and they should enable CONFIG_SWIOTLB.

Modulo the case of < 32-bit (or 31-bit for some systems) case the
general idea was that the iommu API always works except for temporary
resource shortages. Now if you configure without SWIOTLB on system
that would otherwise need it you gotta keep the pieces. That's why
I've always argued against making that (and ZONE_DMA) user selectable,
but some arch maintainers insisted that they want that, breaking the
original guarantee. Which is annoying as dma_map_* can't tell you
if the failure is permanent or transient.