amd-xgbe: Fix DMA API debug warning
authorLendacky, Thomas <[email protected]>
Mon, 6 Jul 2015 16:57:37 +0000 (11:57 -0500)
committerDavid S. Miller <[email protected]>
Wed, 8 Jul 2015 22:57:14 +0000 (15:57 -0700)
commitcfbfd86bfde15020bccde377e11586ee5c8b701d
tree6b129aeb7b38ea566f1548463ec32a7a9550dcf5
parent95ec655bc465ccb2a3329d4aff9a45e3c8188db5
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 <[email protected]>
Signed-off-by: Tom Lendacky <[email protected]>
Tested-by: Kim Phillips <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
drivers/net/ethernet/amd/xgbe/xgbe-desc.c
drivers/net/ethernet/amd/xgbe/xgbe-dev.c
drivers/net/ethernet/amd/xgbe/xgbe-drv.c
drivers/net/ethernet/amd/xgbe/xgbe.h