Skip to contentSkip to conversation

Allow arch-specific pci_dma_set_mask

PATCH In review Deepak Saxena 2 participants 2 messages Mar 27, 2004 – Mar 28, 2004 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow arch-specific pci_dma_set_mask

Jeff,

Following is a patch that allows for architectures to override pci_set_dma_mask and friends for systems that need to do so such as the ARM IXP425. Instead of having invidual HAVE_ARCH_FOO for each of the three mask functions, I think it just makes more sense to have one for overrdding all three since chances are if you need to override one, you need to do so for all of them.

Tnx,
~Deepak

===== drivers/pci/pci.c 1.63 vs edited =====

drivers/pci/pci.c +5 -0
@@ -658,6 +658,10 @@
 	}
 }
 
+#ifndef HAVE_ARCH_PCI_SET_DMA_MASK
+/*
+ * These can be overridden by arch-specific implementations
+ */
 int
 pci_set_dma_mask(struct pci_dev *dev, u64 mask)
 {
@@ -690,6 +694,7 @@
 
 	return 0;
 }
+#endif
      
 static int __devinit pci_init(void)
 {
Signature · 4 lines
Deepak Saxena - dsaxena at plexity dot net - http://www.plexity.net/

"Unlike me, many of you have accepted the situation of your imprisonment and   
 will die here like rotten cabbages." - Number 6
#1 lore raw
Quoted 15 lines · Deepak Saxena

Jeff,

Following is a patch that allows for architectures to override pci_set_dma_mask and friends for systems that need to do so such as the ARM IXP425. Instead of having invidual HAVE_ARCH_FOO
for each of the three mask functions, I think it just makes more
sense to have one for overrdding all three since chances are
if you need to override one, you need to do so for all of them.

Tnx,
~Deepak

===== drivers/pci/pci.c 1.63 vs edited =====

drivers/pci/pci.c line 666

Quoted 9 lines
drivers/pci/pci.c +4 -0
@@ -658,6 +658,10 @@
 	}
 }
 
+#ifndef HAVE_ARCH_PCI_SET_DMA_MASK
+/*
+ * These can be overridden by arch-specific implementations
+ */
 int
 pci_set_dma_mask(struct pci_dev *dev, u64 mask)

Looks OK to me, but it's really up to arch people. I just follow the API I'm given. :)

Jeff