From patchwork Tue Jul 31 08:48:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 951478 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 ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41fqqb3kTCz9rxx for ; Tue, 31 Jul 2018 18:49:15 +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="eragQghl"; 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 41fqqb1x9tzF153 for ; Tue, 31 Jul 2018 18:49:15 +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="eragQghl"; 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:4864:20::544; helo=mail-pg1-x544.google.com; envelope-from=oohall@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="eragQghl"; dkim-atps=neutral Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) (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 41fqqV0jd0zF14l for ; Tue, 31 Jul 2018 18:49:08 +1000 (AEST) Received: by mail-pg1-x544.google.com with SMTP id y4-v6so8729058pgp.9 for ; Tue, 31 Jul 2018 01:49:08 -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=3/ZMta8WHxcBJVN4BO9lT/Hj3xqPey973L7Lw9NKYYE=; b=eragQghlUE4JQ1NgC0TfrekIUr6ZRmSixzkMq3actWIkUGntdJY8AUHd2bjBm3Ma59 8dux8QGldZtllQhu1IsjR21Mfeaa4WwOwgYJVBG5SsUELC7inNe+SWyf5/JwqHZf4bTe AcxIbencsaBVtPjReOVJPcnLuz90DgkTpYXdJhuTGGcAdW3Mgb4PGb6bp8Jij+H5oSn0 DjdMYYml6Fbv326g14VGjMKqQ4sPiz1Qo35yOd/W1avqhD1rZ36SBcw+MW0GN88aFtht WjYFDgsTF0J/mN0K1TxwRr66pfQecWgyR2y8a3S9dMgKnZwbjzJ4wtM9VnlSLiJsoWXi Hvqg== 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=3/ZMta8WHxcBJVN4BO9lT/Hj3xqPey973L7Lw9NKYYE=; b=I2EBSfupsPGqZb2EW4FrFnm7ilz43xjOwfw88GhL3Ox74dtzxKP9xhW2N/JU/T6if9 iAlqYi3A9QRcom1AXaBc1cU5Z7iOBaBbRPqn5Ev4IQpjSw8DCf9cW/QxloODRpjM0QGr Y/5iymqLKTIhF4D8PjxFCQRFnRXcyjbTQ3rdX5VImwZpDbKbSsonmysKNxIqqmET72u/ RQNLme/fjZ06JPi51ER3GBPenYdnImcchYvxPHG395kAIeA6K9bmiQwmU4A1v0wJXwSO 6MWafJFkAtgcU+UrTnJfJIpii5Os4dlQgs7LmwD6Jc1ASNYdF2jVnYIR5rHTzFTwov0/ xqfQ== X-Gm-Message-State: AOUpUlFbx42aX6aLCfPYrnkR3pio+FaLpYe5s2pE7BmB+0dLPA1tFBvZ YSNGesaSxrWSZ34wTzdgAaTAEPW5 X-Google-Smtp-Source: AAOMgpcJQustLtreOkwGrXiaWm2p/bsgdkX7U+2kg/EqzuVbx8wkuIv24wi4x7gIzVzm8vhTrwbUfQ== X-Received: by 2002:a65:5c83:: with SMTP id a3-v6mr19767602pgt.164.1533026945873; Tue, 31 Jul 2018 01:49:05 -0700 (PDT) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id t21-v6sm23808761pfi.73.2018.07.31.01.49.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jul 2018 01:49:05 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Tue, 31 Jul 2018 18:48:54 +1000 Message-Id: <20180731084854.27802-1-oohall@gmail.com> X-Mailer: git-send-email 2.9.5 Subject: [Skiboot] [RFC PATCH] phb4: Make verbose EEH output less verbose X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.27 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" Each PHB4 component has a error status register and a set of component-specific registers that describe that error in more detail. If the status register of a component has no bits set there's not much point in dumping the error detail registers. This patch modifies the verbose EEH dumping code so that it only dumps the error registers of a component if there are bits set in the error status register of that component. This limits the output to the registers that are actually relevant to the error that occured which makes interpreting the dumps slightly easier. Signed-off-by: Oliver O'Halloran Acked-by: Russell Currey --- I've been using this in my debug builds for a while, but I'm not sure if it's a great idea since sometimes other people want to full dump. It's probably fine... --- hw/phb4.c | 88 ++++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 56 insertions(+), 32 deletions(-) diff --git a/hw/phb4.c b/hw/phb4.c index f5953a78a051..bb382395026e 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -2158,38 +2158,62 @@ static void phb4_eeh_dump_regs(struct phb4 *p) PHBERR(p, " lemFir = %016llx\n", s->lemFir); PHBERR(p, " lemErrorMask = %016llx\n", s->lemErrorMask); PHBERR(p, " lemWOF = %016llx\n", s->lemWOF); - PHBERR(p, " phbErrorStatus = %016llx\n", s->phbErrorStatus); - PHBERR(p, " phbFirstErrorStatus = %016llx\n", s->phbFirstErrorStatus); - PHBERR(p, " phbErrorLog0 = %016llx\n", s->phbErrorLog0); - PHBERR(p, " phbErrorLog1 = %016llx\n", s->phbErrorLog1); - PHBERR(p, " phbTxeErrorStatus = %016llx\n", s->phbTxeErrorStatus); - PHBERR(p, " phbTxeFirstErrorStatus = %016llx\n", s->phbTxeFirstErrorStatus); - PHBERR(p, " phbTxeErrorLog0 = %016llx\n", s->phbTxeErrorLog0); - PHBERR(p, " phbTxeErrorLog1 = %016llx\n", s->phbTxeErrorLog1); - PHBERR(p, " phbRxeArbErrorStatus = %016llx\n", s->phbRxeArbErrorStatus); - PHBERR(p, "phbRxeArbFrstErrorStatus = %016llx\n", s->phbRxeArbFirstErrorStatus); - PHBERR(p, " phbRxeArbErrorLog0 = %016llx\n", s->phbRxeArbErrorLog0); - PHBERR(p, " phbRxeArbErrorLog1 = %016llx\n", s->phbRxeArbErrorLog1); - PHBERR(p, " phbRxeMrgErrorStatus = %016llx\n", s->phbRxeMrgErrorStatus); - PHBERR(p, "phbRxeMrgFrstErrorStatus = %016llx\n", s->phbRxeMrgFirstErrorStatus); - PHBERR(p, " phbRxeMrgErrorLog0 = %016llx\n", s->phbRxeMrgErrorLog0); - PHBERR(p, " phbRxeMrgErrorLog1 = %016llx\n", s->phbRxeMrgErrorLog1); - PHBERR(p, " phbRxeTceErrorStatus = %016llx\n", s->phbRxeTceErrorStatus); - PHBERR(p, "phbRxeTceFrstErrorStatus = %016llx\n", s->phbRxeTceFirstErrorStatus); - PHBERR(p, " phbRxeTceErrorLog0 = %016llx\n", s->phbRxeTceErrorLog0); - PHBERR(p, " phbRxeTceErrorLog1 = %016llx\n", s->phbRxeTceErrorLog1); - PHBERR(p, " phbPblErrorStatus = %016llx\n", s->phbPblErrorStatus); - PHBERR(p, " phbPblFirstErrorStatus = %016llx\n", s->phbPblFirstErrorStatus); - PHBERR(p, " phbPblErrorLog0 = %016llx\n", s->phbPblErrorLog0); - PHBERR(p, " phbPblErrorLog1 = %016llx\n", s->phbPblErrorLog1); - PHBERR(p, " phbPcieDlpErrorLog1 = %016llx\n", s->phbPcieDlpErrorLog1); - PHBERR(p, " phbPcieDlpErrorLog2 = %016llx\n", s->phbPcieDlpErrorLog2); - PHBERR(p, " phbPcieDlpErrorStatus = %016llx\n", s->phbPcieDlpErrorStatus); - - PHBERR(p, " phbRegbErrorStatus = %016llx\n", s->phbRegbErrorStatus); - PHBERR(p, " phbRegbFirstErrorStatus = %016llx\n", s->phbRegbFirstErrorStatus); - PHBERR(p, " phbRegbErrorLog0 = %016llx\n", s->phbRegbErrorLog0); - PHBERR(p, " phbRegbErrorLog1 = %016llx\n", s->phbRegbErrorLog1); + + /* Only dump the detailed regs if the error reg is non-zero */ + if (s->phbErrorStatus) { + PHBERR(p, " phbErrorStatus = %016llx\n", s->phbErrorStatus); + PHBERR(p, " phbFirstErrorStatus = %016llx\n", s->phbFirstErrorStatus); + PHBERR(p, " phbErrorLog0 = %016llx\n", s->phbErrorLog0); + PHBERR(p, " phbErrorLog1 = %016llx\n", s->phbErrorLog1); + } + + if (s->phbTxeErrorStatus) { + PHBERR(p, " phbTxeErrorStatus = %016llx\n", s->phbTxeErrorStatus); + PHBERR(p, " phbTxeFirstErrorStatus = %016llx\n", s->phbTxeFirstErrorStatus); + PHBERR(p, " phbTxeErrorLog0 = %016llx\n", s->phbTxeErrorLog0); + PHBERR(p, " phbTxeErrorLog1 = %016llx\n", s->phbTxeErrorLog1); + } + + if (s->phbRxeArbErrorStatus) { + PHBERR(p, " phbRxeArbErrorStatus = %016llx\n", s->phbRxeArbErrorStatus); + PHBERR(p, "phbRxeArbFrstErrorStatus = %016llx\n", s->phbRxeArbFirstErrorStatus); + PHBERR(p, " phbRxeArbErrorLog0 = %016llx\n", s->phbRxeArbErrorLog0); + PHBERR(p, " phbRxeArbErrorLog1 = %016llx\n", s->phbRxeArbErrorLog1); + } + + if (s->phbRxeMrgErrorStatus) { + PHBERR(p, " phbRxeMrgErrorStatus = %016llx\n", s->phbRxeMrgErrorStatus); + PHBERR(p, "phbRxeMrgFrstErrorStatus = %016llx\n", s->phbRxeMrgFirstErrorStatus); + PHBERR(p, " phbRxeMrgErrorLog0 = %016llx\n", s->phbRxeMrgErrorLog0); + PHBERR(p, " phbRxeMrgErrorLog1 = %016llx\n", s->phbRxeMrgErrorLog1); + } + + if (s->phbRxeTceErrorStatus) { + PHBERR(p, " phbRxeTceErrorStatus = %016llx\n", s->phbRxeTceErrorStatus); + PHBERR(p, "phbRxeTceFrstErrorStatus = %016llx\n", s->phbRxeTceFirstErrorStatus); + PHBERR(p, " phbRxeTceErrorLog0 = %016llx\n", s->phbRxeTceErrorLog0); + PHBERR(p, " phbRxeTceErrorLog1 = %016llx\n", s->phbRxeTceErrorLog1); + } + + if (s->phbPblErrorStatus) { + PHBERR(p, " phbPblErrorStatus = %016llx\n", s->phbPblErrorStatus); + PHBERR(p, " phbPblFirstErrorStatus = %016llx\n", s->phbPblFirstErrorStatus); + PHBERR(p, " phbPblErrorLog0 = %016llx\n", s->phbPblErrorLog0); + PHBERR(p, " phbPblErrorLog1 = %016llx\n", s->phbPblErrorLog1); + } + + if (s->phbPcieDlpErrorStatus) { + PHBERR(p, " phbPcieDlpErrorStatus = %016llx\n", s->phbPcieDlpErrorStatus); + PHBERR(p, " phbPcieDlpErrorLog1 = %016llx\n", s->phbPcieDlpErrorLog1); + PHBERR(p, " phbPcieDlpErrorLog2 = %016llx\n", s->phbPcieDlpErrorLog2); + } + + if (s->phbRegbErrorStatus) { + PHBERR(p, " phbRegbErrorStatus = %016llx\n", s->phbRegbErrorStatus); + PHBERR(p, " phbRegbFirstErrorStatus = %016llx\n", s->phbRegbFirstErrorStatus); + PHBERR(p, " phbRegbErrorLog0 = %016llx\n", s->phbRegbErrorLog0); + PHBERR(p, " phbRegbErrorLog1 = %016llx\n", s->phbRegbErrorLog1); + } for (i = 0; i < OPAL_PHB4_NUM_PEST_REGS; i++) { if (!s->pestA[i] && !s->pestB[i])