]> git.baikalelectronics.ru Git - kernel.git/commit
of: also handle dma-noncoherent in of_dma_is_coherent()
authorHeiko Stuebner <heiko@sntech.de>
Wed, 6 Jul 2022 23:15:33 +0000 (01:15 +0200)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 28 Jul 2022 22:30:20 +0000 (15:30 -0700)
commita90e804996e41f239d07cc8f1cce9e332cebd430
treeac1a5426c5da997208039af6bf9859f96fef889f
parent62a6e10e77b958fc4aab05a9fe69d75a973f2bbb
of: also handle dma-noncoherent in of_dma_is_coherent()

of_dma_is_coherent() currently expects the architecture to be
non-coherent and some devices being coherent getting marked
as such with the dma-coherent devicetree property.

For PowerPC CONFIG_OF_DMA_DEFAULT_COHERENT was added which currently
makes of_dma_is_coherent() always return true but doesn't handle
the case of the architecture being coherent but some devices not.

So modify the function to also check for dma-noncoherent and
set a suitable default return value. If CONFIG_OF_DMA_DEFAULT_COHERENT
is set the value starts with true and finding dma-noncoherent will
set it to false and without CONFIG_OF_DMA_DEFAULT_COHERENT, the
behaviour is reversed.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20220706231536.2041855-2-heiko@sntech.de
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
drivers/of/address.c