dma-mapping: fix handling of dma-ranges for reserved memory (again)
authorVladimir Murzin <vladimir.murzin@arm.com>
Wed, 30 Oct 2019 10:13:13 +0000 (10:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Jan 2020 18:17:00 +0000 (19:17 +0100)
commitfee76d84ba258022865d00c1817281fbdc494bf9
treee1712f0c6b1864174f6de04c6e182731685a915c
parent686dd313a2caaa374f21087cce768d44b534a170
dma-mapping: fix handling of dma-ranges for reserved memory (again)

[ Upstream commit a445e940ea686fc60475564009821010eb213be3 ]

Daniele reported that issue previously fixed in c41f9ea998f3
("drivers: dma-coherent: Account dma_pfn_offset when used with device
tree") reappear shortly after 43fc509c3efb ("dma-coherent: introduce
interface for default DMA pool") where fix was accidentally dropped.

Lets put fix back in place and respect dma-ranges for reserved memory.

Fixes: 43fc509c3efb ("dma-coherent: introduce interface for default DMA pool")

Reported-by: Daniele Alessandrelli <daniele.alessandrelli@gmail.com>
Tested-by: Daniele Alessandrelli <daniele.alessandrelli@gmail.com>
Tested-by: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/mm/dma-mapping-nommu.c
include/linux/dma-mapping.h
kernel/dma/coherent.c