Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2967987imm; Thu, 17 May 2018 00:45:27 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrljwmjklKAXbeSFjuoJVTPkhKlCO/BgFdGWDX0VNb/qDvSUxs4DNWd+vb5Uej7UmIbb48R X-Received: by 2002:a63:6d87:: with SMTP id i129-v6mr1416398pgc.217.1526543127789; Thu, 17 May 2018 00:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526543127; cv=none; d=google.com; s=arc-20160816; b=v2iaLmexry0JqJLCpp30WBafe7WrP2V/D2R7wQjSJ2BH61PwXuQZpHCe3RSz+ICVL5 HjaBFQmrcviYdConzXuYuLV2wtl0G/dzIBtg+O5ilpDJnbN2uV3FMSYbkc1hOC7XoTYw VYJCvXvK2T7zp3jLiww8jxlzV6lF+3y8kN2/BSRPtzW8Ac0VT6rV2r/j5KFWbPR/eQyk umsKhAKJtCeiZh4Xjf5sxn1WDq922tu/pooZkdjGmuikuDxXaDeArS7j1dznxahYo702 g7ME058rT7kJ1gpop6Hgw1wCHo5migjLbEykadybb0Lwpf1yTy4JTMwRtpNNdfQWvIgW GYnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=JeZAdRP/BTgGIeAj+KYxNDNfTath0kbrlej+2MVahHo=; b=Czhva2QeE6BKr7lK8hsjST0Q0dzovmiF4f4T16dpbN7Nf5B/PwxfPiAEkENFxYtf6g jMkzDH2xnSZPW67nGxuuJXQQ1HVQxqvqIkn1SOmNa1xe6qcKTdegFRvoIhuZuqprfIYw vKgqMqf16p/q64MO/Op5eGNjcCZL6NsIJmTf/fnHRsuh/MXVWb481fDlS9X3uTSOUlBH FZgK7AoCbw9zeo08lcKOGQxJgcG/wjhcVpYKaNXvnAotL2Cekgd5tJCp42moERy7KQkh bWcEtq+RTEkWyklAiToPtD18mkZrQslZopPLuS/onvCeePWkz1ZKOI8DE5FsghXypgM/ bV3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n14-v6si3584683pgu.688.2018.05.17.00.45.13; Thu, 17 May 2018 00:45:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752539AbeEQHnW (ORCPT + 99 others); Thu, 17 May 2018 03:43:22 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:18258 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752396AbeEQHnQ (ORCPT ); Thu, 17 May 2018 03:43:16 -0400 X-IronPort-AV: E=Sophos;i="5.49,409,1520924400"; d="scan'208";a="17447187" Received: from ironmsg03-sd.qualcomm.com ([10.53.140.143]) by alexa-out.qualcomm.com with ESMTP; 17 May 2018 00:43:15 -0700 X-IronPort-AV: E=McAfee;i="5900,7806,8895"; a="163842609" Received: from westreach.qualcomm.com ([10.228.196.125]) by ironmsg03-sd.qualcomm.com with ESMTP; 17 May 2018 00:43:14 -0700 Received: by westreach.qualcomm.com (Postfix, from userid 467151) id C990E1F33; Thu, 17 May 2018 03:43:12 -0400 (EDT) From: Oza Pawandeep To: Bjorn Helgaas , Philippe Ombredanne , Thomas Gleixner , Greg Kroah-Hartman , Kate Stewart , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Dongdong Liu , Keith Busch , Wei Zhang , Sinan Kaya , Timur Tabi Cc: Oza Pawandeep , Bjorn Helgaas Subject: [PATCH v17 8/9] PCI/AER: Pass service type to pcie_do_fatal_recovery() Date: Thu, 17 May 2018 03:43:10 -0400 Message-Id: <1526542991-5291-9-git-send-email-poza@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526542991-5291-1-git-send-email-poza@codeaurora.org> References: <1526542991-5291-1-git-send-email-poza@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pass the service type to pcie_do_fatal_recovery() instead of assuming AER. We will make DPC also use pcie_do_fatal_recovery(), and it needs to do things a little differently for AER and DPC. Signed-off-by: Oza Pawandeep [bhelgaas: split to separate patch] Signed-off-by: Bjorn Helgaas diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 5e8857a..6af7595 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -354,7 +354,7 @@ static inline resource_size_t pci_resource_alignment(struct pci_dev *dev, void pci_enable_acs(struct pci_dev *dev); /* PCI error reporting and recovery */ -void pcie_do_fatal_recovery(struct pci_dev *dev); +void pcie_do_fatal_recovery(struct pci_dev *dev, u32 service); void pcie_do_nonfatal_recovery(struct pci_dev *dev); bool pcie_wait_for_link(struct pci_dev *pdev, bool active); diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index fdfc474..36e622d 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c @@ -254,7 +254,7 @@ static void handle_error_source(struct pcie_device *aerdev, } else if (info->severity == AER_NONFATAL) pcie_do_nonfatal_recovery(dev); else if (info->severity == AER_FATAL) - pcie_do_fatal_recovery(dev); + pcie_do_fatal_recovery(dev, PCIE_PORT_SERVICE_AER); } #ifdef CONFIG_ACPI_APEI_PCIEAER @@ -321,7 +321,7 @@ static void aer_recover_work_func(struct work_struct *work) if (entry.severity == AER_NONFATAL) pcie_do_nonfatal_recovery(pdev); else if (entry.severity == AER_FATAL) - pcie_do_fatal_recovery(pdev); + pcie_do_fatal_recovery(pdev, PCIE_PORT_SERVICE_AER); pci_dev_put(pdev); } } diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c index a1668e9..8d68cd7 100644 --- a/drivers/pci/pcie/err.c +++ b/drivers/pci/pcie/err.c @@ -180,7 +180,7 @@ static pci_ers_result_t default_reset_link(struct pci_dev *dev) return PCI_ERS_RESULT_RECOVERED; } -static pci_ers_result_t reset_link(struct pci_dev *dev) +static pci_ers_result_t reset_link(struct pci_dev *dev, u32 service) { struct pci_dev *udev; pci_ers_result_t status; @@ -195,7 +195,7 @@ static pci_ers_result_t reset_link(struct pci_dev *dev) } /* Use the aer driver of the component firstly */ - driver = pcie_port_find_service(udev, PCIE_PORT_SERVICE_AER); + driver = pcie_port_find_service(udev, service); if (driver && driver->reset_link) { status = driver->reset_link(udev); @@ -281,7 +281,7 @@ static pci_ers_result_t broadcast_error_message(struct pci_dev *dev, * beneath this AER agent, followed by reset link e.g. secondary bus reset * followed by re-enumeration of devices. */ -void pcie_do_fatal_recovery(struct pci_dev *dev) +void pcie_do_fatal_recovery(struct pci_dev *dev, u32 service) { struct pci_dev *udev; struct pci_bus *parent; @@ -307,9 +307,10 @@ void pcie_do_fatal_recovery(struct pci_dev *dev) pci_dev_put(pdev); } - result = reset_link(udev); + result = reset_link(udev, service); - if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { + if ((service == PCIE_PORT_SERVICE_AER) && + (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE)) { /* * If the error is reported by a bridge, we think this error * is related to the downstream link of the bridge, so we -- 2.7.4