Jesse Keating 7a32965
From 14bdd0d36f5284108468bb73afd50726b07c7a84 Mon Sep 17 00:00:00 2001
Jesse Keating 7a32965
From: Kyle McMartin <kyle@phobos.i.jkkm.org>
Jesse Keating 7a32965
Date: Mon, 29 Mar 2010 23:43:49 -0400
Jesse Keating 7a32965
Subject: linux-2.6-defaults-pci_no_msi
Jesse Keating 7a32965
Jesse Keating 7a32965
---
Jesse Keating 7a32965
 Documentation/kernel-parameters.txt |    3 +++
Jesse Keating 7a32965
 drivers/pci/Kconfig                 |   12 ++++++++++++
Jesse Keating 7a32965
 drivers/pci/msi.c                   |    9 +++++++++
Jesse Keating 7a32965
 drivers/pci/pci.c                   |    2 ++
Jesse Keating 7a32965
 drivers/pci/pci.h                   |    2 ++
Jesse Keating 7a32965
 5 files changed, 28 insertions(+), 0 deletions(-)
Jesse Keating 7a32965
Jesse Keating 7a32965
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
Jesse Keating 7a32965
index e4cbca5..8154a0f 100644
Jesse Keating 7a32965
--- a/Documentation/kernel-parameters.txt
Jesse Keating 7a32965
+++ b/Documentation/kernel-parameters.txt
Jesse Keating 7a32965
@@ -1911,6 +1911,9 @@ and is between 256 and 4096 characters. It is defined in the file
Jesse Keating 7a32965
 		check_enable_amd_mmconf [X86] check for and enable
Jesse Keating 7a32965
 				properly configured MMIO access to PCI
Jesse Keating 7a32965
 				config space on AMD family 10h CPU
Jesse Keating 7a32965
+		msi		[MSI] If the PCI_MSI kernel config parameter is
Jesse Keating 7a32965
+				enabled, this kernel boot option can be used to
Jesse Keating 7a32965
+				enable the use of MSI interrupts system-wide.
Jesse Keating 7a32965
 		nomsi		[MSI] If the PCI_MSI kernel config parameter is
Jesse Keating 7a32965
 				enabled, this kernel boot option can be used to
Jesse Keating 7a32965
 				disable the use of MSI interrupts system-wide.
Jesse Keating 7a32965
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
Jesse Keating 7a32965
index 7858a11..b12fcad 100644
Jesse Keating 7a32965
--- a/drivers/pci/Kconfig
Jesse Keating 7a32965
+++ b/drivers/pci/Kconfig
Jesse Keating 7a32965
@@ -21,6 +21,18 @@ config PCI_MSI
Jesse Keating 7a32965
 
Jesse Keating 7a32965
 	   If you don't know what to do here, say Y.
Jesse Keating 7a32965
 
Jesse Keating 7a32965
+config PCI_MSI_DEFAULT_ON
Jesse Keating 7a32965
+	def_bool y
Jesse Keating 7a32965
+	prompt "Use Message Signaled Interrupts by default"
Jesse Keating 7a32965
+	depends on PCI_MSI
Jesse Keating 7a32965
+	help
Jesse Keating 7a32965
+	  Selecting this option will enable use of PCI MSI where applicable
Jesse Keating 7a32965
+	  by default. Support for MSI can be disabled through the use of the
Jesse Keating 7a32965
+	  pci=nomsi boot flag. Conversely, if this option is not selected,
Jesse Keating 7a32965
+	  support for PCI MSI can be enabled by passing the pci=msi flag.
Jesse Keating 7a32965
+
Jesse Keating 7a32965
+	  If you don't know what to do here, say N.
Jesse Keating 7a32965
+
Jesse Keating 7a32965
 config PCI_DEBUG
Jesse Keating 7a32965
 	bool "PCI Debugging"
Jesse Keating 7a32965
 	depends on PCI && DEBUG_KERNEL
Jesse Keating 7a32965
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
Jesse Keating 7a32965
index f9cf317..6b0539a 100644
Jesse Keating 7a32965
--- a/drivers/pci/msi.c
Jesse Keating 7a32965
+++ b/drivers/pci/msi.c
Jesse Keating 7a32965
@@ -22,7 +22,11 @@
Jesse Keating 7a32965
 #include "pci.h"
Jesse Keating 7a32965
 #include "msi.h"
Jesse Keating 7a32965
 
Jesse Keating 7a32965
+#ifdef CONFIG_PCI_MSI_DEFAULT_ON
Jesse Keating 7a32965
 static int pci_msi_enable = 1;
Jesse Keating 7a32965
+#else
Jesse Keating 7a32965
+static int pci_msi_enable = 0;
Jesse Keating 7a32965
+#endif /*CONFIG_PCI_MSI_DEFAULT_ON*/
Jesse Keating 7a32965
 
Jesse Keating 7a32965
 /* Arch hooks */
Jesse Keating 7a32965
 
Jesse Keating 7a32965
@@ -836,6 +840,11 @@ int pci_msi_enabled(void)
Jesse Keating 7a32965
 }
Jesse Keating 7a32965
 EXPORT_SYMBOL(pci_msi_enabled);
Jesse Keating 7a32965
 
Jesse Keating 7a32965
+void pci_yes_msi(void)
Jesse Keating 7a32965
+{
Jesse Keating 7a32965
+	pci_msi_enable = 1;
Jesse Keating 7a32965
+}
Jesse Keating 7a32965
+
Jesse Keating 7a32965
 void pci_msi_init_pci_dev(struct pci_dev *dev)
Jesse Keating 7a32965
 {
Jesse Keating 7a32965
 	INIT_LIST_HEAD(&dev->msi_list);
Jesse Keating 7a32965
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
Jesse Keating 7a32965
index 1531f3a..3cb332b 100644
Jesse Keating 7a32965
--- a/drivers/pci/pci.c
Jesse Keating 7a32965
+++ b/drivers/pci/pci.c
Jesse Keating 7a32965
@@ -2983,6 +2983,8 @@ static int __init pci_setup(char *str)
Jesse Keating 7a32965
 		if (*str && (str = pcibios_setup(str)) && *str) {
Jesse Keating 7a32965
 			if (!strcmp(str, "nomsi")) {
Jesse Keating 7a32965
 				pci_no_msi();
Jesse Keating 7a32965
+			} else if (!strcmp(str, "msi")) {
Jesse Keating 7a32965
+				pci_yes_msi();
Jesse Keating 7a32965
 			} else if (!strcmp(str, "noaer")) {
Jesse Keating 7a32965
 				pci_no_aer();
Jesse Keating 7a32965
 			} else if (!strcmp(str, "nodomains")) {
Jesse Keating 7a32965
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
Jesse Keating 7a32965
index 4eb10f4..caa051e 100644
Jesse Keating 7a32965
--- a/drivers/pci/pci.h
Jesse Keating 7a32965
+++ b/drivers/pci/pci.h
Jesse Keating 7a32965
@@ -122,9 +122,11 @@ extern unsigned int pci_pm_d3_delay;
Jesse Keating 7a32965
 
Jesse Keating 7a32965
 #ifdef CONFIG_PCI_MSI
Jesse Keating 7a32965
 void pci_no_msi(void);
Jesse Keating 7a32965
+void pci_yes_msi(void);
Jesse Keating 7a32965
 extern void pci_msi_init_pci_dev(struct pci_dev *dev);
Jesse Keating 7a32965
 #else
Jesse Keating 7a32965
 static inline void pci_no_msi(void) { }
Jesse Keating 7a32965
+static inline void pci_yes_msi(void) { }
Jesse Keating 7a32965
 static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { }
Jesse Keating 7a32965
 #endif
Jesse Keating 7a32965
 
Jesse Keating 7a32965
-- 
Jesse Keating 7a32965
1.7.0.1
Jesse Keating 7a32965