Skip to contentSkip to conversation

powerpc: Fix dma_map_sg() cache flushing on non coherent platforms

PATCH In review Benjamin Herrenschmidt 2 participants 2 messages Dec 1, 2008 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Fix dma_map_sg() cache flushing on non coherent platforms

On PowerPC 4xx or other non cache coherent platforms, we lost the appropriate cache flushing in dma_map_sg() when merging the 32 and 64-bit DMA code.

---

Oops .. nobody spotted that when Becky patches went in !

Paul: This is a 2.6.28 regression and should be merged asap

 arch/powerpc/kernel/dma.c |    1 +
 1 file changed, 1 insertion(+)
arch/powerpc/kernel/dma.c +1 -0
@@ -75,6 +75,7 @@ static int dma_direct_map_sg(struct devi
 	for_each_sg(sgl, sg, nents, i) {
 		sg->dma_address = sg_phys(sg) + get_dma_direct_offset(dev);
 		sg->dma_length = sg->length;
+		__dma_sync_page(sg_page(sg), sg->offset, sg->length, direction);
 	}
 
 	return nents;
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Benjamin Herrenschmidt

On PowerPC 4xx or other non cache coherent platforms, we lost the appropriate cache flushing in dma_map_sg() when merging the 32 and 64-bit DMA code.

Sins of omission are always the hardest to catch..... My apologies, and thanks!

-B

Quoted 26 lines

---

Oops .. nobody spotted that when Becky patches went in !

Paul: This is a 2.6.28 regression and should be merged asap

arch/powerpc/kernel/dma.c | 1 +

1 file changed, 1 insertion(+)

--- linux-work.orig/arch/powerpc/kernel/dma.c 2008-12-01
15:44:55.000000000 +1100
+++ linux-work/arch/powerpc/kernel/dma.c 2008-12-01
15:45:13.000000000 +1100

arch/powerpc/kernel/dma.c +1 -0
@@ -75,6 +75,7 @@ static int dma_direct_map_sg(struct devi
 	for_each_sg(sgl, sg, nents, i) {
 		sg->dma_address = sg_phys(sg) + get_dma_direct_offset(dev);
 		sg->dma_length = sg->length;
+		__dma_sync_page(sg_page(sg), sg->offset, sg->length, direction);
 	}
 
 	return nents;

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev