public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pci: implement "pci=noaer"
@ 2007-10-05 20:17 Randy Dunlap
  2007-10-15 17:12 ` Linas Vepstas
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2007-10-05 20:17 UTC (permalink / raw)
  To: lkml, linas; +Cc: gregkh, akpm, linux-pci

From: Randy Dunlap <randy.dunlap@oracle.com>

For cases in which CONFIG_PCIEAER=y (such as distro kernels), allow users
to disable PCIE Advanced Error Reporting by using "pci=noaer" on the
kernel command line.

This can be used to work around hardware or (kernel) software problems.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 Documentation/kernel-parameters.txt |    4 ++++
 drivers/pci/pci.c                   |    2 ++
 drivers/pci/pci.h                   |    6 ++++++
 drivers/pci/pcie/aer/aerdrv.c       |    9 +++++++++
 4 files changed, 21 insertions(+)

--- linux-2.6.23-rc9.orig/Documentation/kernel-parameters.txt
+++ linux-2.6.23-rc9/Documentation/kernel-parameters.txt
@@ -67,6 +67,7 @@ parameter is applicable:
 	PARIDE	The ParIDE (parallel port IDE) subsystem is enabled.
 	PARISC	The PA-RISC architecture is enabled.
 	PCI	PCI bus support is enabled.
+	PCIE	PCI Express support is enabled.
 	PCMCIA	The PCMCIA subsystem is enabled.
 	PNP	Plug & Play support is enabled.
 	PPC	PowerPC architecture is enabled.
@@ -1269,6 +1270,9 @@ and is between 256 and 4096 characters. 
 				Mechanism 1.
 		conf2		[X86-32] Force use of PCI Configuration
 				Mechanism 2.
+		noaer		[PCIE] If the PCIEAER kernel config parameter is
+				enabled, this kernel boot option can be used to
+				disable the use of PCIE advanced error reporting.
 		nommconf	[X86-32,X86_64] Disable use of MMCONFIG for PCI
 				Configuration
 		nomsi		[MSI] If the PCI_MSI kernel config parameter is
--- linux-2.6.23-rc9.orig/drivers/pci/pci.c
+++ linux-2.6.23-rc9/drivers/pci/pci.c
@@ -1585,6 +1585,8 @@ static int __devinit pci_setup(char *str
 		if (*str && (str = pcibios_setup(str)) && *str) {
 			if (!strcmp(str, "nomsi")) {
 				pci_no_msi();
+			} else if (!strcmp(str, "noaer")) {
+				pci_no_aer();
 			} else if (!strncmp(str, "cbiosize=", 9)) {
 				pci_cardbus_io_size = memparse(str + 9, &str);
 			} else if (!strncmp(str, "cbmemsize=", 10)) {
--- linux-2.6.23-rc9.orig/drivers/pci/pci.h
+++ linux-2.6.23-rc9/drivers/pci/pci.h
@@ -52,6 +52,12 @@ void pci_restore_msi_state(struct pci_de
 static inline void pci_restore_msi_state(struct pci_dev *dev) {}
 #endif
 
+#ifdef CONFIG_PCIEAER
+void pci_no_aer(void);
+#else
+static inline void pci_no_aer(void) { }
+#endif
+
 static inline int pci_no_d1d2(struct pci_dev *dev)
 {
 	unsigned int parent_dstates = 0;
--- linux-2.6.23-rc9.orig/drivers/pci/pcie/aer/aerdrv.c
+++ linux-2.6.23-rc9/drivers/pci/pcie/aer/aerdrv.c
@@ -81,6 +81,13 @@ static struct pcie_port_service_driver a
 	.reset_link	= aer_root_reset,
 };
 
+static int pcie_aer_disable;
+
+void pci_no_aer(void)
+{
+	pcie_aer_disable = 1;	/* has priority over 'forceload' */
+}
+
 /**
  * aer_irq - Root Port's ISR
  * @irq: IRQ assigned to Root Port
@@ -327,6 +334,8 @@ static void aer_error_resume(struct pci_
  **/
 static int __init aer_service_init(void)
 {
+	if (pcie_aer_disable)
+		return -ENXIO;
 	return pcie_port_service_register(&aerdriver);
 }
 

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

* Re: [PATCH] pci: implement "pci=noaer"
  2007-10-05 20:17 [PATCH] pci: implement "pci=noaer" Randy Dunlap
@ 2007-10-15 17:12 ` Linas Vepstas
  0 siblings, 0 replies; 2+ messages in thread
From: Linas Vepstas @ 2007-10-15 17:12 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: lkml, gregkh, akpm, linux-pci



On Fri, Oct 05, 2007 at 01:17:58PM -0700, Randy Dunlap wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> For cases in which CONFIG_PCIEAER=y (such as distro kernels), allow users
> to disable PCIE Advanced Error Reporting by using "pci=noaer" on the
> kernel command line.

Looks reasonable to me. 

(sorry for the belated reply... I also saw this in gregkh's patch
series. Since the email was addressed to me, I figure I should 
at least say "yes I read it". Dunno if "Yes-I-read-it-by:" is 
the same as "Acked by:", if it is, then acked-by me.. )

--linas


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

end of thread, other threads:[~2007-10-15 17:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-05 20:17 [PATCH] pci: implement "pci=noaer" Randy Dunlap
2007-10-15 17:12 ` Linas Vepstas

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