Commit 33b16dc8 authored by Christoph Hellwig's avatar Christoph Hellwig

net/au1000-eth: stop using DMA_ATTR_NON_CONSISTENT

The au1000-eth driver contains none of the manual cache synchronization
required for using DMA_ATTR_NON_CONSISTENT.  From what I can tell it
can be used on both dma coherent and non-coherent DMA platforms, but
I suspect it has been buggy on the non-coherent platforms all along.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent e0ec8a4d
...@@ -1131,10 +1131,9 @@ static int au1000_probe(struct platform_device *pdev) ...@@ -1131,10 +1131,9 @@ static int au1000_probe(struct platform_device *pdev)
/* Allocate the data buffers /* Allocate the data buffers
* Snooping works fine with eth on all au1xxx * Snooping works fine with eth on all au1xxx
*/ */
aup->vaddr = (u32)dma_alloc_attrs(&pdev->dev, MAX_BUF_SIZE * aup->vaddr = (u32)dma_alloc_coherent(&pdev->dev, MAX_BUF_SIZE *
(NUM_TX_BUFFS + NUM_RX_BUFFS), (NUM_TX_BUFFS + NUM_RX_BUFFS),
&aup->dma_addr, 0, &aup->dma_addr, 0);
DMA_ATTR_NON_CONSISTENT);
if (!aup->vaddr) { if (!aup->vaddr) {
dev_err(&pdev->dev, "failed to allocate data buffers\n"); dev_err(&pdev->dev, "failed to allocate data buffers\n");
err = -ENOMEM; err = -ENOMEM;
...@@ -1310,9 +1309,8 @@ static int au1000_probe(struct platform_device *pdev) ...@@ -1310,9 +1309,8 @@ static int au1000_probe(struct platform_device *pdev)
err_remap2: err_remap2:
iounmap(aup->mac); iounmap(aup->mac);
err_remap1: err_remap1:
dma_free_attrs(&pdev->dev, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS), dma_free_coherent(&pdev->dev, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS),
(void *)aup->vaddr, aup->dma_addr, (void *)aup->vaddr, aup->dma_addr);
DMA_ATTR_NON_CONSISTENT);
err_vaddr: err_vaddr:
free_netdev(dev); free_netdev(dev);
err_alloc: err_alloc:
...@@ -1344,9 +1342,8 @@ static int au1000_remove(struct platform_device *pdev) ...@@ -1344,9 +1342,8 @@ static int au1000_remove(struct platform_device *pdev)
if (aup->tx_db_inuse[i]) if (aup->tx_db_inuse[i])
au1000_ReleaseDB(aup, aup->tx_db_inuse[i]); au1000_ReleaseDB(aup, aup->tx_db_inuse[i]);
dma_free_attrs(&pdev->dev, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS), dma_free_coherent(&pdev->dev, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS),
(void *)aup->vaddr, aup->dma_addr, (void *)aup->vaddr, aup->dma_addr);
DMA_ATTR_NON_CONSISTENT);
iounmap(aup->macdma); iounmap(aup->macdma);
iounmap(aup->mac); iounmap(aup->mac);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment