mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Andi Kleen <ak@suse.de>
Cc: len.brown@intel.com, Linus Torvalds <torvalds@osdl.org>,
	jeff@garzik.org, linux-kernel@vger.kernel.org, tiwai@suse.de
Subject: Re: [PATCH v2] ACPI: use MSI_NOT_SUPPORTED bit
Date: Wed, 15 Nov 2006 11:41:55 -0800	[thread overview]
Message-ID: <20061115114155.3a94d48c.randy.dunlap@oracle.com> (raw)
In-Reply-To: <200611151944.12415.ak@suse.de>

On Wed, 15 Nov 2006 19:44:12 +0100 Andi Kleen wrote:

> On Wednesday 15 November 2006 19:35, Randy Dunlap wrote:
> > On 15 Nov 2006 05:49:41 +0100 Andi Kleen wrote:
> > 
> > > BTW there seems to be a new ACPI FADT bit that says "MSI is broken"
> > > We should probably check that too as a double check.
> > 
> > Do you mean more than just use that bit when you say "double check"?
> > 
> > I wonder why this hasn't already been done. (?)
> 
> Nobody coded it yet.
> 
> > How's this look?  Build-tested only.
> 
> There should be probably a command line option to overwrite it

OK, anything else?

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

- Implement use of FADT boot_flags.MSI_NOT_SUPPORTED bit to prevent
  assigning MSIs.
- Force MSI_NOT_SUPPORTED for ACPI 1.0 tables.
- Add "pci=allowmsi" to override (ignore) the MSI_NOT_SUPPORTED bit
  from the APCI FADT.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 Documentation/kernel-parameters.txt |    6 ++++++
 drivers/acpi/bus.c                  |    7 +++++++
 drivers/acpi/tables/tbconvrt.c      |    3 ++-
 drivers/pci/pci.c                   |    4 ++++
 include/acpi/actbl.h                |    4 +++-
 include/linux/pci.h                 |    3 +++
 6 files changed, 25 insertions(+), 2 deletions(-)

--- linux-2619-rc5.orig/include/acpi/actbl.h
+++ linux-2619-rc5/include/acpi/actbl.h
@@ -290,7 +290,7 @@ struct fadt_descriptor_rev1 {
 	ACPI_FADT_COMMON u32 flags;
 };
 
-/* FADT: Prefered Power Management Profiles */
+/* FADT: Preferred Power Management Profiles */
 
 #define PM_UNSPECIFIED                  0
 #define PM_DESKTOP                      1
@@ -304,6 +304,8 @@ struct fadt_descriptor_rev1 {
 
 #define BAF_LEGACY_DEVICES              0x0001
 #define BAF_8042_KEYBOARD_CONTROLLER    0x0002
+#define BAF_VGA_NOT_PRESENT		0x0004
+#define BAF_MSI_NOT_SUPPORTED		0x0008
 
 #define FADT2_REVISION_ID               3
 #define FADT2_MINUS_REVISION_ID         2
--- linux-2619-rc5.orig/drivers/acpi/tables/tbconvrt.c
+++ linux-2619-rc5/drivers/acpi/tables/tbconvrt.c
@@ -289,7 +289,8 @@ acpi_tb_convert_fadt1(struct fadt_descri
 		 * Since there isn't any equivalence in 1.0 and since it is highly
 		 * likely that a 1.0 system has legacy support.
 		 */
-		local_fadt->iapc_boot_arch = BAF_LEGACY_DEVICES;
+		local_fadt->iapc_boot_arch = BAF_LEGACY_DEVICES |
+						BAF_MSI_NOT_SUPPORTED;
 	}
 
 	/*
--- linux-2619-rc5.orig/include/linux/pci.h
+++ linux-2619-rc5/include/linux/pci.h
@@ -610,6 +610,7 @@ static inline int pci_enable_msix(struct
 	struct msix_entry *entries, int nvec) {return -1;}
 static inline void pci_disable_msix(struct pci_dev *dev) {}
 static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) {}
+static inline void pci_no_msi(void) {}
 #else
 extern void pci_scan_msi_device(struct pci_dev *dev);
 extern int pci_enable_msi(struct pci_dev *dev);
@@ -618,6 +619,8 @@ extern int pci_enable_msix(struct pci_de
 	struct msix_entry *entries, int nvec);
 extern void pci_disable_msix(struct pci_dev *dev);
 extern void msi_remove_pci_irq_vectors(struct pci_dev *dev);
+extern void pci_no_msi(void);
+extern int pci_allow_msi;
 #endif
 
 #ifdef CONFIG_HT_IRQ
--- linux-2619-rc5.orig/drivers/acpi/bus.c
+++ linux-2619-rc5/drivers/acpi/bus.c
@@ -28,6 +28,7 @@
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/sched.h>
+#include <linux/pci.h>
 #include <linux/pm.h>
 #include <linux/pm_legacy.h>
 #include <linux/device.h>
@@ -637,6 +638,12 @@ void __init acpi_early_init(void)
 	}
 #endif
 
+	if (!pci_allow_msi &&
+	   (acpi_fadt.iapc_boot_arch & BAF_MSI_NOT_SUPPORTED)) {
+		printk(KERN_DEBUG PREFIX "MSI not supported, disabling it\n");
+		pci_no_msi();
+	}
+
 	status =
 	    acpi_enable_subsystem(~
 				  (ACPI_NO_HARDWARE_INIT |
--- linux-2619-rc5.orig/Documentation/kernel-parameters.txt
+++ linux-2619-rc5/Documentation/kernel-parameters.txt
@@ -1178,6 +1178,12 @@ and is between 256 and 4096 characters. 
 		nomsi		[MSI] If the PCI_MSI kernel config parameter is
 				enabled, this kernel boot option can be used to
 				disable the use of MSI interrupts system-wide.
+		allowmsi	[MSI,ACPI] If ACPI FADT says that MSI is not
+				supported on this platform but the user wants
+				to use it anyway, this option tells the kernel
+				to ignore the ACPI FADT MSI flag and allow MSI
+				to be used if there are devices that want to
+				use it.
 		nosort		[IA-32] Don't sort PCI devices according to
 				order given by the PCI BIOS. This sorting is
 				done to get a device order compatible with
--- linux-2619-rc5.orig/drivers/pci/pci.c
+++ linux-2619-rc5/drivers/pci/pci.c
@@ -20,6 +20,8 @@
 #include "pci.h"
 
 unsigned int pci_pm_d3_delay = 10;
+int pci_allow_msi; /* when set, this overrides the ACPI FADT boot_arch
+		    * MSI_NOT_SUPPORTED bit so that MSI can still be used */
 
 /**
  * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children
@@ -998,6 +1000,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, "allowmsi"))
+				pci_allow_msi = 1;
 			} else {
 				printk(KERN_ERR "PCI: Unknown option `%s'\n",
 						str);

  reply	other threads:[~2006-11-15 19:46 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200611150059.kAF0xBTl009796@hera.kernel.org>
2006-11-15  1:34 ` [PATCH] ALSA: hda-intel - Disable MSI support by default Jeff Garzik
2006-11-15  1:55   ` Linus Torvalds
2006-11-15  2:40     ` Jeff Garzik
2006-11-15  2:49       ` Linus Torvalds
2006-11-15  3:00         ` David Miller
2006-11-15  3:10           ` Linus Torvalds
2006-11-15  3:21             ` David Miller
2006-11-15  3:54               ` Linus Torvalds
2006-11-15  4:11                 ` Jeff Garzik
2006-11-15  4:15                   ` David Miller
2006-11-15  4:24                     ` Jeff Garzik
2006-11-15  4:28                       ` David Miller
2006-11-16  2:25                         ` Benjamin Herrenschmidt
2006-11-16  2:28                           ` Benjamin Herrenschmidt
2006-11-16  3:25                           ` Jeff Garzik
2006-11-16  4:12                             ` Benjamin Herrenschmidt
2006-11-16  6:13                               ` Jeff Garzik
2006-11-16 14:41                                 ` Krzysztof Halasa
2006-11-16 15:27                                   ` Jeff Garzik
2006-11-16 17:24                                     ` Roland Dreier
2006-11-15 19:09                       ` Stephen Hemminger
2006-11-15 19:23                         ` Jeff Garzik
2006-11-15 19:49                           ` Stephen Hemminger
2006-11-15 22:31                             ` Roland Dreier
2006-11-16  2:24                     ` Benjamin Herrenschmidt
2006-11-15  4:30                   ` Roland Dreier
2006-11-15  4:56                     ` Jeff Garzik
2006-11-15 15:53                     ` Linus Torvalds
2006-11-15 18:30                       ` Jeff Garzik
2006-11-15 18:45                       ` Roland Dreier
2006-11-16  2:29                     ` Benjamin Herrenschmidt
2006-11-15 13:34                   ` Krzysztof Halasa
2006-11-15 18:42                     ` Jeff Garzik
2006-11-15 19:04                       ` Linus Torvalds
2006-11-15 19:20                         ` Jeff Garzik
2006-11-15 19:35                           ` Linus Torvalds
2006-11-15 19:59                             ` Mws
2006-11-15 20:14                               ` Linus Torvalds
2006-11-15 20:53                                 ` Olivier Nicolas
2006-11-16  6:08                                   ` Yinghai Lu
2006-11-16 23:25                                     ` Olivier Nicolas
2006-11-15 21:10                                 ` Mws
2006-11-16 11:10                                   ` Mws
2006-11-15  4:14                 ` Roland Dreier
2006-11-15  4:49                 ` Andi Kleen
2006-11-15  4:57                   ` Roland Dreier
2006-11-15  5:11                     ` Andi Kleen
2006-11-15 22:43                       ` Roland Dreier
2006-11-15 18:35                   ` [PATCH] ACPI: use MSI_NOT_SUPPORTED bit Randy Dunlap
2006-11-15 18:44                     ` Andi Kleen
2006-11-15 19:41                       ` Randy Dunlap [this message]
2006-11-15 19:58                         ` [PATCH v3] " Randy Dunlap
2006-11-15 20:19                     ` [PATCH] " Len Brown
2006-11-16  2:22                 ` [PATCH] ALSA: hda-intel - Disable MSI support by default Benjamin Herrenschmidt
2006-11-15 10:31               ` Takashi Iwai
2006-11-15 16:19                 ` Linus Torvalds
2006-11-15 16:24                   ` Arjan van de Ven
2006-11-15 16:36                     ` Linus Torvalds
2006-11-15 18:40                       ` Jeff Garzik
2006-11-15 18:51                         ` Linus Torvalds
2006-11-15 19:01                           ` Arjan van de Ven
2006-11-15 19:34                       ` Stephen Clark
2006-11-15 19:48                         ` Jeff Garzik
2006-11-15 20:01                           ` Stephen Clark
2006-11-15 18:32                 ` Jeff Garzik
2006-11-15 18:32                   ` Jeff Garzik
2006-11-15 18:58                   ` Takashi Iwai
2006-11-15 19:15                     ` Jeff Garzik
2006-11-16 10:44                       ` Takashi Iwai
2006-11-16 23:01                         ` Olivier Nicolas
2006-11-17 10:55                           ` Takashi Iwai
2006-11-17 16:17                             ` Yinghai Lu
2006-11-17 16:35                               ` Linus Torvalds
2006-11-15 19:20                 ` Stephen Hemminger
2006-11-15 22:35                   ` Roland Dreier
2006-11-15  4:01           ` Benjamin Herrenschmidt
2006-11-15  4:07             ` David Miller
2006-11-15  7:23               ` Benjamin Herrenschmidt
2006-11-15 10:06                 ` Segher Boessenkool
2006-11-15  4:23             ` Roland Dreier
2006-11-15  7:24               ` Benjamin Herrenschmidt
2006-11-15  4:04         ` Benjamin Herrenschmidt
2006-11-15  4:14           ` Jeff Garzik
2006-11-15  4:24           ` Roland Dreier
2006-11-15  2:58       ` Randy Dunlap
2006-11-15  3:10       ` D. Hazelton
2006-11-15  3:30         ` Jeff Garzik
2006-11-15  3:53           ` D. Hazelton
2006-11-15 11:40             ` Alan
2006-11-16  4:06               ` D. Hazelton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061115114155.3a94d48c.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=ak@suse.de \
    --cc=jeff@garzik.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.de \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome