On Wed, Jun 29, 2022 at 4:00 PM Heiko Stuebner <heiko@xxxxxxxxx> wrote: > > 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. > > Signed-off-by: Heiko Stuebner <heiko@xxxxxxxxx> > --- > drivers/of/address.c | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) Reviewed-by: Rob Herring <robh@xxxxxxxxxx>