Skip to contentSkip to conversation

PPC64 2.6 remove deprecated firmware API

PATCH In review [email protected] 2 participants 3 messages Jul 1, 2004 – Jul 2, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PPC64 2.6 remove deprecated firmware API

Paul,

Please review the following patch, and if acceptable, forward to akpm for inclusion in the bkits kernel tree.

This patch eliminates the usage of the deprecated ibm,fw-phb-id token for idnetifying PCI bus heads in favor of the documented, offically supported mechanism for obtaining this info. Please note that some versions of firmware may return incorrect values for the ibm,fw-phb-id token.

--linas

===== arch/ppc64/kernel/eeh.c 1.19 vs edited =====

arch/ppc64/kernel/eeh.c +8 -15
@@ -542,7 +542,7 @@
 			       dn->full_name);
 #endif
 		} else {
-			printk(KERN_WARNING "EEH: %s: rtas_call failed.\n",
+			printk(KERN_WARNING "EEH: %s: could not enable EEH, rtas_call failed.\n",
 			       dn->full_name);
 		}
 	} else {
@@ -587,24 +587,17 @@
 	}
 
 	/* Enable EEH for all adapters.  Note that eeh requires buid's */
+	init_pci_config_tokens();
 	for (phb = of_find_node_by_name(NULL, "pci"); phb;
 	     phb = of_find_node_by_name(phb, "pci")) {
-		int len;
-		int *buid_vals;
+		unsigned long buid;
 
-		buid_vals = (int *)get_property(phb, "ibm,fw-phb-id", &len);
-		if (!buid_vals)
+		buid = get_phb_buid(phb);
+		if (buid == 0) 
 			continue;
-		if (len == sizeof(int)) {
-			info.buid_lo = buid_vals[0];
-			info.buid_hi = 0;
-		} else if (len == sizeof(int)*2) {
-			info.buid_hi = buid_vals[0];
-			info.buid_lo = buid_vals[1];
-		} else {
-			printk(KERN_INFO "EEH: odd ibm,fw-phb-id len returned: %d\n", len);
-			continue;
-		}
+		
+		info.buid_lo = BUID_LO(buid);
+		info.buid_hi = BUID_HI(buid);
 		traverse_pci_devices(phb, early_enable_eeh, NULL, &info);
 	}
 

===== arch/ppc64/kernel/pSeries_pci.c 1.36 vs edited =====

arch/ppc64/kernel/pSeries_pci.c +40 -19

83 lines not on this page · raw message

===== arch/ppc64/kernel/pci.h 1.10 vs edited =====

arch/ppc64/kernel/pci.h +5 -0
@@ -47,4 +47,9 @@
 void pci_addr_cache_insert_device(struct pci_dev *dev);
 void pci_addr_cache_remove_device(struct pci_dev *dev);
 
+/* From pSeries_pci.h */
+void init_pci_config_tokens (void);
+unsigned long get_phb_buid (struct device_node *);
+
+
 #endif /* __PPC_KERNEL_PCI_H__ */
#1 lore raw
Quoted 5 lines · [email protected] writes:

This patch eliminates the usage of the deprecated ibm,fw-phb-id token for idnetifying PCI bus heads in favor of the documented, offically supported mechanism for obtaining this info. Please note that some versions of firmware may return incorrect values for the ibm,fw-phb-id token.

Looks good, could I have a Signed-off-by line for it please?

Thanks,
Paul.

#2 lore raw
Quoted 9 lines · Paul Mackerras
Quoted 5 lines · [email protected] writes:

This patch eliminates the usage of the deprecated ibm,fw-phb-id token for idnetifying PCI bus heads in favor of the documented, offically supported mechanism for obtaining this info. Please note that some versions of firmware may return incorrect values for the ibm,fw-phb-id token.

Looks good, could I have a Signed-off-by line for it please?

Oops sorry,
Iwrote the entire patch ...