From patchwork Tue Dec 19 21:06:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 10124359 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 364A360390 for ; Tue, 19 Dec 2017 21:03:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2951B2959E for ; Tue, 19 Dec 2017 21:03:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E35A295EC; Tue, 19 Dec 2017 21:03:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5EF42959E for ; Tue, 19 Dec 2017 21:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751820AbdLSVDl (ORCPT ); Tue, 19 Dec 2017 16:03:41 -0500 Received: from mga14.intel.com ([192.55.52.115]:35685 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751298AbdLSVDk (ORCPT ); Tue, 19 Dec 2017 16:03:40 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Dec 2017 13:03:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,428,1508828400"; d="scan'208";a="160203302" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.44]) by orsmga004.jf.intel.com with ESMTP; 19 Dec 2017 13:03:34 -0800 From: Keith Busch To: linux-pci@vger.kernel.org, Bjorn Helgaas , Maik Broemme Cc: Keith Busch Subject: [PATCH 4/4] PCI/DPC: Print AER status in DPC event handling Date: Tue, 19 Dec 2017 14:06:43 -0700 Message-Id: <20171219210643.24615-4-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171219210643.24615-1-keith.busch@intel.com> References: <20171219210643.24615-1-keith.busch@intel.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A DPC enabled device will suppress sending ERR_FATAL and ERR_NONFATAL, which prevents the AER handler from reporting the details of the error. This patch will have the DPC driver get the AER status registers from the downstream port that detected the uncorrectable error, and print out additional information. Signed-off-by: Keith Busch --- drivers/pci/pcie/pcie-dpc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/pci/pcie/pcie-dpc.c b/drivers/pci/pcie/pcie-dpc.c index ef71a472592c..aefc4fbdcef0 100644 --- a/drivers/pci/pcie/pcie-dpc.c +++ b/drivers/pci/pcie/pcie-dpc.c @@ -44,6 +44,7 @@ struct dpc_dev { int cap_pos; bool rp; u32 rp_pio_status; + struct aer_err_info info; }; static const char * const rp_pio_error_string[] = { @@ -111,6 +112,9 @@ static void interrupt_event_handler(struct work_struct *work) struct pci_dev *dev, *temp, *pdev = dpc->dev->port; struct pci_bus *parent = pdev->subordinate; + if (aer_get_device_error_info(pdev, &dpc->info)) + aer_print_error(pdev, &dpc->info); + pci_lock_rescan_remove(); list_for_each_entry_safe_reverse(dev, temp, &parent->devices, bus_list) { @@ -275,6 +279,10 @@ static irqreturn_t dpc_irq(int irq, void *context) /* show RP PIO error detail information */ if (reason == 3 && ext_reason == 0) dpc_process_rp_pio_error(dpc); + if (reason == 2) + dpc->info.severity = AER_FATAL; + else + dpc->info.severity = AER_NONFATAL; schedule_work(&dpc->work); }