linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: dynamic probe - use ppc_md.pci_probe_mode()
@ 2006-03-24 17:19 John Rose
  2006-03-24 17:25 ` John Rose
  2006-03-24 22:48 ` Linas Vepstas
  0 siblings, 2 replies; 4+ messages in thread
From: John Rose @ 2006-03-24 17:19 UTC (permalink / raw)
  To: benh; +Cc: External List, Paul Mackerras

Change the dynamic PCI probe function for pSeries to use
ppc_md.pci_probe_mode() when appropriate.

Signed-off-by: John Rose <johnrose@austin.ibm.com>

---

As suggested by BenH.  Tested on POWER5.

Thanks-
John

diff -puN arch/powerpc/platforms/pseries/pci_dlpar.c~use_probe_mode arch/powerpc/platforms/pseries/pci_dlpar.c
--- 2_6_cleanups/arch/powerpc/platforms/pseries/pci_dlpar.c~use_probe_mode	2006-03-24 09:57:08.000000000 -0600
+++ 2_6_cleanups-johnrose/arch/powerpc/platforms/pseries/pci_dlpar.c	2006-03-24 10:12:49.000000000 -0600
@@ -152,20 +152,26 @@ pcibios_pci_config_bridge(struct pci_dev
 void
 pcibios_add_pci_devices(struct pci_bus * bus)
 {
-	int slotno, num;
+	int slotno, num, mode;
 	struct pci_dev *dev;
 	struct device_node *dn = pci_bus_to_OF_node(bus);
 
 	eeh_add_device_tree_early(dn);
 
-	if (_machine == PLATFORM_PSERIES_LPAR) {
+	mode = PCI_PROBE_NORMAL;
+	if (ppc_md.pci_probe_mode)
+		mode = ppc_md.pci_probe_mode(bus);
+
+	if (mode == PCI_PROBE_DEVTREE) {
+		printk("%s: jhr: new probe\n", __FUNCTION__);
 		/* use ofdt-based probe */
 		of_scan_bus(dn, bus);
 		if (!list_empty(&bus->devices)) {
 			pcibios_fixup_new_pci_devices(bus, 0);
 			pci_bus_add_devices(bus);
 		}
-	} else {
+	} else if (mode == PCI_PROBE_NORMAL) {
+		printk("%s: jhr: old probe\n", __FUNCTION__);
 		/* use legacy probe */
 		slotno = PCI_SLOT(PCI_DN(dn->child)->devfn);
 		num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0));

_

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

* [PATCH] powerpc: dynamic probe - use ppc_md.pci_probe_mode()
  2006-03-24 17:19 [PATCH] powerpc: dynamic probe - use ppc_md.pci_probe_mode() John Rose
@ 2006-03-24 17:25 ` John Rose
  2006-03-24 22:48 ` Linas Vepstas
  1 sibling, 0 replies; 4+ messages in thread
From: John Rose @ 2006-03-24 17:25 UTC (permalink / raw)
  To: benh; +Cc: External List, Paul Mackerras

Change the dynamic PCI probe function for pSeries to use
ppc_md.pci_probe_mode() when appropriate.

Signed-off-by: John Rose <johnrose@austin.ibm.com>

---

Actually - how about a version without debug prints!?  Original change
suggested by BenH.  Tested on POWER5.

Thanks-
John

diff -puN arch/powerpc/platforms/pseries/pci_dlpar.c~use_probe_mode arch/powerpc/platforms/pseries/pci_dlpar.c
--- 2_6_linus/arch/powerpc/platforms/pseries/pci_dlpar.c~use_probe_mode	2006-03-24 09:57:08.000000000 -0600
+++ 2_6_linus-johnrose/arch/powerpc/platforms/pseries/pci_dlpar.c	2006-03-24 11:26:23.000000000 -0600
@@ -152,20 +152,24 @@ pcibios_pci_config_bridge(struct pci_dev
 void
 pcibios_add_pci_devices(struct pci_bus * bus)
 {
-	int slotno, num;
+	int slotno, num, mode;
 	struct pci_dev *dev;
 	struct device_node *dn = pci_bus_to_OF_node(bus);
 
 	eeh_add_device_tree_early(dn);
 
-	if (_machine == PLATFORM_PSERIES_LPAR) {
+	mode = PCI_PROBE_NORMAL;
+	if (ppc_md.pci_probe_mode)
+		mode = ppc_md.pci_probe_mode(bus);
+
+	if (mode == PCI_PROBE_DEVTREE) {
 		/* use ofdt-based probe */
 		of_scan_bus(dn, bus);
 		if (!list_empty(&bus->devices)) {
 			pcibios_fixup_new_pci_devices(bus, 0);
 			pci_bus_add_devices(bus);
 		}
-	} else {
+	} else if (mode == PCI_PROBE_NORMAL) {
 		/* use legacy probe */
 		slotno = PCI_SLOT(PCI_DN(dn->child)->devfn);
 		num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0));

_

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

* Re: [PATCH] powerpc: dynamic probe - use ppc_md.pci_probe_mode()
  2006-03-24 17:19 [PATCH] powerpc: dynamic probe - use ppc_md.pci_probe_mode() John Rose
  2006-03-24 17:25 ` John Rose
@ 2006-03-24 22:48 ` Linas Vepstas
  2006-03-24 23:03   ` Linas Vepstas
  1 sibling, 1 reply; 4+ messages in thread
From: Linas Vepstas @ 2006-03-24 22:48 UTC (permalink / raw)
  To: John Rose; +Cc: Paul Mackerras, External List

On Fri, Mar 24, 2006 at 11:19:13AM -0600, John Rose wrote:
> +	if (mode == PCI_PROBE_DEVTREE) {
> +		printk("%s: jhr: new probe\n", __FUNCTION__);

Did you intend to leave in this print statement?  Its looks
suspiciously like a  debug print.

--linas

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

* Re: [PATCH] powerpc: dynamic probe - use ppc_md.pci_probe_mode()
  2006-03-24 22:48 ` Linas Vepstas
@ 2006-03-24 23:03   ` Linas Vepstas
  0 siblings, 0 replies; 4+ messages in thread
From: Linas Vepstas @ 2006-03-24 23:03 UTC (permalink / raw)
  To: John Rose; +Cc: External List, Paul Mackerras

On Fri, Mar 24, 2006 at 04:48:01PM -0600, Linas Vepstas wrote:
> On Fri, Mar 24, 2006 at 11:19:13AM -0600, John Rose wrote:
> > +	if (mode == PCI_PROBE_DEVTREE) {
> > +		printk("%s: jhr: new probe\n", __FUNCTION__);
> 
> Did you intend to leave in this print statement?  Its looks
> suspiciously like a  debug print.

Never mind, I should have looked at the next eamil.

--linas

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

end of thread, other threads:[~2006-03-25  0:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-24 17:19 [PATCH] powerpc: dynamic probe - use ppc_md.pci_probe_mode() John Rose
2006-03-24 17:25 ` John Rose
2006-03-24 22:48 ` Linas Vepstas
2006-03-24 23:03   ` Linas Vepstas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).