diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2015-06-26 17:50:00 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-06-28 20:25:01 -0700 |
commit | 8031612d7fa8e49589a91da238a93a067826c668 (patch) | |
tree | 9f6e8e33b79fed5adc75395a49faa33949fdbe31 /drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |
parent | 0f8b6cea1f3271ccc37dd2847b39e235461e0ced (diff) | |
download | linux-8031612d7fa8e49589a91da238a93a067826c668.tar.gz linux-8031612d7fa8e49589a91da238a93a067826c668.tar.bz2 linux-8031612d7fa8e49589a91da238a93a067826c668.zip |
bnx2x: fix DMA API usage
With CONFIG_DMA_API_DEBUG=y bnx2x triggers the error "DMA-API: device
driver frees DMA memory with wrong function".
On archs where PAGE_SIZE > SGE_PAGE_SIZE it also triggers "DMA-API:
device driver frees DMA memory with different size".
Fix this by making the mapping and unmapping symmetric:
- Do not map the whole pool page at once. Instead map the
SGE_PAGE_SIZE-sized pieces individually, so they can be unmapped in
the same manner.
- What's mapped using dma_map_page() must be unmapped using
dma_unmap_page().
Tested on ppc64.
Fixes: 4cace675d687 ("bnx2x: Alloc 4k fragment for each rx ring buffer element")
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x.h')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index b4bfdd29fb54..cd4ae76bbff2 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h @@ -530,7 +530,6 @@ enum bnx2x_tpa_mode_t { struct bnx2x_alloc_pool { struct page *page; - dma_addr_t dma; unsigned int offset; }; |