]> git.itanic.dy.fi Git - linux-stable/commit
net: fec: use dma_alloc_noncoherent for data cache enabled coldfire
authorChristoph Hellwig <hch@lst.de>
Mon, 21 Nov 2022 09:46:09 +0000 (10:46 +0100)
committerChristoph Hellwig <hch@lst.de>
Sun, 22 Oct 2023 14:38:55 +0000 (16:38 +0200)
commitffd32a92b33b95771f63727560fa12c75191e705
tree576faf731c41ff2ef8795165e96e06b5f1353909
parent9e28bf8bdf2177a88bd6648fc741bc0280e08af8
net: fec: use dma_alloc_noncoherent for data cache enabled coldfire

Coldfire platforms with data caches can't properly implement
dma_alloc_coherent and currently just return noncoherent memory from
dma_alloc_coherent.

The fec driver than works around this with a flush of all caches in the
receive path. Make this hack a little less bad by using the explicit
dma_alloc_noncoherent API and documenting the hacky cache flushes so
that the DMA API level hack can be removed.

Also replace the check for CONFIG_M532x for said hack with a check
for COLDFIRE && !COLDFIRE_COHERENT_DMA.  While m532x is the only such
platform with a fec module, this makes the code more consistent and
easier to follow.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Greg Ungerer <gerg@linux-m68k.org>
Tested-by: Greg Ungerer <gerg@linux-m68k.org>
drivers/net/ethernet/freescale/fec_main.c