From patchwork Wed Dec 27 10:20:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oza Pawandeep X-Patchwork-Id: 853120 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-pci-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=codeaurora.org header.i=@codeaurora.org header.b="RypYo+6r"; dkim=pass (1024-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="IKHtlc7q"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3z684n4kSBz9sxR for ; Wed, 27 Dec 2017 21:20:41 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751862AbdL0KUj (ORCPT ); Wed, 27 Dec 2017 05:20:39 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:43832 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751320AbdL0KUi (ORCPT ); Wed, 27 Dec 2017 05:20:38 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0746460B27; Wed, 27 Dec 2017 10:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1514370038; bh=4nHU5F8srtaxIj7SWx8da/9eVM5KEyZsIylr8oGDyuQ=; h=From:To:Cc:Subject:Date:From; b=RypYo+6rDZihbR1UVBgl8V49SI0eP+R34UYVGCQjDIhEtmi/4MhDvYehlKxmAZUmr OZfXmCr1rRniCaQKL/t2rxBZkEqmgT/5xXSAP+15ZKvloZ6jhPthC5TEaZkN0GnP4t fekgCrKjg09Jn2apUbplyPjXcrbK2jHW3DUHvXRM= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 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 33CB160272; Wed, 27 Dec 2017 10:20:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1514370037; bh=4nHU5F8srtaxIj7SWx8da/9eVM5KEyZsIylr8oGDyuQ=; h=From:To:Cc:Subject:Date:From; b=IKHtlc7qs/aTYM15fnEI/ZgvOk8EaDds1AtNJzwzms/qDWh+fxSUQU2Qc/nYYoi1l Avsjz4XyjCm2HcFjmE3Db0ZnripOUlBeDtUAXti3UMno4Mf06tHzN6woMsCMhz42JU q0y8HbSz/rBnSKw12l1dBJn/5Nd3gw8wEDT3E5rI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 33CB160272 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: 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 , Gabriele Paoloni , Keith Busch , Wei Zhang , Sinan Kaya , Timur Tabi Cc: Oza Pawandeep Subject: [PATCH 0/4] Address error and recovery for AER and DPC Date: Wed, 27 Dec 2017 15:50:18 +0530 Message-Id: <1514370022-4431-1-git-send-email-poza@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org This patch set brings in support for DPC and AER to co-exist and not to race for recovery. The current implementation of AER and error message broadcasting to the EP driver is tightly coupled and limited to AER service driver. It is important to factor out broadcasting and other link handling callbacks. So that not only when AER gets triggered, but also when DPC get triggered, or both get triggered simultaneously (for e.g. ERR_FATAL), callbacks are handled appropriately. having modularized the code, the race between AER and DPC is handled gracefully. for e.g. when DPC is active and kicked in, AER should not attempt to do recovery, because DPC takes care of it. DPC should enumerate the devices after recovering the link, which is achieved by implementing error_resume callback. Oza Pawandeep (4): PCI/AER: factor out error reporting from AER PCI/DPC/AER: Address Concurrency between AER and DPC PCI/ERR: Do not do recovery if DPC service is active PCI/DPC: Enumerate the devices after DPC trigger event drivers/acpi/apei/ghes.c | 2 +- drivers/pci/pcie/Makefile | 2 +- drivers/pci/pcie/aer/aerdrv.h | 30 --- drivers/pci/pcie/aer/aerdrv_core.c | 306 +------------------------ drivers/pci/pcie/aer/aerdrv_errprint.c | 27 ++- drivers/pci/pcie/pcie-dpc.c | 127 ++++++++++- drivers/pci/pcie/pcie-err.c | 392 +++++++++++++++++++++++++++++++++ drivers/pci/pcie/portdrv.h | 2 + include/linux/aer.h | 4 - include/linux/pci.h | 23 ++ 10 files changed, 569 insertions(+), 346 deletions(-) create mode 100644 drivers/pci/pcie/pcie-err.c