[PATCH] arm64: dma-mapping: Fix dma_mapping_error() when bypassing SWIOTLB

Robin Murphy robin.murphy at arm.com
Wed Jan 25 04:46:19 PST 2017

On 25/01/17 12:37, Michael Zoran wrote:
> On Wed, 2017-01-25 at 12:03 +0000, Robin Murphy wrote:
>> hen bypassing SWIOTLB on small-memory systems, we need to avoid
>> calling
>> into swiotlb_dma_mapping_error() in exactly the same way as we avoid
>> swiotlb_dma_supported(), because the former also relies on SWIOTLB
>> state
>> being initialised.
> I didn't submit the initial ARM64 port of the RPI 3, so I don't know
> much about this.  But from a third personal point of view, this seems
> to side step the main issue here.

On the contrary - the main issue is that we're calling into an
uninitialised SWIOTLB, and not initialising SWIOTLB on arm64 systems
where all the RAM is below 4GB is the exact purpose of b67a8b29df7e.
This particular call was obviously overlooked in the original patch
because it happened to still work on systems with a different memory map
(or more likely without a DMA offset).


> From an ARM64 subsystem point of view, what exactly is the
> correct/recommended method for ensuring the mm subsystem is initialized
> correctly?

More information about the linux-rpi-kernel mailing list