Re: [PATCH 5/6] net: fec: use dma_alloc_noncoherent for m532x

Greg Ungerer
2023-10-11T13:09:21Z

On 11/10/23 15:52, Christoph Hellwig wrote:
> On Wed, Oct 11, 2023 at 12:20:57AM +1000, Greg Ungerer wrote:
>> That should be M532x.
>>
>> I am pretty sure the code as-is today is broken for the case of using
>> the split cache arrangement (so both instruction and data cache) for any
>> of the version 2 cores too (denoted by the HAVE_CACHE_SPLIT option).
>> But that has probably not been picked up because the default on those
>> has always been instruction cache only.
>>
>> The reason for the special case for the M532x series is that it is a version 3
>> core and they have a unified instruction and data cache. The 523x series is the
>> only version 3 core that Linux supports that has the FEC hardware module.
>
> So what config option should we check for supporting coherent allocations
> and which not having the hack in fec?
>
> Here is my guesses based on the above:
>
> in m68k support coherent allocations with no work if
>
> CONFIG_COLDIFRE is set and neither CONFIG_CACHE_D or CONFIG_CACHE_BOTH
> is set.

I think this needs to be CONFIG_COLDFIRE is set and none of CONFIG_HAVE_CACHE_CB or
CONFIG_CACHE_D or CONFIG_CACHE_BOTH are set.

> in the fec driver do the alloc_noncoherent and global cache flush
> hack if:
>
> COMFIG_COLDFIRE && (CONFIG_CACHE_D || CONFIG_CACHE_BOTH)

And then this becomes:

CONFIG_COLDFIRE && (CONFIG_HAVE_CACHE_CB || CONFIG_CACHE_D || CONFIG_CACHE_BOTH)