lkml.org 
[lkml]   [2023]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/3] of: address: Use dma_default_coherent to determine default coherency
From
Date


> 2023年2月22日 17:24,Robin Murphy <robin.murphy@arm.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.


\
 
 \ /
  Last update: 2023-03-27 00:32    [W:0.236 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site