8139cp WARNING: at lib/dma-debug.c:803 check_unmap+0x41a/0x650()
Hi
I'm getting this warning message from my kvm machine (created with this network card -net nic,model=rtl8139)
WARNING: at lib/dma-debug.c:803 check_unmap+0x41a/0x650()
Hardware name:
8139cp 0000:00:03.0: DMA-API: device driver frees DMA memory with different size [device address=0x000000001ebda0b2] [map size=1536 bytes] [unmap size=1538 bytes]
Modules linked in: dm_crypt crypto_blkcipher crypto_algapi loop
virtio_balloon uhci_hcd ehci_hcd dm_mod psmouse i2c_piix4 8139cp evdev virtio_pci virtio_ring serio_raw virtio mii i2c_core usbcore rtc_cmos rtc_core rtc_lib floppy button
Pid: 0, comm: swapper Not tainted 2.6.31-rc5-00472-g3d32107 #4
Call Trace: <IRQ> [<ffffffff8104c4fb>] warn_slowpath_common+0x7b/0xc0 [<ffffffff8104c5a1>] warn_slowpath_fmt+0x41/0x50 [<ffffffff811e881a>] check_unmap+0x41a/0x650
[<ffffffff8107accc>] ? trace_hardirqs_on_caller+0x7c/0x1a0
[<ffffffff811e8ca9>] debug_dma_unmap_page+0x59/0x60 [<ffffffffa0096ce1>] cp_rx_poll+0x301/0x550 [8139cp] [<ffffffff812f9050>] net_rx_action+0x170/0x270
[<ffffffff812f8fce>] ? net_rx_action+0xee/0x270
[<ffffffff81052e7c>] __do_softirq+0xbc/0x200 [<ffffffff8100d2dc>] call_softirq+0x1c/0x50 [<ffffffff8100eb65>] do_softirq+0x75/0xb0 [<ffffffff81052935>] irq_exit+0x95/0xa0 [<ffffffff81386001>] smp_apic_timer_interrupt+0x71/0x9c [<ffffffff8100ccb3>] apic_timer_interrupt+0x13/0x20
<EOI> [<ffffffff81014513>] ? default_idle+0x53/0xe0
[<ffffffff81014511>] ? default_idle+0x51/0xe0
[<ffffffff8100ae80>] ? cpu_idle+0x70/0xc0
[<ffffffff81379eea>] ? start_secondary+0x189/0x18e
---[ end trace d222049dbdb8d58c ]---
Mapped at:
[<ffffffff811e98a6>] debug_dma_map_page+0x86/0x170 [<ffffffffa00965d7>] cp_init_rings+0x167/0x230 [8139cp] [<ffffffffa009689d>] cp_open+0xdd/0x220 [8139cp] [<ffffffff812f81b1>] dev_open+0xa1/0x100 [<ffffffff812f7fe6>] dev_change_flags+0x96/0x1c0
NET: Registered protocol family 10
Zdenek
PATCH 1/1 8139cp : balance dma_map_single vs dma_unmap_single pair
The driver always:
1. allocate cp->rx_buf_sz + NET_IP_ALIGN
2. map cp->rx_buf_sz
--- drivers/net/8139cp.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/net/8139cp.c +2 -3
@@ -515,7 +515,7 @@ rx_status_loop:dma_addr_t mapping;struct sk_buff *skb, *new_skb;struct cp_desc *desc; -unsigned buflen; +const unsigned buflen = cp->rx_buf_sz; skb = cp->rx_skb[rx_tail];BUG_ON (!skb);
@@ -549,8 +549,7 @@ rx_status_loop:pr_debug ("%s: rx slot %d status 0x%x len %d\n" , dev->name, rx_tail, status, len); - buflen = cp->rx_buf_sz +NET_IP_ALIGN ; - new_skb =netdev_alloc_skb (dev, buflen); + new_skb =netdev_alloc_skb (dev, buflen +NET_IP_ALIGN );if (!new_skb) { dev->stats.rx_dropped++; goto rx_next;
Signature · 1 line
1.6.2.5
Re: [PATCH] 8139cp : balance dma_map_single vs dma_unmap_single pair
From: Francois Romieu <[email protected]>
Date: Tue, 11 Aug 2009 21:46:22 +0200
Quoted 5 lines
The driver always:
1. allocatecp->rx_buf_sz+NET_IP_ALIGN
2. mapcp->rx_buf_szSigned-off-by Francois Romieu <[email protected]>
Applied, thanks Francois!
But...
1) I don't expect upstream patches in my work email inbox.
2) Please send networking patches to [email protected], and if you do that then getting #1 right isn't so critical :-)
Thanks again!