Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2967842imm; Thu, 17 May 2018 00:45:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo5nM5Jda3VZY50APTrO8XKvY54Th+rbML16Uyce4klAcSheOQHAisB5cabrLlhxlGUUHtv X-Received: by 2002:a62:dc4e:: with SMTP id t75-v6mr4170905pfg.139.1526543117537; Thu, 17 May 2018 00:45:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526543117; cv=none; d=google.com; s=arc-20160816; b=SBxbU5aKM1YBlenalc/fTByPTiGvgQsGKasi3kNguQ6Ou90+U7YJ8Nqtew+iM3uw2L DiEsWuRetFCfnw3jUhOJwt55UiyaLXu0XnflOwSsZJfTTBk3MmWuIA0e94b9r3KcuxV2 3toITdkyHB5Y5e7wTYPbUyW8ry7epbUnYyrS8nuoo2HezskCjhF+MNernxfu1pMKw4Wx jZJJyE1JDTroPgbImlo0tXG9uF59a0KeAOpcfy8go5AKxj0tNwJ9Uy0P2gqwhgSL3P4L 2HDmIGUn8lzSqvkMDu5lHYMFHvp/89tkgL9eKtLVCDY4/TodBcdUHyDuxkT11CatSGo7 oJyg== 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=LRoIowV2QAS/YRiqYJn5EDYQ78s/7vvZbkvFgT+YIko=; b=xu5NrES15ODStJ96X28eJWl4j/VNhJ+So0AIZ4klaIrYa4+c6Z4C6bFXfcqEm/w8vs Y22HVxAUZjFfZBlXlyqzJ7OKcfq3I7YPvCRL2DgeuFIc/OewFBy7L3pcSn7wd2le2cuh UWn/XeVStTlZuJYyRMNPR0pzJQOWypCE+VBKtGN8IR+K4Oc1orCzHZ0l5jGVHt7bUGOq m8hZwdQKVAiS9inQy4d3dEgv3EGDkxkFIjGdMWwEtXd7K8OJphP0pNXK71j0yi3xc223 hiZ41fefj6TTuN319LqMLL4ToMI/LgFy2J7vOGdJ4INGLDliXvvaWqPDIZvshPr6EsO1 7tdw== 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 d23-v6si3552654pgn.326.2018.05.17.00.45.03; Thu, 17 May 2018 00:45:17 -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 S1752577AbeEQHnb (ORCPT + 99 others); Thu, 17 May 2018 03:43:31 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:18837 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752558AbeEQHnY (ORCPT ); Thu, 17 May 2018 03:43:24 -0400 X-IronPort-AV: E=Sophos;i="5.49,409,1520924400"; d="scan'208";a="340813096" Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by wolverine01.qualcomm.com with ESMTP; 17 May 2018 00:43:15 -0700 X-IronPort-AV: E=McAfee;i="5900,7806,8895"; a="87448696" Received: from westreach.qualcomm.com ([10.228.196.125]) by ironmsg05-sd.qualcomm.com with ESMTP; 17 May 2018 00:43:14 -0700 Received: by westreach.qualcomm.com (Postfix, from userid 467151) id BF2EA1F32; 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 7/9] PCI/DPC: Disable ERR_NONFATAL handling by DPC Date: Thu, 17 May 2018 03:43:09 -0400 Message-Id: <1526542991-5291-8-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 PCIe ERR_NONFATAL errors mean a particular transaction is unreliable but the Link is otherwise fully functional (PCIe r4.0, sec 6.2.2). The AER driver handles these by logging the error details and calling driver-supplied pci_error_handlers callbacks. It does not reset downstream devices, does not remove them from the PCI subsystem, does not re-enumerate them, and does not call their driver .remove() or .probe() methods. But DPC driver previously enabled DPC on ERR_NONFATAL, so if the hardware supports DPC, these errors caused a Link reset (performed automatically by the hardware), followed by the DPC driver removing affected devices (which calls their .remove() methods), bringing the Link back up, and re-enumerating (which calls driver .probe() methods). Disable ERR_NONFATAL DPC triggering so these errors will only be handled by AER. This means drivers won't have to deal with different usage of their pci_error_handlers callbacks and .probe() and .remove() methods based on whether the platform has DPC support. Signed-off-by: Oza Pawandeep [bhelgaas: changelog] Signed-off-by: Bjorn Helgaas diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c index 80ec384..361903f 100644 --- a/drivers/pci/pcie/dpc.c +++ b/drivers/pci/pcie/dpc.c @@ -260,7 +260,7 @@ static int dpc_probe(struct pcie_device *dev) } } - ctl = (ctl & 0xfff4) | PCI_EXP_DPC_CTL_EN_NONFATAL | PCI_EXP_DPC_CTL_INT_EN; + ctl = (ctl & 0xfff4) | PCI_EXP_DPC_CTL_EN_FATAL | PCI_EXP_DPC_CTL_INT_EN; pci_write_config_word(pdev, dpc->cap_pos + PCI_EXP_DPC_CTL, ctl); dev_info(device, "DPC error containment capabilities: Int Msg #%d, RPExt%c PoisonedTLP%c SwTrigger%c RP PIO Log %d, DL_ActiveErr%c\n", @@ -278,7 +278,7 @@ static void dpc_remove(struct pcie_device *dev) u16 ctl; pci_read_config_word(pdev, dpc->cap_pos + PCI_EXP_DPC_CTL, &ctl); - ctl &= ~(PCI_EXP_DPC_CTL_EN_NONFATAL | PCI_EXP_DPC_CTL_INT_EN); + ctl &= ~(PCI_EXP_DPC_CTL_EN_FATAL | PCI_EXP_DPC_CTL_INT_EN); pci_write_config_word(pdev, dpc->cap_pos + PCI_EXP_DPC_CTL, ctl); } diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index 103ba79..5182e0d 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h @@ -981,6 +981,7 @@ #define PCI_EXP_DPC_CAP_DL_ACTIVE 0x1000 /* ERR_COR signal on DL_Active supported */ #define PCI_EXP_DPC_CTL 6 /* DPC control */ +#define PCI_EXP_DPC_CTL_EN_FATAL 0x0001 /* Enable trigger on ERR_FATAL message */ #define PCI_EXP_DPC_CTL_EN_NONFATAL 0x0002 /* Enable trigger on ERR_NONFATAL message */ #define PCI_EXP_DPC_CTL_INT_EN 0x0008 /* DPC Interrupt Enable */ -- 2.7.4