Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2891638imm; Tue, 4 Sep 2018 11:40:23 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdav7385OprRd/ygLZRtzkBd9XZcpdGoHrKJQrjLjKAVFc6mst4hYh2zguC+BWnMjzbP1vjP X-Received: by 2002:a63:c807:: with SMTP id z7-v6mr31768993pgg.77.1536086423280; Tue, 04 Sep 2018 11:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536086423; cv=none; d=google.com; s=arc-20160816; b=MQBtDj3Ykh42TJYvJUbQ6vdzWfLxX9Q4qAdYYUDJKHfxC6XdKj2X4qqDdQqX9QjxL2 epvGtitvzqc9ojQXgf46WqH7pnMCnRFGghthUxpSyVj79NIMX+4i4Gt3ddoRsICoBEuM UUJ2FOQqZ0AehOiDXk7XixPxVnrZvplbkfvkyaBG5F1H9a6q+5V1qB8xuCZBRMHPf4F3 Kv055epSCx1eKdMU+qWuA+oiCBImJAc5WXLgfmXtkhg96MpmqwlmwY4I1sF4k6OShGPl TaCt0gJTjz1PQkC2gjH0p66Hmy3kA8ECQYe8PpPWPyEE35XM1Zm1kHv4g72kKUjLuSeo RpeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=8kM9Ru+6jgzjidlOG7soM0W94ia0wOX8miYkXs+SIpk=; b=ucev8VfI2zLYv50y5xSS+XnYuxrY5vK0hgKsjck+UIcmV1SsV7jQYiaAJksfTIu1S/ JxvdYw3o/fgZgEWywdqSI7lyhnyG+UprJxpl9fb8B/MEhAWJZevYuu2cz77X4oKTrinl I6HntKoNeqmJ/2a5Qeljy8PEJfrr1zV+RtWQ0VZGmpDDp+PhQbQDS7W1WsWCMaMbm/HG K+VatJHcNHai59uMPRF+wthBeXoRoaJAPRgyZXlRQeUtJl4dwky+bH/eMvOS23wGr9ih /TaJNqnmt9TU+ffBRJWukcYl1OBQTn59Ul60irqEErua2vYT5hT3pO5gEOZwyTtmF4jK AmrQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m61-v6si21601321plb.296.2018.09.04.11.40.07; Tue, 04 Sep 2018 11:40:23 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727799AbeIDXFN (ORCPT + 99 others); Tue, 4 Sep 2018 19:05:13 -0400 Received: from mga06.intel.com ([134.134.136.31]:7110 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727072AbeIDXFN (ORCPT ); Tue, 4 Sep 2018 19:05:13 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2018 11:38:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,330,1531810800"; d="scan'208";a="77938432" Received: from unknown (HELO localhost.localdomain.localdomain) ([10.232.117.194]) by FMSMGA003.fm.intel.com with ESMTP; 04 Sep 2018 11:38:51 -0700 From: Jon Derrick To: Cc: , Bjorn Helgaas , Keith Busch , Sinan Kaya , Oza Pawandeep , Matthew Wilcox , Lukas Winner , Christoph Hellwig , Mika Westerberg , Jon Derrick Subject: [PATCH] PCI/portdrv: Enable error reporting on managed ports Date: Tue, 4 Sep 2018 12:33:09 -0600 Message-Id: <1536085989-2956-1-git-send-email-jonathan.derrick@intel.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During probe, the port driver will disable error reporting and assumes it will be enabled later by the AER driver's pci_walk_bus() sequence. This may not be the case for host-bridge enabled root ports, who will enable first error reporting on the bus during the root port probe, and then disable error reporting on downstream devices during subsequent probing of the bus. A hotplugged port device may also fail to enable error reporting as the AER driver has already run on the root bus. Check for these conditions and enable error reporting during portdrv probing. Example case: [ 343.790573] pcieport 10000:00:00.0: pci_disable_pcie_error_reporting [ 343.809812] pcieport 10000:00:00.0: pci_enable_pcie_error_reporting [ 343.819506] pci 10000:01:00.0: pci_enable_pcie_error_reporting [ 343.828814] pci 10000:02:00.0: pci_enable_pcie_error_reporting [ 343.838089] pci 10000:02:01.0: pci_enable_pcie_error_reporting [ 343.847478] pci 10000:02:02.0: pci_enable_pcie_error_reporting [ 343.856659] pci 10000:02:03.0: pci_enable_pcie_error_reporting [ 343.865794] pci 10000:02:04.0: pci_enable_pcie_error_reporting [ 343.874875] pci 10000:02:05.0: pci_enable_pcie_error_reporting [ 343.883918] pci 10000:02:06.0: pci_enable_pcie_error_reporting [ 343.892922] pci 10000:02:07.0: pci_enable_pcie_error_reporting [ 343.918900] pcieport 10000:01:00.0: pci_disable_pcie_error_reporting [ 343.968426] pcieport 10000:02:00.0: pci_disable_pcie_error_reporting [ 344.028179] pcieport 10000:02:01.0: pci_disable_pcie_error_reporting [ 344.091269] pcieport 10000:02:02.0: pci_disable_pcie_error_reporting [ 344.156473] pcieport 10000:02:03.0: pci_disable_pcie_error_reporting [ 344.238042] pcieport 10000:02:04.0: pci_disable_pcie_error_reporting [ 344.321864] pcieport 10000:02:05.0: pci_disable_pcie_error_reporting [ 344.411601] pcieport 10000:02:06.0: pci_disable_pcie_error_reporting [ 344.505332] pcieport 10000:02:07.0: pci_disable_pcie_error_reporting [ 344.621824] nvme 10000:06:00.0: pci_enable_pcie_error_reporting Signed-off-by: Jon Derrick --- drivers/pci/pcie/portdrv_core.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 7c37d81..fdd953a 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -343,6 +343,16 @@ int pcie_port_device_register(struct pci_dev *dev) if (!nr_service) goto error_cleanup_irqs; +#ifdef CONFIG_PCIEAER + /* + * Enable error reporting for this port in case AER probing has already + * run on the root bus or this port device is hot-inserted + */ + if (dev->aer_cap && pci_aer_available() && + (pcie_ports_native || pci_find_host_bridge(dev->bus)->native_aer)) + pci_enable_pcie_error_reporting(dev); +#endif + return 0; error_cleanup_irqs: -- 1.8.3.1