From patchwork Thu Sep 25 15:51:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 4975381 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6F2A4BEEA6 for ; Thu, 25 Sep 2014 15:51:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 15A95200DB for ; Thu, 25 Sep 2014 15:51:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 14B9E201C8 for ; Thu, 25 Sep 2014 15:51:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754073AbaIYPvH (ORCPT ); Thu, 25 Sep 2014 11:51:07 -0400 Received: from mail-ig0-f173.google.com ([209.85.213.173]:60253 "EHLO mail-ig0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754070AbaIYPvE (ORCPT ); Thu, 25 Sep 2014 11:51:04 -0400 Received: by mail-ig0-f173.google.com with SMTP id l13so8716784iga.6 for ; Thu, 25 Sep 2014 08:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=CXrF8Mnd2E9sdp4GuUoV7nOs3oBnLwNWx2aqJtbrQEk=; b=ls9B9r/nsyMga72drIjUnASCsFJJBCUyFK0zlxxBT2o24ibU+9sTDLNY6PX/5Un3WV iIHhZgIGGJqTUP5KlvA/84AY1MBfJYN1gbq7TCIi8dpBWn0a+Avy66/0yhQ6Kyi9A5EO TygzCJU0DD21A8hjVGVOSqK5pAQ2YGHRz86Stx7ZLASl4gAVW2+xF67vYT5tycPixfy0 hkCmOpVMybx38299BfCMqMZ4mGs9VzsDO5YbvEwj1vbJy0xeuburdxaBgsbdenUhPvGS vH6xIAbX6RRfV/DT1oUtb0+TgJyOx3hq81kE+V8hbwUDwAjQsyNsiE9sNikxvB4EVWq/ AvBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=CXrF8Mnd2E9sdp4GuUoV7nOs3oBnLwNWx2aqJtbrQEk=; b=bSlMnHC5fM4dapHbPyQ3uv5/HhGcp0bf1meAau86FGgQoA2tz/bjlOhm529+1/AWwX 5MdXYZWgC+pOeoy5SPPagWoHJRMsIz1YDVrm6O+VyWDj5kWsdiLaY3e3kSn8RkY6cwOO UKne+tNlBu5TMNngH3+KJSJxo35S96hiyoBJMvpdo5hw09/zt35YcJUOiXGzNnnGg8JQ vFraIb2KUfTWe5i+jNS+7QNfFLMKAFz3kEBxW4BLzyXz2BveLuTMkZFw/06womF0fKzs mgO/mIUBAQc4ccnAi953nYnnP7AZitSKIIBDxz3crz/yGMFq0aNDzGsRfttC8WmpVBZH shdw== X-Gm-Message-State: ALoCoQnNe/ttkH0nD7kMpTh6GDP/cwOFhN/f2qOmiVn9OacJXetgmuGyjvDOSBJGI4h8KWmdzVye X-Received: by 10.43.129.138 with SMTP id hi10mr18875666icc.73.1411660263814; Thu, 25 Sep 2014 08:51:03 -0700 (PDT) Received: from google.com ([172.16.50.66]) by mx.google.com with ESMTPSA id m4sm7224475igr.20.2014.09.25.08.51.02 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 25 Sep 2014 08:51:02 -0700 (PDT) Date: Thu, 25 Sep 2014 09:51:00 -0600 From: Bjorn Helgaas To: "Chen, Gong" Cc: rdunlap@infradead.org, bp@alien8.de, tony.luck@intel.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Heather Brown Subject: Re: [RESEND 2/5] PCIe, AER: Replenish missed AER status bits for AER driver Message-ID: <20140925155100.GA12200@google.com> References: <1407910961-7798-1-git-send-email-gong.chen@linux.intel.com> <1407910961-7798-3-git-send-email-gong.chen@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1407910961-7798-3-git-send-email-gong.chen@linux.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP [+cc Heather] On Wed, Aug 13, 2014 at 02:22:38AM -0400, Chen, Gong wrote: > Since commit 6c2b374d is commited, the capability of PCI-e AER > has changed a lot. This patch adds all missed CE/UC error bits > existed in PCI-e SPEC r3.0. Meanwhile, adjust the code format > to make it simpler to read/maintain. > > Signed-off-by: Chen, Gong > --- > drivers/pci/pcie/aer/aerdrv_errprint.c | 60 ++++++++++++++-------------------- > 1 file changed, 25 insertions(+), 35 deletions(-) > > diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c > index 35d06e177917..5c4f7e252e5e 100644 > --- a/drivers/pci/pcie/aer/aerdrv_errprint.c > +++ b/drivers/pci/pcie/aer/aerdrv_errprint.c > @@ -75,44 +75,34 @@ static const char *aer_error_layer[] = { > }; > > static const char *aer_correctable_error_string[] = { > - "Receiver Error", /* Bit Position 0 */ > - NULL, > - NULL, > - NULL, > - NULL, > - NULL, > - "Bad TLP", /* Bit Position 6 */ > - "Bad DLLP", /* Bit Position 7 */ > - "RELAY_NUM Rollover", /* Bit Position 8 */ > - NULL, > - NULL, > - NULL, > - "Replay Timer Timeout", /* Bit Position 12 */ > - "Advisory Non-Fatal", /* Bit Position 13 */ > + [0] = "Receiver Error", > + [6] = "Bad TLP", > + [7] = "Bad DLLP", > + [8] = "RELAY_NUM Rollover", > + [12] = "Replay Timer Timeout", > + [13] = "Advisory Non-Fatal Error", > + [14] = "Corrected Internal Error", > + [15] = "Header Log Overflow", This patch does two things at once: (1) adds new error strings and (2) converts to the designated initializer style. The first is useful but I don't think the second really helps anything. We still have to manually match up the array index, e.g., "14", with the #define, PCI_ERR_COR_INTERNAL, and then count bits to make sure it matches the constant 0x00004000. I'm still holding out for a change that solves that problem. I would also like to avoid duplicating all the strings between include/ras/ras_event.h and drivers/pci/pcie/aer/aerdrv_errprint.c. In the meantime, I applied the patch below, which does just (1). Bjorn commit d179111767aa2a1d594023ce65abf9c81bfbb0cf Author: Chen, Gong Date: Thu Sep 25 09:36:43 2014 -0600 PCI/AER: Add additional PCIe AER error strings Add strings for all AER error bits defined in PCIe r3.0. [bhelgaas: changelog, drop designated initializer change] Signed-off-by: Chen, Gong Signed-off-by: Bjorn Helgaas --- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c index 35d06e177917..c6849d9e86ce 100644 --- a/drivers/pci/pcie/aer/aerdrv_errprint.c +++ b/drivers/pci/pcie/aer/aerdrv_errprint.c @@ -89,15 +89,17 @@ static const char *aer_correctable_error_string[] = { NULL, "Replay Timer Timeout", /* Bit Position 12 */ "Advisory Non-Fatal", /* Bit Position 13 */ + "Corrected Internal Error", /* Bit Position 14 */ + "Header Log Overflow", /* Bit Position 15 */ }; static const char *aer_uncorrectable_error_string[] = { - NULL, + "Undefined", /* Bit Position 0 */ NULL, NULL, NULL, "Data Link Protocol", /* Bit Position 4 */ - NULL, + "Surprise Down Error", /* Bit Position 5 */ NULL, NULL, NULL, @@ -113,6 +115,11 @@ static const char *aer_uncorrectable_error_string[] = { "Malformed TLP", /* Bit Position 18 */ "ECRC", /* Bit Position 19 */ "Unsupported Request", /* Bit Position 20 */ + "ACS Violation", /* Bit Position 21 */ + "Uncorrectable Internal Error", /* Bit Position 22 */ + "MC Blocked TLP", /* Bit Position 23 */ + "AtomicOp Egress Blocked", /* Bit Position 24 */ + "TLP Prefix Blocked Error", /* Bit Position 25 */ }; static const char *aer_agent_string[] = {