From patchwork Thu Sep 27 04:48:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 975531 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 ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42LMm22VLnz9s3Z for ; Thu, 27 Sep 2018 14:49:22 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42LMm218c1zF32n for ; Thu, 27 Sep 2018 14:49:22 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=permerror (mailfrom) smtp.mailfrom=kernel.crashing.org (client-ip=63.228.1.57; helo=gate.crashing.org; envelope-from=benh@kernel.crashing.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.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 42LMlv4lfdzF321 for ; Thu, 27 Sep 2018 14:49:15 +1000 (AEST) Received: from pasglop.ozlabs.ibm.com (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w8R4moRM028785; Wed, 26 Sep 2018 23:48:56 -0500 From: Benjamin Herrenschmidt To: skiboot@lists.ozlabs.org Date: Thu, 27 Sep 2018 14:48:42 +1000 Message-Id: <20180927044849.28322-3-benh@kernel.crashing.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180927044849.28322-1-benh@kernel.crashing.org> References: <20180927044849.28322-1-benh@kernel.crashing.org> Subject: [Skiboot] [PATCH 2/9] hdat: Workaround HostBoot bug with fused core X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 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" The TADA array is missing half of the secondary threads Signed-off-by: Benjamin Herrenschmidt --- hdata/pcia.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/hdata/pcia.c b/hdata/pcia.c index 9b210e4d..954c0491 100644 --- a/hdata/pcia.c +++ b/hdata/pcia.c @@ -103,7 +103,7 @@ static struct dt_node *add_core_node(struct dt_node *cpus, const struct sppcia_core_unique *id, bool okay) { - const struct sppcia_cpu_thread *t; + const struct sppcia_cpu_thread *t, *t0; const struct sppcia_cpu_timebase *timebase; const struct sppcia_cpu_cache *cache; const struct sppcia_cpu_attr *attr; @@ -172,12 +172,27 @@ static struct dt_node *add_core_node(struct dt_node *cpus, /* Build ibm,ppc-interrupt-server#s with all threads */ for (i = 0; i < threads; i++) { t = find_tada(pcia, i); - if (!t) { - threads = i; - break; + if (i == 0) + t0 = t; + if (t) { + iserv[i] = t->pir; + } else { + if (i > 0 && i < cpu_thread_count) { + prerror("CORE[%i]: HDAT TADA bug for" + " thread %d, working around" + " using 0x%04x...\n", + pcia_index(pcia), i, t0->pir + i); + iserv[i] = t0->pir + i; + } else { + prerror("CORE[%i]: Failed to find TADA for" + " thread %d\n", + pcia_index(pcia), i); + threads = i; + break; + } } - - iserv[i] = t->pir; + printf("CORE[%i]: Thread %d PIR 0x%04x\n", + pcia_index(pcia), i, iserv[i]); } dt_add_property(cpu, "ibm,ppc-interrupt-server#s", iserv, 4 * threads);