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: 851052 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3z1VkR1R4Zz9t2f for ; Wed, 20 Dec 2017 08:03:43 +1100 (AEDT) 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 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); }