From patchwork Thu Aug 20 01:29:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 508888 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1C898140291 for ; Thu, 20 Aug 2015 11:30:03 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 011601A1D6A for ; Thu, 20 Aug 2015 11:30:03 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 8DA891A00FC for ; Thu, 20 Aug 2015 11:29:58 +1000 (AEST) Received: from pasglop.ozlabs.ibm.com (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id t7K1TclW007680; Wed, 19 Aug 2015 20:29:40 -0500 From: Benjamin Herrenschmidt To: skiboot@lists.ozlabs.org Date: Thu, 20 Aug 2015 11:29:27 +1000 Message-Id: <1440034170-20249-2-git-send-email-benh@kernel.crashing.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1440034170-20249-1-git-send-email-benh@kernel.crashing.org> References: <1440034170-20249-1-git-send-email-benh@kernel.crashing.org> Subject: [Skiboot] [RFC PATCH 2/5] pci: Don't create -T location codes on non-FSP machines X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" 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 --- 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);