From patchwork Wed Jan 17 05:22:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 10168513 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 D74C060386 for ; Wed, 17 Jan 2018 05:18:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E524622F3E for ; Wed, 17 Jan 2018 05:18:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9C0D26538; Wed, 17 Jan 2018 05:18:58 +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 8590122F3E for ; Wed, 17 Jan 2018 05:18:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751131AbeAQFS4 (ORCPT ); Wed, 17 Jan 2018 00:18:56 -0500 Received: from mga09.intel.com ([134.134.136.24]:26209 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750868AbeAQFSz (ORCPT ); Wed, 17 Jan 2018 00:18:55 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2018 21:18:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,371,1511856000"; d="scan'208";a="22263606" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.44]) by fmsmga004.fm.intel.com with ESMTP; 16 Jan 2018 21:18:53 -0800 From: Keith Busch To: linux-pci@vger.kernel.org, Bjorn Helgaas Cc: Maik Broemme , Pawandeep Oza , Sinan Kaya , Keith Busch Subject: [PATCHv2 4/6] PCI/DPC: Print AER status in DPC event handling Date: Tue, 16 Jan 2018 22:22:04 -0700 Message-Id: <20180117052206.7703-5-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180117052206.7703-1-keith.busch@intel.com> References: <20180117052206.7703-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 suppresses ERR_(NON)FATAL messages, preventing the AER handler from reporting error details. If the DPC trigger reason says the downstream port detected the error, this patch has the DPC driver collect the AER uncorrectable status for logging, then clears the status. Signed-off-by: Keith Busch --- drivers/pci/pcie/pcie-dpc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/pci/pcie/pcie-dpc.c b/drivers/pci/pcie/pcie-dpc.c index d1fbd83cd240..85350b00f251 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[] = { @@ -112,6 +113,12 @@ static void interrupt_event_handler(struct work_struct *work) struct pci_bus *parent = pdev->subordinate; u16 ctl; + if (dpc->info.severity == AER_NONFATAL) { + if (aer_get_device_error_info(pdev, &dpc->info)) { + aer_print_error(pdev, &dpc->info); + pci_cleanup_aer_uncorrect_error_status(pdev); + } + } pci_lock_rescan_remove(); list_for_each_entry_safe_reverse(dev, temp, &parent->devices, bus_list) { @@ -298,6 +305,11 @@ static irqreturn_t dpc_irq(int irq, void *context) schedule_work(&dpc->work); + if (reason == 0) + dpc->info.severity = AER_NONFATAL; + else + dpc->info.severity = AER_CORRECTABLE; + return IRQ_HANDLED; }