[PATCH] Re: atl1 64-bit => 32-bit DMA borkage (reproducible, bisected)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jay Cliburn <jacliburn@...>
Cc: Chris Snook <csnook@...>, Luca Tettamanti <kronos.it@...>, Jeff Garzik <jeff@...>, Andrew Morton <akpm@...>, <linux-kernel@...>, <netdev@...>
Date: Saturday, May 10, 2008 - 3:31 pm

On Fri, May 09, 2008 at 02:38:54PM -0500, Jay Cliburn wrote:

Try this patch! If scared, remove swiotlb poisoning, I'm not entirely
sure it's correct, but it makes aforementioned second oops
deterministic.

--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2027,6 +2029,7 @@ rrd_ok:
 		/* Good Receive */
 		pci_unmap_page(adapter->pdev, buffer_info->dma,
 			       buffer_info->length, PCI_DMA_FROMDEVICE);
+		buffer_info->dma = 0;
 		skb = buffer_info->skb;
 		length = le16_to_cpu(rrd->xsz.xsum_sz.pkt_size);
 
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index d568894..f6165ed 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -399,12 +399,14 @@ unmap_single(struct device *hwdev, char *dma_addr, size_t size, int dir)
 	/*
 	 * First, sync the memory before unmapping the entry
 	 */
-	if (buffer && ((dir == DMA_FROM_DEVICE) || (dir == DMA_BIDIRECTIONAL)))
+	if (buffer && ((dir == DMA_FROM_DEVICE) || (dir == DMA_BIDIRECTIONAL))) {
 		/*
 		 * bounce... copy the data back into the original buffer * and
 		 * delete the bounce buffer.
 		 */
 		memcpy(buffer, dma_addr, size);
+		io_tlb_orig_addr[index] = (void *)0x9a9a9a9a9a9a9a9aUL;
+	}
 
 	/*
 	 * Return the buffer to the free list by setting the corresponding

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.25-rc8-mm2, Andrew Morton, (Thu Apr 10, 11:33 pm)
BUG at __dentry_open [Was: 2.6.25-rc8-mm2], Jiri Slaby, (Mon Apr 14, 4:07 am)
2.6.25-rc8-mm2, , (Sat Apr 12, 5:41 am)
Re: 2.6.25-rc8-mm2: IP: [&lt;ffffffff802868f9&gt;] __kmalloc..., Christoph Lameter, (Mon Apr 14, 1:53 pm)
Re: 2.6.25-rc8-mm2: IP: [&lt;ffffffff802868f9&gt;] __kmalloc..., Christoph Lameter, (Mon Apr 14, 1:57 pm)
Re: 2.6.25-rc8-mm2: FIX kmalloc-2048 (was Re: 2.6.25-rc8-mm2..., Christoph Lameter, (Mon Apr 14, 4:05 pm)
atl1 64-bit =&gt; 32-bit DMA borkage (reproducible, bisected), Alexey Dobriyan, (Sat Apr 19, 10:45 am)
[PATCH] Re: atl1 64-bit => 32-bit DMA borkage (reproducib..., Alexey Dobriyan, (Sat May 10, 3:31 pm)
Re: 2.6.25-rc8-mm2: IP: [&lt;ffffffff802868f9&gt;] __kmalloc..., Christoph Lameter, (Mon Apr 14, 2:00 pm)
[mm patch] select ATA_SFF, Adrian Bunk, (Sat Apr 12, 8:51 pm)
Re: 2.6.25-rc8-mm2, KAMEZAWA Hiroyuki, (Fri Apr 11, 5:57 am)
Re: 2.6.25-rc8-mm2, KAMEZAWA Hiroyuki, (Fri Apr 11, 6:23 am)
Re: 2.6.25-rc8-mm2, Pekka Enberg, (Fri Apr 11, 6:34 am)
Re: 2.6.25-rc8-mm2, KAMEZAWA Hiroyuki, (Fri Apr 11, 6:57 am)
Re: 2.6.25-rc8-mm2, KAMEZAWA Hiroyuki, (Fri Apr 11, 7:17 am)
Re: 2.6.25-rc8-mm2, KAMEZAWA Hiroyuki, (Fri Apr 11, 9:17 am)
Re: 2.6.25-rc8-mm2, Pekka Enberg, (Fri Apr 11, 10:24 am)
Re: 2.6.25-rc8-mm2, KAMEZAWA Hiroyuki, (Sun Apr 13, 11:13 pm)
Re: 2.6.25-rc8-mm2, Adrian Bunk, (Fri Apr 11, 9:40 am)
Re: 2.6.25-rc8-mm2, Andrew Morton, (Sat Apr 12, 12:22 am)
Re: 2.6.25-rc8-mm2, Aneesh Kumar K.V, (Sat Apr 12, 2:43 pm)
Re: 2.6.25-rc8-mm2, Michael Schmitz, (Sun Apr 13, 3:45 am)
Re: 2.6.25-rc8-mm2, Geert Uytterhoeven, (Sun Apr 13, 4:11 am)
Re: 2.6.25-rc8-mm2, , (Sat Apr 12, 1:53 am)
Re: 2.6.25-rc8-mm2, Andrew Morton, (Sat Apr 12, 2:07 am)
Re: 2.6.25-rc8-mm2: Observed problems: Not a detailed bug re..., Rafael J. Wysocki, (Tue Apr 15, 4:12 pm)