On Wed, 2019-10-30 at 14:41 -0700, Christoph Hellwig wrote:
> On Fri, Oct 18, 2019 at 01:00:43PM +0200, Nicolas Saenz Julienne wrote:
> > +#ifndef CONFIG_ARCH_DMA_ADDR_T_64BIT
> > + /* Check if DMA address overflowed */
> > + if (min(addr, addr + size - 1) <
> > + __phys_to_dma(dev, (
On Fri, Oct 18, 2019 at 01:00:43PM +0200, Nicolas Saenz Julienne wrote:
> +#ifndef CONFIG_ARCH_DMA_ADDR_T_64BIT
> + /* Check if DMA address overflowed */
> + if (min(addr, addr + size - 1) <
> + __phys_to_dma(dev, (phys_addr_t)(min_low_pfn << PAGE_SHIFT)))
> + return
As seen on the new Raspberry Pi 4 and sta2x11's DMA implementation it is
possible for a device configured with 32 bit DMA addresses and a partial
DMA mapping located at the end of the address space to overflow. It
happens when a higher physical address, not DMAable, is translated to
it's DMA counte