linux/drivers/net/ethernet
Ezequiel Garcia a328f3a059 net: mvneta: Fix incorrect DMA unmapping size
The current code unmaps the DMA mapping created for rx skb_buff's by
using the data_size as the the mapping size. This is wrong since the
correct size to specify should match the size used to create the mapping.

This commit removes the following DMA_API_DEBUG warning:

------------[ cut here ]------------
WARNING: at lib/dma-debug.c:887 check_unmap+0x3a8/0x860()
mvneta d0070000.ethernet: DMA-API: device driver frees DMA memory with different size [device address=0x000000002eb80000] [map size=1600 bytes] [unmap size=66 bytes]
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.10.21-01444-ga88ae13-dirty #92
[<c0013600>] (unwind_backtrace+0x0/0xf8) from [<c0010fb8>] (show_stack+0x10/0x14)
[<c0010fb8>] (show_stack+0x10/0x14) from [<c001afa0>] (warn_slowpath_common+0x48/0x68)
[<c001afa0>] (warn_slowpath_common+0x48/0x68) from [<c001b01c>] (warn_slowpath_fmt+0x30/0x40)
[<c001b01c>] (warn_slowpath_fmt+0x30/0x40) from [<c018d0fc>] (check_unmap+0x3a8/0x860)
[<c018d0fc>] (check_unmap+0x3a8/0x860) from [<c018d734>] (debug_dma_unmap_page+0x64/0x70)
[<c018d734>] (debug_dma_unmap_page+0x64/0x70) from [<c0233f78>] (mvneta_rx+0xec/0x468)
[<c0233f78>] (mvneta_rx+0xec/0x468) from [<c023436c>] (mvneta_poll+0x78/0x16c)
[<c023436c>] (mvneta_poll+0x78/0x16c) from [<c02db468>] (net_rx_action+0x94/0x160)
[<c02db468>] (net_rx_action+0x94/0x160) from [<c0021e68>] (__do_softirq+0xe8/0x1d0)
[<c0021e68>] (__do_softirq+0xe8/0x1d0) from [<c0021ff8>] (do_softirq+0x4c/0x58)
[<c0021ff8>] (do_softirq+0x4c/0x58) from [<c0022228>] (irq_exit+0x58/0x90)
[<c0022228>] (irq_exit+0x58/0x90) from [<c000e7c8>] (handle_IRQ+0x3c/0x94)
[<c000e7c8>] (handle_IRQ+0x3c/0x94) from [<c0008548>] (armada_370_xp_handle_irq+0x4c/0xb4)
[<c0008548>] (armada_370_xp_handle_irq+0x4c/0xb4) from [<c000dc20>] (__irq_svc+0x40/0x50)
Exception stack(0xc04f1f70 to 0xc04f1fb8)
1f60:                                     c1fe46f8 00000000 00001d92 00001d92
1f80: c04f0000 c04f0000 c04f84a4 c03e081c c05220e7 00000001 c05220e7 c04f0000
1fa0: 00000000 c04f1fb8 c000eaf8 c004c048 60000113 ffffffff
[<c000dc20>] (__irq_svc+0x40/0x50) from [<c004c048>] (cpu_startup_entry+0x54/0x128)
[<c004c048>] (cpu_startup_entry+0x54/0x128) from [<c04c1a14>] (start_kernel+0x29c/0x2f0)
[<c04c1a14>] (start_kernel+0x29c/0x2f0) from [<00008074>] (0x8074)
---[ end trace d4955f6acd178110 ]---
Mapped at:
 [<c018d600>] debug_dma_map_page+0x4c/0x11c
 [<c0235d6c>] mvneta_setup_rxqs+0x398/0x598
 [<c0236084>] mvneta_open+0x40/0x17c
 [<c02dbbd4>] __dev_open+0x9c/0x100
 [<c02dbe58>] __dev_change_flags+0x7c/0x134

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-06 15:43:44 -05:00
..
3com net: typhoon: remove unnecessary pci_set_drvdata() 2013-10-18 00:03:28 -04:00
8390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-11-13 17:40:34 +09:00
adaptec net: starfire: remove unnecessary pci_set_drvdata() 2013-10-18 00:03:28 -04:00
adi adi: Remove extern from function prototypes 2013-09-24 10:09:18 -04:00
aeroflex drivers:net: Convert dma_alloc_coherent(...__GFP_ZERO) to dma_zalloc_coherent 2013-08-29 21:55:23 -04:00
allwinner
alteon
amd Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-11-13 17:40:34 +09:00
apple macmace: add missing platform_set_drvdata() in mace_probe() 2013-11-11 14:02:08 -05:00
arc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-11-13 17:40:34 +09:00
atheros alx: Reset phy speed after resume 2013-11-14 17:14:42 -05:00
broadcom bnx2x: avoid null pointer dereference when enabling SR-IOV 2013-12-05 20:56:56 -05:00
brocade Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 07:55:21 +09:00
cadence Remove GENERIC_HARDIRQ config option 2013-09-13 15:09:52 +02:00
calxeda net: calxedaxgmac: Fix panic caused by MTU change of active interface 2013-11-07 19:25:53 -05:00
chelsio cxgb4: Add new scheme to update T4/T5 firmware 2013-12-03 16:55:40 -05:00
cirrus net: ep93xx_eth: use dev_get_platdata() 2013-08-30 17:43:35 -04:00
cisco net: enic: remove unnecessary pci_set_drvdata() 2013-10-18 00:03:30 -04:00
davicom Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-10-23 16:49:34 -04:00
dec net: tulip: use DEFINE_PCI_DEVICE_TABLE 2013-10-22 02:19:23 -04:00
dlink net: dl2k: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:00 -04:00
emulex be2net: Free/delete pmacs (in be_clear()) only if they exist 2013-12-06 15:03:40 -05:00
faraday drivers:net: Convert dma_alloc_coherent(...__GFP_ZERO) to dma_zalloc_coherent 2013-08-29 21:55:23 -04:00
freescale net: fec_main: dma_map() only the length of the skb 2013-12-02 16:59:20 -05:00
fujitsu net: fujitsu: Remove ISA depdendency from Kconfig 2013-10-07 15:52:54 -04:00
hp hp100: replace hardcoded name in /proc/interrupts with interface name 2013-09-27 17:38:32 -04:00
i825xx net:drivers/net: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO 2013-11-07 03:01:59 -05:00
ibm net: do not pretend FRAGLIST support 2013-12-02 17:16:29 -05:00
icplus net: icplus: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:01 -04:00
intel ixgbe: Make ixgbe_identify_qsfp_module_generic static 2013-11-30 00:21:47 -08:00
marvell net: mvneta: Fix incorrect DMA unmapping size 2013-12-06 15:43:44 -05:00
mellanox net/mlx4_core: destroy workqueue when driver fails to register 2013-12-03 11:55:44 -05:00
micrel Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2013-11-20 13:20:24 -08:00
microchip
moxa ethernet: moxa: remove duplicate includes 2013-10-21 18:46:45 -04:00
myricom net: myri10ge: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:02 -04:00
natsemi xtsonic: add missing platform_set_drvdata() in xtsonic_probe() 2013-11-11 14:02:08 -05:00
neterion Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-14 16:30:30 +09:00
nuvoton drivers:net: delete premature free_irq 2013-09-04 13:18:19 -04:00
nvidia forcedeth: run loopback test only on chipsets that support it 2013-12-05 20:59:22 -05:00
nxp DMA-API: net: nxp/lpc_eth: use dma_coerce_mask_and_coherent() 2013-10-31 14:48:56 +00:00
octeon Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm 2013-11-14 07:55:21 +09:00
oki-semi pch_gbe: Validate hwtstamp_config completely before applying it 2013-11-14 16:22:10 -05:00
packetengines net: packetengines: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:02 -04:00
pasemi net: pasemi: remove unnecessary pci_set_drvdata() 2013-10-22 02:11:51 -04:00
qlogic qlge: Update version to 1.00.00.34 2013-12-05 20:33:47 -05:00
rdc net: r6040: remove unnecessary pci_set_drvdata() 2013-10-22 02:11:52 -04:00
realtek net: 8139cp: fix a BUG_ON triggered by wrong bytes_compl 2013-11-29 16:18:23 -05:00
renesas sh_eth: check platform data pointer 2013-11-04 15:49:28 -05:00
seeq net: seeq: use dev_get_platdata() 2013-08-30 17:43:37 -04:00
sfc sfc: Convert to use hwmon_device_register_with_groups 2013-11-29 16:26:16 -05:00
sgi net:drivers/net: Miscellaneous conversions to ETH_ALEN 2013-10-02 17:04:45 -04:00
silan
sis net: sis190: remove unnecessary pci_set_drvdata() 2013-10-22 02:11:52 -04:00
smsc net: smc91: fix crash regression on the versatile 2013-11-29 16:23:35 -05:00
stmicro stmmac: Validate hwtstamp_config completely before applying it 2013-11-14 16:22:10 -05:00
sun net: niu: remove unnecessary pci_set_drvdata() 2013-10-23 16:58:41 -04:00
tehuti net: do not pretend FRAGLIST support 2013-12-02 17:16:29 -05:00
ti net: davinci_emac: Fix platform data handling and make usable for am3517 2013-12-05 20:39:36 -05:00
tile Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-11-14 16:30:30 +09:00
toshiba net: tc35815: remove unnecessary pci_set_drvdata() 2013-10-23 16:58:41 -04:00
tundra net: tsi108: use dev_get_platdata() 2013-08-30 17:43:38 -04:00
via via-velocity: fix netif_receive_skb use in irq disabled section. 2013-11-28 18:43:35 -05:00
wiznet net: w5100: use dev_get_platdata() 2013-08-30 17:43:38 -04:00
xilinx net: do not pretend FRAGLIST support 2013-12-02 17:16:29 -05:00
xircom
xscale ixp4xx_eth: Validate hwtstamp_config completely before applying it 2013-11-14 16:22:10 -05:00
dnet.c
dnet.h
ethoc.c net: ethoc: use dev_get_platdata() 2013-08-30 17:43:35 -04:00
fealnx.c net: fealnx: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:01 -04:00
jme.c net: jme: remove unnecessary pci_set_drvdata() 2013-10-21 17:21:01 -04:00
jme.h jme: Remove unused #define PFX 2013-11-07 02:14:32 -05:00
Kconfig
korina.c net:drivers/net: Miscellaneous conversions to ETH_ALEN 2013-10-02 17:04:45 -04:00
lantiq_etop.c net: lantiq_etop: remove deprecated IRQF_DISABLED 2013-09-15 22:01:05 -04:00
Makefile
netx-eth.c net: netx-eth: remove unnecessary casting 2013-09-04 00:27:27 -04:00
s6gmac.c