Thread (98 messages) 98 messages, 9 authors, 2012-01-22

Re: [PATCH] sky2: Fix WARNING: at lib/dma-debug.c:902 check_sync

From: "Michael Chan" <mchan@broadcom.com>
Date: 2010-01-20 20:22:35
Also in: lkml

On Wed, 2010-01-20 at 10:03 -0800, Stephen Hemminger wrote:
On Wed, 20 Jan 2010 09:41:03 +0000
Jarek Poplawski [off-list ref] wrote:
quoted
quoted
Seems like an underlying bug in the DMA api. Maybe it just can't
handle operations on partial mapping.

Other drivers with same problem:
  bnx2, cassini, pcnet32, r8169, rrunner, skge, sungem, tg3, 
It seems using the same length (even without pci_unmap_len()) is
crucial here, but I hope maintainers (added to CC) will take care.
I'm still unsure how to do dma_sync properly in bnx2.  In the current
code, we always dma_sync_for_cpu a small portion of the SKB because the
rx descriptor is at the beginning of the SKB.  We get the packet length,
for example, from the rx descriptor.

If it's a big packet, we'll simply unmap the entire SKB buffer (with the
beginning portion already dma_sync'ed).  If the packet is smaller than
what we dma_sync'ed, we'll just copy the data to a new SKB.  We'll then
dma_sync_for_device the portion of the original buffer and recycle the
whole buffer back to the device for new packets.

So, is it correct to just change the dma_sync length to the full length
of the buffer?  It doesn't sound right to me.

Thanks.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help