Message ID | 20230221124613.2859-5-jiaxun.yang@flygoat.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | MIPS DMA coherence fixes | expand |
On Tue, Feb 21, 2023 at 12:46:10PM +0000, Jiaxun Yang wrote: > dma_default_coherent can be useful for determine default coherency > even on arches without noncoherent support. How?
On 2023-02-21 17:58, Christoph Hellwig wrote: > On Tue, Feb 21, 2023 at 12:46:10PM +0000, Jiaxun Yang wrote: >> dma_default_coherent can be useful for determine default coherency >> even on arches without noncoherent support. > > How? Indeed, "default" is conceptually meaningless when there is no possible alternative :/ Robin.
> 2023年2月21日 17:58,Christoph Hellwig <hch@lst.de> 写道: > > On Tue, Feb 21, 2023 at 12:46:10PM +0000, Jiaxun Yang wrote: >> dma_default_coherent can be useful for determine default coherency >> even on arches without noncoherent support. > > How? I just want to make this symbol always available so OF code can reference it on all arches.
diff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h index d678afeb8a13..3c6cd17f87c3 100644 --- a/include/linux/dma-map-ops.h +++ b/include/linux/dma-map-ops.h @@ -269,6 +269,7 @@ static inline bool dev_is_dma_coherent(struct device *dev) return dev->dma_coherent; } #else +#define dma_default_coherent true static inline bool dev_is_dma_coherent(struct device *dev) { return true; diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index c026a5a5e046..e0b005c8ffce 100644 --- a/kernel/dma/mapping.c +++ b/kernel/dma/mapping.c @@ -17,7 +17,11 @@ #include "debug.h" #include "direct.h" +#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) bool dma_default_coherent; +#endif /* * Managed DMA API
dma_default_coherent can be useful for determine default coherency even on arches without noncoherent support. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> --- include/linux/dma-map-ops.h | 1 + kernel/dma/mapping.c | 4 ++++ 2 files changed, 5 insertions(+)