[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <3E55E1F7-7A34-4165-9BF4-C2AAF6A6CFC1@flygoat.com>
Date: Wed, 22 Feb 2023 17:57:44 +0000
From: Jiaxun Yang <jiaxun.yang@...goat.com>
To: Robin Murphy <robin.murphy@....com>
Cc: "linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>,
linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
mpe@...erman.id.au, paul.walmsley@...ive.com, palmer@...belt.com,
Rob Herring <robh+dt@...nel.org>,
Christoph Hellwig <hch@....de>, m.szyprowski@...sung.com,
linux-riscv@...ts.infradead.org
Subject: Re: [PATCH 3/3] of: address: Use dma_default_coherent to determine
default coherency
> 2023年2月22日 17:24,Robin Murphy <robin.murphy@....com> 写道:
[...]
>
> AFAICS, all you should actually need is a single self-contained addition here, something like:
>
> + /*
> + * DT-based MIPS doesn't use OF_DMA_DEFAULT_COHERENT, but
> + * might override the system-wide default at runtime.
> + */
> +#if defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \
> + defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU) || \
> + defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL)
> + is_coherent = dma_default_coherent;
> +#endif
That makes more sense, thanks.
I’ll append CONFIG_MIPS as a condition here as well because it may break RISC-V whose dma_default_coherent
is not set to true from very beginning.
>
>> node = of_node_get(np);
>>
>
> Then *after* that's fixed, we can do a more comprehensive refactoring to merge the two mechanisms properly. FWIW I think I'd prefer an approach closer to the first one, where config options control the initial value of dma_default_coherent rather than architectures having to override it unconditionally (and TBH I'd also like to have a generic config symbol for whether an arch supports per-device coherency or not).
Ok I’ll try to revert to the initial way.
Is there any reason that an arch can’t support per-device coherency?
Thanks
- Jiaxun
>
> Thanks,
> Robin.
Powered by blists - more mailing lists