From patchwork Thu Nov 9 20:46:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oza Pawandeep X-Patchwork-Id: 10051865 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 6A03660632 for ; Thu, 9 Nov 2017 20:47:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5ECB52B111 for ; Thu, 9 Nov 2017 20:47:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53E0E2B116; Thu, 9 Nov 2017 20:47:29 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 F22672B115 for ; Thu, 9 Nov 2017 20:47:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752827AbdKIUr2 (ORCPT ); Thu, 9 Nov 2017 15:47:28 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:32828 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751133AbdKIUr1 (ORCPT ); Thu, 9 Nov 2017 15:47:27 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 56FA76086D; Thu, 9 Nov 2017 20:47:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510260446; bh=DuxslfKaFEeGelK5ai7NKAoe/pEkuxH9ldfKPi3TqD4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JGW5bA2i7QvXgOwJvMfFzw8jHu0RkkQVwksvsdGdj1wDRaE4xlgQI9si9PlAU1xs+ mWDrwDdc6+r26fxOmumf715+E1KyGj1hKiABsaoADOpHKqqAAq9sHw/pn99u8qRfIO dP5GKfAWfQdpw6NoLR5xxeBZAFbgAZHq+ZS4FEqI= Received: from blr-ubuntu-poza.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: poza@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3C44E6084A; Thu, 9 Nov 2017 20:47:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1510260443; bh=DuxslfKaFEeGelK5ai7NKAoe/pEkuxH9ldfKPi3TqD4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nIm2bXCBwZy/BSoz6FUhHUrvfHg21fgvdfhrx4jrM39K44u/f+aVIb+i6svLe9Wcw 2Cw0MpI9TNUYKt5Ybo1C1CHMhpZo6WvZqhu8+SCQk41FB0h3inT67eC64yDkyhWf5J G8VD7+TSP48V6OuLd+2M4WGPBhReRS0Me8eQ8DiE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3C44E6084A Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=poza@codeaurora.org From: Pawandeep Oza To: linux-pci@vger.kernel.org, timur@codeaurora.org Cc: Bjorn Helgaas , Dongdong Liu , Gabriele Paoloni , Thomas Gleixner , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Oza Pawandeep Subject: [PATCH 4/4] PCI/AER: Dont do recovery when DPC is enabled Date: Fri, 10 Nov 2017 02:16:39 +0530 Message-Id: <1510260399-14886-5-git-send-email-poza@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1510260399-14886-1-git-send-email-poza@codeaurora.org> References: <1510260399-14886-1-git-send-email-poza@codeaurora.org> 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 From: Oza Pawandeep PCI Express Base Specification, Rev. 4.0 Version 0.9 6.2.10: Downstream Port Containment (DPC) DPC is an optional normative feature of a Downstream Port. DPC halts PCI Express traffic below a Downstream Port after an unmasked uncorrectable error is detected at or below the Port, avoiding the potential spread of any data corruption, and permitting error recovery if supported by software Triggering DPC disables its Link by directing the LTSSM to the Disabled state. Once the LTSSM reaches the Disabled state, it remains in that state until the DPC Trigger Status bit is Cleared So when DPC service is active and registered to port driver, AER should not attempt to recover, since DPC will be removing downstream devices. Signed-off-by: Oza Pawandeep diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index 7448052..8d48d5c 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c @@ -495,6 +495,18 @@ static void do_recovery(struct pci_dev *dev, int severity) pci_ers_result_t status, result = PCI_ERS_RESULT_RECOVERED; enum pci_channel_state state; + /* + * If DPC is enabled, there is no need to attempt recovery. + * Since DPC disables its Link by directing the LTSSM to + * the Disabled state. + * DPC driver will take care of the recovery, there is no need + * for AER driver to race. + */ + if (pcie_port_query_service(dev, PCIE_PORT_SERVICE_DPC)) { + dev_info(&dev->dev, "AER: Device recovery to be done by DPC\n"); + return; + } + if (severity == AER_FATAL) state = pci_channel_io_frozen; else