public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][2.6] PCI Scan all functions
@ 2004-01-27 16:55 Jake Moilanen
  2004-01-27 21:12 ` Greg KH
  2004-01-28 15:41 ` Martin Mares
  0 siblings, 2 replies; 8+ messages in thread
From: Jake Moilanen @ 2004-01-27 16:55 UTC (permalink / raw)
  To: Andrew Morton; +Cc: lkml

[-- Attachment #1: Type: text/plain, Size: 459 bytes --]

There are some arch, like PPC64, that need to be able to scan all the
PCI functions.  The problem comes in on a logically partitioned system
where function 0 on a PCI-PCI bridge is assigned to one partition and
say function 2 is assiged to another partition.  On the second
partition, it would appear that function 0 does not exist, but function
2 does.  If all the functions are not scanned, everything under function
2 would not be detected.

Thanks,
Jake


[-- Attachment #2: linux-2.6.1-pcibios-scan-all-fns-1.patch --]
[-- Type: text/x-patch, Size: 9602 bytes --]

diff -urpN linux-2.6.1/drivers/pci/probe.c linux-2.6.1-pcibios-scan-all-fns/drivers/pci/probe.c
--- linux-2.6.1/drivers/pci/probe.c	Fri Jan  9 00:59:47 2004
+++ linux-2.6.1-pcibios-scan-all-fns/drivers/pci/probe.c	Tue Jan 27 10:36:52 2004
@@ -7,6 +7,8 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 
+#include <asm/pci.h>
+
 #undef DEBUG
 
 #ifdef DEBUG
@@ -553,7 +555,7 @@ int __devinit pci_scan_slot(struct pci_b
 
 		dev = pci_scan_device(bus, devfn);
 		pci_scan_msi_device(dev);
-		if (func == 0) {
+		if (!pcibios_scan_all_fns() && func == 0) {
 			if (!dev)
 				break;
 		} else {
diff -urpN linux-2.6.1/include/asm-alpha/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-alpha/pci.h
--- linux-2.6.1/include/asm-alpha/pci.h	Fri Jan  9 00:59:02 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-alpha/pci.h	Tue Jan 27 10:36:07 2004
@@ -51,6 +51,7 @@ struct pci_controller {
    bus numbers.  */
 
 #define pcibios_assign_all_busses()	1
+#define pcibios_scan_all_fns()		0
 
 #define PCIBIOS_MIN_IO		alpha_mv.min_io_address
 #define PCIBIOS_MIN_MEM		alpha_mv.min_mem_address
diff -urpN linux-2.6.1/include/asm-arm/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-arm/pci.h
--- linux-2.6.1/include/asm-arm/pci.h	Fri Jan  9 00:59:19 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-arm/pci.h	Tue Jan 27 10:36:07 2004
@@ -20,6 +20,8 @@
 #endif
 
 
+#define pcibios_scan_all_fns()		0
+
 static inline void pcibios_set_master(struct pci_dev *dev)
 {
 	/* No special bus mastering setup handling */
diff -urpN linux-2.6.1/include/asm-arm26/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-arm26/pci.h
--- linux-2.6.1/include/asm-arm26/pci.h	Fri Jan  9 00:59:46 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-arm26/pci.h	Tue Jan 27 10:36:07 2004
@@ -1,5 +1,6 @@
 /* Should not be needed. IDE stupidity */
 /* JMA 18.05.03 - is kinda needed, if only to tell it we don't have a PCI bus */
 
-#define PCI_DMA_BUS_IS_PHYS  0
+#define PCI_DMA_BUS_IS_PHYS  		0
+#define pcibios_scan_all_fns()		0
 
diff -urpN linux-2.6.1/include/asm-generic/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-generic/pci.h
--- linux-2.6.1/include/asm-generic/pci.h	Fri Jan  9 00:59:33 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-generic/pci.h	Tue Jan 27 10:36:07 2004
@@ -22,4 +22,6 @@ pcibios_resource_to_bus(struct pci_dev *
 	region->end = res->end;
 }
 
+#define pcibios_scan_all_fns()		0
+
 #endif
diff -urpN linux-2.6.1/include/asm-h8300/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-h8300/pci.h
--- linux-2.6.1/include/asm-h8300/pci.h	Fri Jan  9 00:59:42 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-h8300/pci.h	Tue Jan 27 10:36:07 2004
@@ -8,6 +8,7 @@
  */
 
 #define pcibios_assign_all_busses()	0
+#define pcibios_scan_all_fns()		0
 
 extern inline void pcibios_set_master(struct pci_dev *dev)
 {
diff -urpN linux-2.6.1/include/asm-i386/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-i386/pci.h
--- linux-2.6.1/include/asm-i386/pci.h	Fri Jan  9 00:59:26 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-i386/pci.h	Tue Jan 27 10:36:07 2004
@@ -15,6 +15,7 @@ extern unsigned int pcibios_assign_all_b
 #else
 #define pcibios_assign_all_busses()	0
 #endif
+#define pcibios_scan_all_fns()		0
 
 extern unsigned long pci_mem_start;
 #define PCIBIOS_MIN_IO		0x1000
diff -urpN linux-2.6.1/include/asm-ia64/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-ia64/pci.h
--- linux-2.6.1/include/asm-ia64/pci.h	Fri Jan  9 01:00:02 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-ia64/pci.h	Tue Jan 27 10:36:07 2004
@@ -16,6 +16,7 @@
  * loader.
  */
 #define pcibios_assign_all_busses()     0
+#define pcibios_scan_all_fns()		0
 
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
diff -urpN linux-2.6.1/include/asm-m68k/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-m68k/pci.h
--- linux-2.6.1/include/asm-m68k/pci.h	Fri Jan  9 00:59:33 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-m68k/pci.h	Tue Jan 27 10:36:07 2004
@@ -36,6 +36,7 @@ struct pci_bus_info
 };
 
 #define pcibios_assign_all_busses()	0
+#define pcibios_scan_all_fns()		0
 
 extern inline void pcibios_set_master(struct pci_dev *dev)
 {
diff -urpN linux-2.6.1/include/asm-m68knommu/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-m68knommu/pci.h
--- linux-2.6.1/include/asm-m68knommu/pci.h	Fri Jan  9 00:59:56 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-m68knommu/pci.h	Tue Jan 27 10:36:07 2004
@@ -11,6 +11,8 @@
 #define PCIBIOS_MIN_IO		0x100
 #define PCIBIOS_MIN_MEM		0x00010000
 
+#define pcibios_scan_all_fns()		0
+
 /*
  * Return whether the given PCI device DMA address mask can
  * be supported properly.  For example, if your device can
diff -urpN linux-2.6.1/include/asm-mips/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-mips/pci.h
--- linux-2.6.1/include/asm-mips/pci.h	Fri Jan  9 00:59:46 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-mips/pci.h	Tue Jan 27 10:36:07 2004
@@ -20,6 +20,7 @@ extern unsigned int pcibios_assign_all_b
 #else
 #define pcibios_assign_all_busses()	0
 #endif
+#define pcibios_scan_all_fns()		0
 
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
diff -urpN linux-2.6.1/include/asm-parisc/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-parisc/pci.h
--- linux-2.6.1/include/asm-parisc/pci.h	Fri Jan  9 00:59:48 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-parisc/pci.h	Tue Jan 27 10:36:07 2004
@@ -174,6 +174,7 @@ extern inline void pcibios_register_hba(
 **   to zero for legacy platforms and one for PAT platforms.
 */
 #define pcibios_assign_all_busses()     (pdc_type == PDC_TYPE_PAT)
+#define pcibios_scan_all_fns()		0
 
 #define PCIBIOS_MIN_IO          0x10
 #define PCIBIOS_MIN_MEM         0x1000 /* NBPG - but pci/setup-res.c dies */
diff -urpN linux-2.6.1/include/asm-ppc/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-ppc/pci.h
--- linux-2.6.1/include/asm-ppc/pci.h	Fri Jan  9 00:59:48 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-ppc/pci.h	Tue Jan 27 10:36:07 2004
@@ -26,6 +26,7 @@ struct pci_dev;
 extern int pci_assign_all_busses;
 
 #define pcibios_assign_all_busses()	(pci_assign_all_busses)
+#define pcibios_scan_all_fns()		0
 
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
diff -urpN linux-2.6.1/include/asm-ppc64/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-ppc64/pci.h
--- linux-2.6.1/include/asm-ppc64/pci.h	Fri Jan  9 00:59:26 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-ppc64/pci.h	Tue Jan 27 10:36:07 2004
@@ -19,6 +19,12 @@
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
 
+/*
+ * ppc64 can have multifunction devices that do not respond to function 0. 
+ * In this case we must scan all functions.
+ */
+#define pcibios_scan_all_fns()     1
+
 static inline void pcibios_set_master(struct pci_dev *dev)
 {
 	/* No special bus mastering setup handling */
diff -urpN linux-2.6.1/include/asm-sh/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-sh/pci.h
--- linux-2.6.1/include/asm-sh/pci.h	Fri Jan  9 00:59:45 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-sh/pci.h	Tue Jan 27 10:36:07 2004
@@ -12,6 +12,7 @@
    or architectures with incomplete PCI setup by the loader */
 
 #define pcibios_assign_all_busses()	1
+#define pcibios_scan_all_fns()		0
 
 #if defined(CONFIG_CPU_SUBTYPE_ST40STB1)
 /* These are currently the correct values for the STM overdrive board. 
diff -urpN linux-2.6.1/include/asm-sparc/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-sparc/pci.h
--- linux-2.6.1/include/asm-sparc/pci.h	Fri Jan  9 00:59:48 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-sparc/pci.h	Tue Jan 27 10:36:07 2004
@@ -8,6 +8,7 @@
  * or architectures with incomplete PCI setup by the loader.
  */
 #define pcibios_assign_all_busses()	0
+#define pcibios_scan_all_fns()		0
 
 #define PCIBIOS_MIN_IO		0UL
 #define PCIBIOS_MIN_MEM		0UL
diff -urpN linux-2.6.1/include/asm-sparc64/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-sparc64/pci.h
--- linux-2.6.1/include/asm-sparc64/pci.h	Fri Jan  9 00:59:10 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-sparc64/pci.h	Tue Jan 27 10:36:07 2004
@@ -11,6 +11,7 @@
  * or architectures with incomplete PCI setup by the loader.
  */
 #define pcibios_assign_all_busses()	0
+#define pcibios_scan_all_fns()		0
 
 #define PCIBIOS_MIN_IO		0UL
 #define PCIBIOS_MIN_MEM		0UL
diff -urpN linux-2.6.1/include/asm-um/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-um/pci.h
--- linux-2.6.1/include/asm-um/pci.h	Fri Jan  9 00:59:27 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-um/pci.h	Tue Jan 27 10:36:07 2004
@@ -2,5 +2,6 @@
 #define __UM_PCI_H
 
 #define PCI_DMA_BUS_IS_PHYS     (1)
+#define pcibios_scan_all_fns()		0
 
 #endif
diff -urpN linux-2.6.1/include/asm-v850/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-v850/pci.h
--- linux-2.6.1/include/asm-v850/pci.h	Fri Jan  9 00:59:19 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-v850/pci.h	Tue Jan 27 10:36:07 2004
@@ -17,6 +17,8 @@
 /* Get any platform-dependent definitions.  */
 #include <asm/machdep.h>
 
+#define pcibios_scan_all_fns()		0
+
 /* Generic declarations.  */
 
 struct scatterlist;
diff -urpN linux-2.6.1/include/asm-x86_64/pci.h linux-2.6.1-pcibios-scan-all-fns/include/asm-x86_64/pci.h
--- linux-2.6.1/include/asm-x86_64/pci.h	Fri Jan  9 00:59:26 2004
+++ linux-2.6.1-pcibios-scan-all-fns/include/asm-x86_64/pci.h	Tue Jan 27 10:36:07 2004
@@ -17,6 +17,7 @@ extern unsigned int pcibios_assign_all_b
 #else
 #define pcibios_assign_all_busses()	0
 #endif
+#define pcibios_scan_all_fns()		0
 
 extern int no_iommu, force_iommu;
 

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

* Re: [PATCH][2.6] PCI Scan all functions
  2004-01-27 16:55 [PATCH][2.6] PCI Scan all functions Jake Moilanen
@ 2004-01-27 21:12 ` Greg KH
  2004-01-27 21:33   ` Andrew Morton
  2004-01-27 21:57   ` John Rose
  2004-01-28 15:41 ` Martin Mares
  1 sibling, 2 replies; 8+ messages in thread
From: Greg KH @ 2004-01-27 21:12 UTC (permalink / raw)
  To: Jake Moilanen, johnrose; +Cc: Andrew Morton, lkml, torvalds

On Tue, Jan 27, 2004 at 10:55:01AM -0600, Jake Moilanen wrote:
> There are some arch, like PPC64, that need to be able to scan all the
> PCI functions.  The problem comes in on a logically partitioned system
> where function 0 on a PCI-PCI bridge is assigned to one partition and
> say function 2 is assiged to another partition.  On the second
> partition, it would appear that function 0 does not exist, but function
> 2 does.  If all the functions are not scanned, everything under function
> 2 would not be detected.

Heh, I think the PPC64 people need to get together and all talk about
this, as I just got a different patch, that solves much the same problem
from John Rose (it's on the linuxppc64 mailing list.)

Can you two get together and not patch the same section of code to do
the same thing in different ways?

thanks,

greg k-h

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

* Re: [PATCH][2.6] PCI Scan all functions
  2004-01-27 21:12 ` Greg KH
@ 2004-01-27 21:33   ` Andrew Morton
  2004-01-27 21:44     ` Greg KH
  2004-01-27 21:57     ` Linus Torvalds
  2004-01-27 21:57   ` John Rose
  1 sibling, 2 replies; 8+ messages in thread
From: Andrew Morton @ 2004-01-27 21:33 UTC (permalink / raw)
  To: Greg KH; +Cc: moilanen, johnrose, linux-kernel, torvalds, Anton Blanchard

Greg KH <greg@kroah.com> wrote:
>
> On Tue, Jan 27, 2004 at 10:55:01AM -0600, Jake Moilanen wrote:
> > There are some arch, like PPC64, that need to be able to scan all the
> > PCI functions.  The problem comes in on a logically partitioned system
> > where function 0 on a PCI-PCI bridge is assigned to one partition and
> > say function 2 is assiged to another partition.  On the second
> > partition, it would appear that function 0 does not exist, but function
> > 2 does.  If all the functions are not scanned, everything under function
> > 2 would not be detected.
> 
> Heh, I think the PPC64 people need to get together and all talk about
> this, as I just got a different patch, that solves much the same problem
> from John Rose (it's on the linuxppc64 mailing list.)
> 
> Can you two get together and not patch the same section of code to do
> the same thing in different ways?

While we're on the topic, what's with the below patch?  I've had it in -mm
for ages but apparently there's some disagreement over it.



From: Anton Blanchard <anton@samba.org>

We have IO BARs on ppc64 machines that begin at address 0. The current
pci probe code will ignore anything that starts at 0. Remove these checks.



---

 drivers/pci/probe.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -puN drivers/pci/probe.c~ppc64-bar-0-fix drivers/pci/probe.c
--- 25/drivers/pci/probe.c~ppc64-bar-0-fix	2004-01-13 23:23:18.000000000 -0800
+++ 25-akpm/drivers/pci/probe.c	2004-01-13 23:23:18.000000000 -0800
@@ -176,7 +176,7 @@ void __devinit pci_read_bridge_bases(str
 		limit |= (io_limit_hi << 16);
 	}
 
-	if (base && base <= limit) {
+	if (base <= limit) {
 		res->flags = (io_base_lo & PCI_IO_RANGE_TYPE_MASK) | IORESOURCE_IO;
 		res->start = base;
 		res->end = limit + 0xfff;
@@ -187,7 +187,7 @@ void __devinit pci_read_bridge_bases(str
 	pci_read_config_word(dev, PCI_MEMORY_LIMIT, &mem_limit_lo);
 	base = (mem_base_lo & PCI_MEMORY_RANGE_MASK) << 16;
 	limit = (mem_limit_lo & PCI_MEMORY_RANGE_MASK) << 16;
-	if (base && base <= limit) {
+	if (base <= limit) {
 		res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM;
 		res->start = base;
 		res->end = limit + 0xfffff;
@@ -213,7 +213,7 @@ void __devinit pci_read_bridge_bases(str
 		}
 #endif
 	}
-	if (base && base <= limit) {
+	if (base <= limit) {
 		res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM | IORESOURCE_PREFETCH;
 		res->start = base;
 		res->end = limit + 0xfffff;

_


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

* Re: [PATCH][2.6] PCI Scan all functions
  2004-01-27 21:33   ` Andrew Morton
@ 2004-01-27 21:44     ` Greg KH
  2004-01-28 20:58       ` Ivan Kokshaysky
  2004-01-27 21:57     ` Linus Torvalds
  1 sibling, 1 reply; 8+ messages in thread
From: Greg KH @ 2004-01-27 21:44 UTC (permalink / raw)
  To: Andrew Morton, Ivan Kokshaysky
  Cc: moilanen, johnrose, linux-kernel, torvalds, Anton Blanchard

On Tue, Jan 27, 2004 at 01:33:14PM -0800, Andrew Morton wrote:
> Greg KH <greg@kroah.com> wrote:
> >
> > On Tue, Jan 27, 2004 at 10:55:01AM -0600, Jake Moilanen wrote:
> > > There are some arch, like PPC64, that need to be able to scan all the
> > > PCI functions.  The problem comes in on a logically partitioned system
> > > where function 0 on a PCI-PCI bridge is assigned to one partition and
> > > say function 2 is assiged to another partition.  On the second
> > > partition, it would appear that function 0 does not exist, but function
> > > 2 does.  If all the functions are not scanned, everything under function
> > > 2 would not be detected.
> > 
> > Heh, I think the PPC64 people need to get together and all talk about
> > this, as I just got a different patch, that solves much the same problem
> > from John Rose (it's on the linuxppc64 mailing list.)
> > 
> > Can you two get together and not patch the same section of code to do
> > the same thing in different ways?
> 
> While we're on the topic, what's with the below patch?  I've had it in -mm
> for ages but apparently there's some disagreement over it.

It looks ok to me, but Linus and Ivan were the ones disagreeing over how
to implement this correctly, as they understand the resource management
logic a lot better than I.

They should be the ones to say if this is ok or not.

thanks,

greg k-h

> From: Anton Blanchard <anton@samba.org>
> 
> We have IO BARs on ppc64 machines that begin at address 0. The current
> pci probe code will ignore anything that starts at 0. Remove these checks.
> 
> 
> 
> ---
> 
>  drivers/pci/probe.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff -puN drivers/pci/probe.c~ppc64-bar-0-fix drivers/pci/probe.c
> --- 25/drivers/pci/probe.c~ppc64-bar-0-fix	2004-01-13 23:23:18.000000000 -0800
> +++ 25-akpm/drivers/pci/probe.c	2004-01-13 23:23:18.000000000 -0800
> @@ -176,7 +176,7 @@ void __devinit pci_read_bridge_bases(str
>  		limit |= (io_limit_hi << 16);
>  	}
>  
> -	if (base && base <= limit) {
> +	if (base <= limit) {
>  		res->flags = (io_base_lo & PCI_IO_RANGE_TYPE_MASK) | IORESOURCE_IO;
>  		res->start = base;
>  		res->end = limit + 0xfff;
> @@ -187,7 +187,7 @@ void __devinit pci_read_bridge_bases(str
>  	pci_read_config_word(dev, PCI_MEMORY_LIMIT, &mem_limit_lo);
>  	base = (mem_base_lo & PCI_MEMORY_RANGE_MASK) << 16;
>  	limit = (mem_limit_lo & PCI_MEMORY_RANGE_MASK) << 16;
> -	if (base && base <= limit) {
> +	if (base <= limit) {
>  		res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM;
>  		res->start = base;
>  		res->end = limit + 0xfffff;
> @@ -213,7 +213,7 @@ void __devinit pci_read_bridge_bases(str
>  		}
>  #endif
>  	}
> -	if (base && base <= limit) {
> +	if (base <= limit) {
>  		res->flags = (mem_base_lo & PCI_MEMORY_RANGE_TYPE_MASK) | IORESOURCE_MEM | IORESOURCE_PREFETCH;
>  		res->start = base;
>  		res->end = limit + 0xfffff;
> 
> _

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

* Re: [PATCH][2.6] PCI Scan all functions
  2004-01-27 21:33   ` Andrew Morton
  2004-01-27 21:44     ` Greg KH
@ 2004-01-27 21:57     ` Linus Torvalds
  1 sibling, 0 replies; 8+ messages in thread
From: Linus Torvalds @ 2004-01-27 21:57 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Greg KH, moilanen, johnrose, linux-kernel, Anton Blanchard



On Tue, 27 Jan 2004, Andrew Morton wrote:
> 
> While we're on the topic, what's with the below patch?  I've had it in -mm
> for ages but apparently there's some disagreement over it.

I'd be very worried, since I'm pretty sure that there _are_ devices where
"zero means disabled".

On the other hand, the resource management should do the right thing 
anyway, so I guess it should be safe. Especially if it's been in -mm for a 
long time..

		Linus

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

* Re: [PATCH][2.6] PCI Scan all functions
  2004-01-27 21:12 ` Greg KH
  2004-01-27 21:33   ` Andrew Morton
@ 2004-01-27 21:57   ` John Rose
  1 sibling, 0 replies; 8+ messages in thread
From: John Rose @ 2004-01-27 21:57 UTC (permalink / raw)
  To: Greg KH; +Cc: Jake Moilanen, Andrew Morton, lkml, torvalds

Hi-

> Heh, I think the PPC64 people need to get together and all talk about
> this, as I just got a different patch, that solves much the same problem
> from John Rose (it's on the linuxppc64 mailing list.)
> 
> Can you two get together and not patch the same section of code to do
> the same thing in different ways?

These patches don't address the same problem.  Jake's problem has to do
with pci_scan_slot() ending too soon when going from function 0->7 at
boot time.  My problem has to do with pci_scan_slot() going too far from
function 0->7 at dlpar add time.  Greg, will follow up with you outside
of this thread.

Thanks-
John
-- 
John Rose <johnrose@austin.ibm.com>


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

* Re: [PATCH][2.6] PCI Scan all functions
  2004-01-27 16:55 [PATCH][2.6] PCI Scan all functions Jake Moilanen
  2004-01-27 21:12 ` Greg KH
@ 2004-01-28 15:41 ` Martin Mares
  1 sibling, 0 replies; 8+ messages in thread
From: Martin Mares @ 2004-01-28 15:41 UTC (permalink / raw)
  To: Jake Moilanen; +Cc: Andrew Morton, lkml

Hello!

> There are some arch, like PPC64, that need to be able to scan all the
> PCI functions.  The problem comes in on a logically partitioned system
> where function 0 on a PCI-PCI bridge is assigned to one partition and
> say function 2 is assiged to another partition.  On the second
> partition, it would appear that function 0 does not exist, but function
> 2 does.  If all the functions are not scanned, everything under function
> 2 would not be detected.

Enabling scan of all functions globally is probably going to cause troubles,
because there are single-function devices which respond to all function
numbers. You need to enable this quirk selectively.

				Have a nice fortnight
-- 
Martin `MJ' Mares   <mj@ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"God doesn't play dice."    -- Albert Einstein

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

* Re: [PATCH][2.6] PCI Scan all functions
  2004-01-27 21:44     ` Greg KH
@ 2004-01-28 20:58       ` Ivan Kokshaysky
  0 siblings, 0 replies; 8+ messages in thread
From: Ivan Kokshaysky @ 2004-01-28 20:58 UTC (permalink / raw)
  To: Greg KH
  Cc: Andrew Morton, moilanen, johnrose, linux-kernel, torvalds,
	Anton Blanchard

On Tue, Jan 27, 2004 at 01:44:44PM -0800, Greg KH wrote:
> > -	if (base && base <= limit) {
> > +	if (base <= limit) {

I think the patch is safe. Architectures that don't accept
bridge windows (and regular BARs) at bus address 0 already have
that check elsewhere.
For example, in arch/i386/pci/i386.c:pcibios_allocate_bus_resources():
...
			for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) {
				r = &dev->resource[idx];
				if (!r->start)
				    ^^^^^^^^^
					continue;
...

Ivan.

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

end of thread, other threads:[~2004-01-28 20:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-27 16:55 [PATCH][2.6] PCI Scan all functions Jake Moilanen
2004-01-27 21:12 ` Greg KH
2004-01-27 21:33   ` Andrew Morton
2004-01-27 21:44     ` Greg KH
2004-01-28 20:58       ` Ivan Kokshaysky
2004-01-27 21:57     ` Linus Torvalds
2004-01-27 21:57   ` John Rose
2004-01-28 15:41 ` Martin Mares

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