Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2370f07 authored by Sergei Shtylyov's avatar Sergei Shtylyov Committed by David S. Miller
Browse files

ravb: do not invalidate cache for RX buffer twice



First, dma_sync_single_for_cpu() shouldn't have been called in the first place
(it's a streaming DMA API), dma_unmap_single() should have been called instead.
Second, dma_unmap_single() call after handing the buffer to napi_gro_receive()
makes little sense.  Moreover desc->dptr might not be valid at this point.

Signed-off-by: default avatarSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 15afb10d
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -543,8 +543,7 @@ static bool ravb_rx(struct net_device *ndev, int *quota, int q)

			skb = priv->rx_skb[q][entry];
			priv->rx_skb[q][entry] = NULL;
			dma_sync_single_for_cpu(&ndev->dev,
						le32_to_cpu(desc->dptr),
			dma_unmap_single(&ndev->dev, le32_to_cpu(desc->dptr),
					 ALIGN(PKT_BUF_SZ, 16),
					 DMA_FROM_DEVICE);
			get_ts &= (q == RAVB_NC) ?
@@ -584,9 +583,6 @@ static bool ravb_rx(struct net_device *ndev, int *quota, int q)
			if (!skb)
				break;	/* Better luck next round. */
			ravb_set_buffer_align(skb);
			dma_unmap_single(&ndev->dev, le32_to_cpu(desc->dptr),
					 ALIGN(PKT_BUF_SZ, 16),
					 DMA_FROM_DEVICE);
			dma_addr = dma_map_single(&ndev->dev, skb->data,
						  le16_to_cpu(desc->ds_cc),
						  DMA_FROM_DEVICE);