public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] x86: Fix 64-bit DMA masks on VIA
@ 2008-04-23 18:55 Michael Buesch
  2008-04-24 13:43 ` Andi Kleen
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Buesch @ 2008-04-23 18:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: vojtech, muli, jdmason, tglx, mingo

This untested patch is supposed to fix DMAing on some VIA boards.
Currently the DMA subsystem returns an error, if the driver does
tell that it supports a 64bit DMA mask. So the driver probing
would fail in that case. This happens for some b43 cards with
64bit DMA engines on VIA boards.
Instead of failing the dma_supported() check, simply strip off the
high 32bits.

Signed-off-by: Michael Buesch <mb@bu3sch.de>

---

This is not tested, due to the lack of hardware.


Index: wireless-testing/arch/x86/kernel/pci-dma_64.c
===================================================================
--- wireless-testing.orig/arch/x86/kernel/pci-dma_64.c	2008-04-01 15:53:17.000000000 +0200
+++ wireless-testing/arch/x86/kernel/pci-dma_64.c	2008-04-23 20:49:42.000000000 +0200
@@ -173,11 +173,8 @@ int dma_supported(struct device *dev, u6
 {
 #ifdef CONFIG_PCI
 	if (mask > 0xffffffff && forbid_dac > 0) {
-
-
-
 		printk(KERN_INFO "PCI: Disallowing DAC for device %s\n", dev->bus_id);
-		return 0;
+		/* We strip off the high 32 bits in dma_set_mask() */
 	}
 #endif
 
@@ -215,6 +212,10 @@ int dma_set_mask(struct device *dev, u64
 {
 	if (!dev->dma_mask || !dma_supported(dev, mask))
 		return -EIO;
+
+	if (forbid_dac > 0)
+		mask &= 0xffffffff;
+
 	*dev->dma_mask = mask;
 	return 0;
 }
Index: wireless-testing/include/asm-x86/dma-mapping_32.h
===================================================================
--- wireless-testing.orig/include/asm-x86/dma-mapping_32.h	2008-02-16 19:08:15.000000000 +0100
+++ wireless-testing/include/asm-x86/dma-mapping_32.h	2008-04-23 20:46:12.000000000 +0200
@@ -137,10 +137,6 @@ dma_supported(struct device *dev, u64 ma
         if(mask < 0x00ffffff)
                 return 0;
 
-	/* Work around chipset bugs */
-	if (forbid_dac > 0 && mask > 0xffffffffULL)
-		return 0;
-
 	return 1;
 }
 
@@ -150,6 +146,10 @@ dma_set_mask(struct device *dev, u64 mas
 	if(!dev->dma_mask || !dma_supported(dev, mask))
 		return -EIO;
 
+	/* Work around chipset bugs */
+	if (forbid_dac > 0)
+		mask &= 0xffffffffULL;
+
 	*dev->dma_mask = mask;
 
 	return 0;

-- 
Greetings Michael.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-04-28 21:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-23 18:55 [PATCH RFC] x86: Fix 64-bit DMA masks on VIA Michael Buesch
2008-04-24 13:43 ` Andi Kleen
2008-04-24 14:06   ` Michael Buesch
2008-04-24 14:12     ` Andi Kleen
2008-04-24 14:18     ` David Miller
2008-04-24 14:32     ` Alan Cox
2008-04-24 15:19       ` Michael Buesch
2008-04-28 16:53       ` Ingo Molnar
2008-04-28 17:04         ` Jesse Barnes
2008-04-28 21:48           ` Michael Buesch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox