From patchwork Tue May 15 06:25:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balbir Singh X-Patchwork-Id: 913447 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40lSQ120LQz9s1B for ; Tue, 15 May 2018 16:31:21 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="V2vXO5yV"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40lSQ10GFnzF2km for ; Tue, 15 May 2018 16:31:21 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="V2vXO5yV"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::243; helo=mail-pl0-x243.google.com; envelope-from=bsingharora@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="V2vXO5yV"; dkim-atps=neutral Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40lSHh6PJjzF2hD for ; Tue, 15 May 2018 16:25:52 +1000 (AEST) Received: by mail-pl0-x243.google.com with SMTP id c19-v6so8794679pls.6 for ; Mon, 14 May 2018 23:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=JgJcfNNPQlHjN7dL6F7udnu3GQzeW2z0e6fyDxTasos=; b=V2vXO5yV3awtQCIUoOME5pqnsWtz6EsfQ0m9rpCDtgdmU8GOHzxZjyuioHeiXL1q+v 0RH5dOD/7HNghft4Z3QteCYeJGwlxGBvwst5paKnu2gv4/Tb2/ggb2VrWqnzBYQ7P9oh uuMrAPz2V3GhzbYiLLERZyJ7+hQ8+OveWBajCstvS3ub0ym/wfJbtuaY7QWywldEm/Em MPCQYVFpRNFKV+snlpIF92VdBUKhIfHPnvHe35kNJBnlwaX9i4KzvqIp63qHtAvXs70n oMy0xSPRd7KyjmvBy7CdZHRwvRpgSaMgmlRH6YbBH/IxSlo5ELJkNwlR6b6KZ98JpJDn cULw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JgJcfNNPQlHjN7dL6F7udnu3GQzeW2z0e6fyDxTasos=; b=dUoVQEusj1kbd+sw1aaIDWzSlyczWUTvNSkmKslcxD7i71xEqK+EijwuwPNHsAUHPZ WfmUulC+w8CaE4ZS+gsubiDlph7fl5woddg16n0kt54Yy70Yea/KcMApkyj79fE0UyCo JugxpXhEzkgX5AIG4KUrxz9SYPWM+D4HeXstZOekWwsCHrHEQ5xkyygLjszDgH/ZvB1o /gSLlkOamaSriO8zzzRKd/6Q/DRjI+njK52ajE4JhwMJTclLknXy8t1BNZwfgh8oTs96 b6KWpsjuvf9hdWeChV5MCQFshu5QSY34Erc68VPBxq+xIHKLLS1JE93NnDIpYl/4BajW KqYA== X-Gm-Message-State: ALKqPwftURPUeYO4xNY7cyWctghH9PC+K1TkUj9l3YF7mDzXdYWUCGNE 57524hOPFgM6aQGC7+fJxfsBCSHt X-Google-Smtp-Source: AB8JxZqZDBODfY3w5PJetkjwbuT3eG/j5cQVZdisvjIt+ys/XtOgLfPvTByQmVZUSdDoGIHCscTrXg== X-Received: by 2002:a17:902:b681:: with SMTP id c1-v6mr12985572pls.286.1526365549835; Mon, 14 May 2018 23:25:49 -0700 (PDT) Received: from balbir.ozlabs.ibm.com ([122.99.82.10]) by smtp.googlemail.com with ESMTPSA id m72-v6sm24961194pfk.110.2018.05.14.23.25.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 May 2018 23:25:49 -0700 (PDT) From: Balbir Singh To: skiboot@lists.ozlabs.org Date: Tue, 15 May 2018 16:25:41 +1000 Message-Id: <20180515062541.3731-1-bsingharora@gmail.com> X-Mailer: git-send-email 2.13.6 Subject: [Skiboot] [PATCH] Add location code to NPU2 HMI logging X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stewart@linux.vnet.ibm.com MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The current HMI error message does not specifiy where the HMI error occured. The original error message was NPU: FIR#0 FIR 0x0080100000000000 mask 0x009a48180f01ffff The enhanced error message is NPU2: [Loc: UOPWR.0000000-Node0-Proc0] P:0 FIR#0 FIR 0x0000100000000000 mask 0x009a48180f03ffff Signed-off-by: Balbir Singh --- core/hmi.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/core/hmi.c b/core/hmi.c index 3bf20c0a..c0e2354a 100644 --- a/core/hmi.c +++ b/core/hmi.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -621,7 +622,8 @@ static uint32_t npu2_scom_dump[] = { 0x00 }; -static void dump_scoms(int flat_chip_id, const char *unit, uint32_t *scoms) +static void dump_scoms(int flat_chip_id, const char *unit, uint32_t *scoms, + const char *loc) { uint64_t value; int r; @@ -631,8 +633,8 @@ static void dump_scoms(int flat_chip_id, const char *unit, uint32_t *scoms) r = _xscom_read(flat_chip_id, *scoms, &value, false); if (r != OPAL_SUCCESS) continue; - prlog(PR_ERR, "%s: 0x%08x=0x%016llx\n", - unit, *scoms, value); + prlog(PR_ERR, "%s: [Loc: %s] P:%d 0x%08x=0x%016llx\n", + unit, loc, this_cpu()->chip_id, *scoms, value); scoms++; } } @@ -655,6 +657,7 @@ static void find_npu2_checkstop_reason(int flat_chip_id, uint64_t npu2_fir_action1_addr; uint64_t fatal_errors; int total_errors = 0; + const char *loc; /* Find the NPU on the chip associated with the HMI. */ for_each_phb(phb) { @@ -688,10 +691,13 @@ static void find_npu2_checkstop_reason(int flat_chip_id, fatal_errors = npu2_fir & ~npu2_fir_mask & npu2_fir_action0 & npu2_fir_action1; if (fatal_errors) { - prlog(PR_ERR, "NPU: FIR#%d FIR 0x%016llx mask 0x%016llx\n", - i, npu2_fir, npu2_fir_mask); - prlog(PR_ERR, "NPU: ACTION0 0x%016llx, ACTION1 0x%016llx\n", - npu2_fir_action0, npu2_fir_action1); + loc = chip_loc_code(this_cpu()->chip_id); + if (!loc) + loc = "Not Available"; + prlog(PR_ERR, "NPU2: [Loc: %s] P:%d FIR#%d FIR 0x%016llx mask 0x%016llx\n", + loc, this_cpu()->chip_id, i, npu2_fir, npu2_fir_mask); + prlog(PR_ERR, "NPU2: [Loc: %s] P:%d ACTION0 0x%016llx, ACTION1 0x%016llx\n", + loc, this_cpu()->chip_id, npu2_fir_action0, npu2_fir_action1); total_errors++; } @@ -712,7 +718,7 @@ static void find_npu2_checkstop_reason(int flat_chip_id, if (npu2_hmi_verbose) { _xscom_lock(); - dump_scoms(flat_chip_id, "NPU2", npu2_scom_dump); + dump_scoms(flat_chip_id, "NPU2", npu2_scom_dump, loc); _xscom_unlock(); prlog(PR_ERR, " _________________________ \n"); prlog(PR_ERR, "< It's Driver Debug time! >\n");