diff options
author | Ioana Radulescu <ruxandra.radulescu@nxp.com> | 2017-04-20 21:39:54 (GMT) |
---|---|---|
committer | Xie Xiaobo <xiaobo.xie@nxp.com> | 2017-09-25 07:25:25 (GMT) |
commit | 9ad5979975f9eee7724d0dbe7339b7f6797f4371 (patch) | |
tree | fffb64609c06704ff2ece7c78398fd67e0b13c02 /drivers | |
parent | 2bef4f8a874fa7ff4d934c63513cef95fc626547 (diff) | |
download | linux-9ad5979975f9eee7724d0dbe7339b7f6797f4371.tar.xz |
staging: fsl-dpaa2/eth: Map Tx buffers as bidirectional
WRIOP hardware needs to write to the hardware annotation
area of Tx buffers (status bits, timestamp, etc). Map these
buffers with DMA_BIDIRECTIONAL, otherwise the write
transaction through SMMU will not be allowed.
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c index c7bf585..b9be48d 100644 --- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c +++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c @@ -513,7 +513,7 @@ static int build_sg_fd(struct dpaa2_eth_priv *priv, swa->num_dma_bufs = num_dma_bufs; /* Separately map the SGT buffer */ - addr = dma_map_single(dev, sgt_buf, sgt_buf_size, DMA_TO_DEVICE); + addr = dma_map_single(dev, sgt_buf, sgt_buf_size, DMA_BIDIRECTIONAL); if (unlikely(dma_mapping_error(dev, addr))) { err = -ENOMEM; goto dma_map_single_failed; @@ -572,7 +572,7 @@ static int build_single_fd(struct dpaa2_eth_priv *priv, addr = dma_map_single(dev, buffer_start, skb_tail_pointer(skb) - buffer_start, - DMA_TO_DEVICE); + DMA_BIDIRECTIONAL); if (unlikely(dma_mapping_error(dev, addr))) return -ENOMEM; @@ -630,7 +630,7 @@ static void free_tx_fd(const struct dpaa2_eth_priv *priv, */ dma_unmap_single(dev, fd_addr, skb_tail_pointer(skb) - buffer_start, - DMA_TO_DEVICE); + DMA_BIDIRECTIONAL); break; case dpaa2_fd_sg: swa = (struct dpaa2_eth_swa *)skbh; @@ -646,7 +646,7 @@ static void free_tx_fd(const struct dpaa2_eth_priv *priv, /* Unmap the SGT buffer */ unmap_size = priv->tx_data_offset + sizeof(struct dpaa2_sg_entry) * (1 + num_dma_bufs); - dma_unmap_single(dev, fd_addr, unmap_size, DMA_TO_DEVICE); + dma_unmap_single(dev, fd_addr, unmap_size, DMA_BIDIRECTIONAL); break; default: /* Unsupported format, mark it as errored and give up */ |