[Skiboot] [RFC PATCH 2/5] pci: Don't create -T location codes on non-FSP machines

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Aug 20 11:29:27 AEST 2015


This is a temporary workaround. We disable the code that adds the
"-T" portion of the location code to network devices on non-FSP machines.

This code is a bit fragile, and it does incorrect things on dual-slot
mezzanines such as the one in Habanero. If we need to support this
on OpenPower, we will need to add a concept of sibling slots to the
infrastructure to properly handle the numbering.

Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 core/pci.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/core/pci.c b/core/pci.c
index 479c435..1c2247e 100644
--- a/core/pci.c
+++ b/core/pci.c
@@ -1180,7 +1180,11 @@ static void pci_add_loc_code(struct dt_node *np, struct pci_device *pd)
 	class_code = dt_prop_get_u32(np, "class-code");
 	class = class_code >> 16;
 	sub = (class_code >> 8) & 0xff;
-	if (class == 0x02 && sub == 0x00) {
+
+	/* XXX Don't do that on openpower for now, we will need to sort things
+	 * out later, otherwise the mezzanine slot on Habanero gets weird results
+	 */
+	if (class == 0x02 && sub == 0x00 && fsp_present()) {
 		/* There's usually several spaces at the end of the property.
 		   Test for, but don't rely on, that being the case */
 		len = strlen(blcode);
-- 
2.4.3



More information about the Skiboot mailing list