diff options
author | Lendacky, Thomas <Thomas.Lendacky@amd.com> | 2015-07-06 19:57:37 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-07-09 01:57:14 +0300 |
commit | cfbfd86bfde15020bccde377e11586ee5c8b701d (patch) | |
tree | 6b129aeb7b38ea566f1548463ec32a7a9550dcf5 /drivers/net/ethernet/amd/xgbe/xgbe-desc.c | |
parent | 95ec655bc465ccb2a3329d4aff9a45e3c8188db5 (diff) | |
download | linux-cfbfd86bfde15020bccde377e11586ee5c8b701d.tar.xz |
amd-xgbe: Fix DMA API debug warning
When running a kernel configured with CONFIG_DMA_API_DEBUG=y a warning
is issued:
DMA-API: device driver tries to sync DMA memory it has not allocated
This warning is the result of mapping the full range of the Rx buffer
pages allocated and then performing a dma_sync_single_for_cpu against
a calculated DMA address. The proper thing to do is to use the
dma_sync_single_range_for_cpu with a base DMA address and an offset.
Reported-by: Kim Phillips <kim.phillips@arm.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Tested-by: Kim Phillips <kim.phillips@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amd/xgbe/xgbe-desc.c')
-rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-desc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-desc.c b/drivers/net/ethernet/amd/xgbe/xgbe-desc.c index 661cdaa7ea96..b3bc87fe3764 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-desc.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-desc.c @@ -303,7 +303,8 @@ static void xgbe_set_buffer_data(struct xgbe_buffer_data *bd, get_page(pa->pages); bd->pa = *pa; - bd->dma = pa->pages_dma + pa->pages_offset; + bd->dma_base = pa->pages_dma; + bd->dma_off = pa->pages_offset; bd->dma_len = len; pa->pages_offset += len; |