linux/drivers/net/ethernet/broadcom/bnx2x
Michal Schmidt 8031612d7f 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: 4cace675d6 ("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>
2015-06-28 20:25:01 -07:00
..
bnx2x.h bnx2x: fix DMA API usage 2015-06-28 20:25:01 -07:00
bnx2x_cmn.c bnx2x: fix DMA API usage 2015-06-28 20:25:01 -07:00
bnx2x_cmn.h bnx2x: fix DMA API usage 2015-06-28 20:25:01 -07:00
bnx2x_dcb.c bnx2x: Code cleanup 2014-08-22 12:31:15 -07:00
bnx2x_dcb.h bnx2x: update MAINTAINERS for bnx2x and e-mail addresses 2014-05-30 17:04:26 -07:00
bnx2x_dump.h bnx2x: ethtool -d might cause timeout in log 2014-08-25 17:30:21 -07:00
bnx2x_ethtool.c bnx2x: Release nvram lock on error flow 2015-06-25 06:30:38 -07:00
bnx2x_fw_defs.h bnx2x: Utilize FW 7.10.51 2014-08-22 12:31:15 -07:00
bnx2x_fw_file_hdr.h bnx2x: update MAINTAINERS for bnx2x and e-mail addresses 2014-05-30 17:04:26 -07:00
bnx2x_hsi.h bnx2x: Count number of link changes 2015-03-31 13:34:10 -04:00
bnx2x_init.h ethernet: codespell comment spelling fixes 2015-03-08 22:54:22 -04:00
bnx2x_init_ops.h bnx2x: update MAINTAINERS for bnx2x and e-mail addresses 2014-05-30 17:04:26 -07:00
bnx2x_link.c bnx2x: Correct speed from baseT into KR. 2015-06-25 06:30:33 -07:00
bnx2x_link.h bnx2x: Fix link problems for 1G SFP RJ45 module 2014-09-05 17:28:37 -07:00
bnx2x_main.c bnx2x: fix lockdep splat 2015-06-28 17:03:27 -07:00
bnx2x_mfw_req.h bnx2x: Introduce 2013 and advance version to 1.78.02 2013-01-15 15:07:59 -05:00
bnx2x_reg.h bnx2x: Configure IFir et al. according to nvram 2015-03-31 13:34:10 -04:00
bnx2x_sp.c bnx2x: Prevent false warning when accessing MACs 2015-06-25 06:30:34 -07:00
bnx2x_sp.h bnx2x: Use correct fastpath version for VFs. 2014-12-09 14:29:10 -05:00
bnx2x_sriov.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-04-15 09:00:47 -07:00
bnx2x_sriov.h bnx2x: Use correct fastpath version for VFs. 2014-12-09 14:29:10 -05:00
bnx2x_stats.c bnx2x: Move statistics implementation into semaphores 2015-06-01 12:04:31 -07:00
bnx2x_stats.h bnx2x: Fix statistics locking scheme 2015-03-23 22:38:24 -04:00
bnx2x_vfpf.c bnx2x: merge fp->disable_tpa with fp->mode 2015-04-29 14:48:35 -04:00
bnx2x_vfpf.h bnx2x: Use correct fastpath version for VFs. 2014-12-09 14:29:10 -05:00
Makefile bnx2x: Segregate SR-IOV code 2013-01-07 19:49:14 -08:00