[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221202070223.GA12459@lst.de>
Date: Fri, 2 Dec 2022 08:02:23 +0100
From: Christoph Hellwig <hch@....de>
To: Greg Ungerer <gerg@...ux-m68k.org>
Cc: Christoph Hellwig <hch@....de>,
Joakim Zhang <qiangqing.zhang@....com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
linux-m68k@...ts.linux-m68k.org, uclinux-dev@...inux.org,
netdev@...r.kernel.org
Subject: Re: [PATCH 1/2] net: fec: use dma_alloc_noncoherent for m532x
On Thu, Dec 01, 2022 at 03:41:34PM +1000, Greg Ungerer wrote:
>> #ifdef CONFIG_M532x
>> + /*
>> + * Hacky flush of all caches instead of using the DMA API for the TSO
>> + * headers.
>> + */
>> flush_cache_all();
>
> Even with this corrected this will now end up failing on all other ColdFire types
> with the FEC hardware module (all the non-M532x types) once the arch_dma_alloc()
> returns NULL.
>
> Did you mean "ifndef CONFIG_COLDFIRE" here?
How did these work before given that the cache flush is conditional
on CONFIG_M532x?
>> +#else
>> + /* m68knommu manually flushes all caches in fec_enet_rx_queue */
>> + txq->tso_hdrs = dma_alloc_noncoherent(&fep->pdev->dev,
>> + txq->bd.ring_size * TSO_HEADER_SIZE,
>> + &txq->tso_hdrs_dma, DMA_BIDIRECTIONAL,
>> + GFP_KERNEL);
>> +#endif
>> if (!txq->tso_hdrs) {
>> ret = -ENOMEM;
>> goto alloc_failed;
>
> And what about the dmam_alloc_coherent() call in fec_enet_init()?
> Does that need changing too?
If that's actually use by the FEC implementations on coldire: yes.
But maybe I need even more help on how the cache flushing is suppoѕed
to actually work here.
Powered by blists - more mailing lists