From patchwork Fri Feb 3 21:46:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Busch X-Patchwork-Id: 723942 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vFVfZ4JT0z9s75 for ; Sat, 4 Feb 2017 08:40:54 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752706AbdBCVkx (ORCPT ); Fri, 3 Feb 2017 16:40:53 -0500 Received: from mga07.intel.com ([134.134.136.100]:46414 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752696AbdBCVkw (ORCPT ); Fri, 3 Feb 2017 16:40:52 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP; 03 Feb 2017 13:37:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,330,1477983600"; d="scan'208";a="1121830456" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.96]) by fmsmga002.fm.intel.com with ESMTP; 03 Feb 2017 13:37:21 -0800 From: Keith Busch To: linux-pci@vger.kernel.org, Bjorn Helgaas Cc: Gabriele Paoloni , Keith Busch Subject: [PATCH 1/2] pcie-dpc: Decode extended reasons Date: Fri, 3 Feb 2017 16:46:12 -0500 Message-Id: <1486158373-18655-1-git-send-email-keith.busch@intel.com> X-Mailer: git-send-email 2.5.5 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org This is just informational to decode the currently defined extended event reasons rather than just using the generic "extended" explanation. Signed-off-by: Keith Busch --- drivers/pci/pcie/pcie-dpc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pcie/pcie-dpc.c b/drivers/pci/pcie/pcie-dpc.c index d91e538..9ca74f4 100644 --- a/drivers/pci/pcie/pcie-dpc.c +++ b/drivers/pci/pcie/pcie-dpc.c @@ -77,11 +77,15 @@ static irqreturn_t dpc_irq(int irq, void *context) if (status & PCI_EXP_DPC_STATUS_TRIGGER) { u16 reason = (status >> 1) & 0x3; + u16 ext_reason = (status >> 5) & 0x3; - dev_warn(&dpc->dev->device, "DPC %s triggered, remove downstream devices\n", + dev_warn(&dpc->dev->device, "DPC %s detected, remove downstream devices\n", (reason == 0) ? "unmasked uncorrectable error" : (reason == 1) ? "ERR_NONFATAL" : - (reason == 2) ? "ERR_FATAL" : "extended error"); + (reason == 2) ? "ERR_FATAL" : + (ext_reason == 0) ? "RP PIO error" : + (ext_reason == 1) ? "software trigger" : + "reserved error"); schedule_work(&dpc->work); } return IRQ_HANDLED;