Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH 1/3] PCI/AER: Option to leave System Error Interrupts as-is
@ 2018-10-26 20:19 Jon Derrick
  2018-10-26 20:19 ` [PATCH 2/3] PCI: Export pci_find_host_bridge() Jon Derrick
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Jon Derrick @ 2018-10-26 20:19 UTC (permalink / raw)
  To: linux-pci; +Cc: Bjorn Helgaas, Lorenzo Pieralisi, Keith Busch, Jon Derrick

Add a bit in pci_host_bridge to indicate to leave the System Error
Interrupts as configured by the pre-boot environment. Propagate this to
the AER driver which disables System Error Interrupts.

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
---
 drivers/pci/pcie/aer.c | 7 +++++--
 include/linux/pci.h    | 3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
index 83180ed..6a4af63 100644
--- a/drivers/pci/pcie/aer.c
+++ b/drivers/pci/pcie/aer.c
@@ -1360,6 +1360,7 @@ static void set_downstream_devices_error_reporting(struct pci_dev *dev,
 static void aer_enable_rootport(struct aer_rpc *rpc)
 {
 	struct pci_dev *pdev = rpc->rpd;
+	struct pci_host_bridge *host;
 	int aer_pos;
 	u16 reg16;
 	u32 reg32;
@@ -1369,8 +1370,10 @@ static void aer_enable_rootport(struct aer_rpc *rpc)
 	pcie_capability_write_word(pdev, PCI_EXP_DEVSTA, reg16);
 
 	/* Disable system error generation in response to error messages */
-	pcie_capability_clear_word(pdev, PCI_EXP_RTCTL,
-				   SYSTEM_ERROR_INTR_ON_MESG_MASK);
+	host = pci_find_host_bridge(pdev->bus);
+	if (!host->no_disable_sys_err)
+		pcie_capability_clear_word(pdev, PCI_EXP_RTCTL,
+					   SYSTEM_ERROR_INTR_ON_MESG_MASK);
 
 	aer_pos = pdev->aer_cap;
 	/* Clear error status */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 6925828..6fcfab4 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -484,6 +484,9 @@ struct pci_host_bridge {
 	unsigned int	native_shpc_hotplug:1;	/* OS may use SHPC hotplug */
 	unsigned int	native_pme:1;		/* OS may use PCIe PME */
 	unsigned int	native_ltr:1;		/* OS may use PCIe LTR */
+	unsigned int	no_disable_sys_err:1;	/* Don't disable system
+						   error interrupts */
+
 	/* Resource alignment requirements */
 	resource_size_t (*align_resource)(struct pci_dev *dev,
 			const struct resource *res,
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-11-02 16:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-26 20:19 [PATCH 1/3] PCI/AER: Option to leave System Error Interrupts as-is Jon Derrick
2018-10-26 20:19 ` [PATCH 2/3] PCI: Export pci_find_host_bridge() Jon Derrick
2018-10-26 20:19 ` [PATCH 3/3] PCI/VMD: Enable firmware-first combined model Jon Derrick
2018-10-27  7:34   ` Christoph Hellwig
2018-10-29 21:06 ` [PATCH 1/3] PCI/AER: Option to leave System Error Interrupts as-is Bjorn Helgaas
2018-11-02  9:53   ` Borislav Petkov
2018-11-02 16:17     ` Keith Busch
2018-11-02 16:26       ` Borislav Petkov
2018-11-02 16:34         ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox