Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp650139imm; Fri, 22 Jun 2018 02:59:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKodRiHU16lYxErscKFISd6+WB675VqYZ28CLH1Etg5hfoRLXGjOAxywbjmLbbNlJQ+aSiY X-Received: by 2002:a62:ba13:: with SMTP id k19-v6mr974510pff.245.1529661579868; Fri, 22 Jun 2018 02:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529661579; cv=none; d=google.com; s=arc-20160816; b=yzro9nTW6O1zaXdlmXOltXM9cV8yGxTNCsldcXPsfYCuyGVvOa2Incw1d1Cr6V+f8+ Ndcl3QQqvMFI2q+4rYZlKkRV+HiMz8WIe7MId8n9JooXzj3MKhkU6qMkgMPxc19+1MIT TH8g7p4v3dpwcvtVV10u+yVc77XYTzzPlQqG/cpqZ1zGZcYHVKcP9b1hZpRV/4hKUeoS pjsGtS+WpWn+u42oIPO9ys4FxVZ6R7CDKBYLLXJKcBEuPd8ZTeQb9lc3oKCRmn46LJmS 1PJFhH4QMf4QMxgJVcPuzorZpRWBYOyOEiz3xuAdom0/SnPZeGo+tCBTWgg0cmIt8Bfc mvWg== 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=gfHBC7hR67+g6YdjplSOK6ayBcaUcnLVff5tXbAENK4=; b=stBIZSqhSMUa7hkcM8Qy4mxq4KXmF4BwYRkWOtz9hHAkLIfU2YDRflb9wNsWczRDbw Hl9HjHaz6Na/Wq9NamtXuykEcVq9bCkAt6N91CH590T4wdhbwQBz3RZAnC5yovcMvKhl 6uPKSILnpZF3G0MmmgcwCPBQn0Th8RLWtn1RnIFSgKTSQPBdmT9eU5IsGAWIZo/zp/yX 8k8prAnb+UHqww5wiXB700qRM6vRdOpnCpGFpyDrw6q/+eyQHxs29smTMx6ABfE1+wnT o8HqLAewBhU4+OtdgD6srA+tQlW/ZbnpRt6SR50z/Hd/hVwDllJHc7dkjPi5tWuCQ+/p Q0lA== 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 y23-v6si7432582pli.354.2018.06.22.02.59.25; Fri, 22 Jun 2018 02:59:39 -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 S933191AbeFVJ6W (ORCPT + 99 others); Fri, 22 Jun 2018 05:58:22 -0400 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:39596 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751325AbeFVJ6U (ORCPT ); Fri, 22 Jun 2018 05:58:20 -0400 X-IronPort-AV: E=Sophos;i="5.51,256,1526367600"; d="scan'208";a="5079190" Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-02.qualcomm.com with ESMTP; 22 Jun 2018 02:58:19 -0700 Received: from westreach.qualcomm.com ([10.228.196.125]) by ironmsg02-sd.qualcomm.com with ESMTP; 22 Jun 2018 02:58:18 -0700 Received: by westreach.qualcomm.com (Postfix, from userid 467151) id 28F911F27; Fri, 22 Jun 2018 05:58:18 -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 Subject: [PATCH v2 2/6] PCI/AER: Clear uncorrectable fatal error status bits Date: Fri, 22 Jun 2018 05:58:10 -0400 Message-Id: <1529661494-20936-3-git-send-email-poza@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1529661494-20936-1-git-send-email-poza@codeaurora.org> References: <1529661494-20936-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 During ERR_FATAL handling, AER calls pci_cleanup_aer_uncorrect_error_status which should handle pci_channel_io_frozen case in order to determine if it has to clear fatal bits. Signed-off-by: Oza Pawandeep diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index d6cb1f0..e9c115d 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -369,7 +369,12 @@ int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev) /* Clean AER Root Error Status */ pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, &status); pci_read_config_dword(dev, pos + PCI_ERR_UNCOR_SEVER, &mask); - status &= ~mask; /* Clear corresponding nonfatal bits */ + + if (dev->error_state == pci_channel_io_normal) + status &= ~mask; /* Clear corresponding nonfatal bits */ + else + status &= mask; /* Clear corresponding fatal bits */ + if (status) pci_write_config_dword(dev, pos + PCI_ERR_UNCOR_STATUS, status); diff --git a/drivers/pci/pcie/err.c b/drivers/pci/pcie/err.c index f7ce0cb..00d2875 100644 --- a/drivers/pci/pcie/err.c +++ b/drivers/pci/pcie/err.c @@ -288,6 +288,7 @@ void pcie_do_fatal_recovery(struct pci_dev *dev, u32 service) struct pci_dev *pdev, *temp; pci_ers_result_t result; + dev->error_state = pci_channel_io_frozen; if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) udev = dev; else @@ -323,6 +324,7 @@ void pcie_do_fatal_recovery(struct pci_dev *dev, u32 service) if (pcie_wait_for_link(udev, true)) pci_rescan_bus(udev->bus); pci_info(dev, "Device recovery from fatal error successful\n"); + dev->error_state = pci_channel_io_normal; } else { pci_uevent_ers(dev, PCI_ERS_RESULT_DISCONNECT); pci_info(dev, "Device recovery from fatal error failed\n"); -- 2.7.4