public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@suse.de>
To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, kristen.c.accardi@intel.com
Subject: [patch 2/7] PCI: 6700/6702PXH quirk
Date: Tue, 16 Aug 2005 15:15:58 -0700	[thread overview]
Message-ID: <20050816221558.GC28619@kroah.com> (raw)
In-Reply-To: <20050816221527.GA28619@kroah.com>

[-- Attachment #1: pci-quirk-6700.patch --]
[-- Type: text/plain, Size: 4369 bytes --]

From: Kristen Accardi <kristen.c.accardi@intel.com>

On the 6700/6702 PXH part, a MSI may get corrupted if an ACPI hotplug
driver and SHPC driver in MSI mode are used together.  This patch will
prevent MSI from being enabled for the SHPC as part of an early pci
quirk, as well as on any pci device which sets the no_msi bit.  

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/pci/msi.c       |    5 ++++-
 drivers/pci/pci.h       |    2 +-
 drivers/pci/quirks.c    |   21 +++++++++++++++++++++
 include/linux/pci.h     |    3 ++-
 include/linux/pci_ids.h |    5 +++++
 5 files changed, 33 insertions(+), 3 deletions(-)

--- gregkh-2.6.orig/drivers/pci/msi.c	2005-08-16 14:51:31.000000000 -0700
+++ gregkh-2.6/drivers/pci/msi.c	2005-08-16 14:57:12.000000000 -0700
@@ -453,7 +453,7 @@ static void enable_msi_mode(struct pci_d
 	}
 }
 
-static void disable_msi_mode(struct pci_dev *dev, int pos, int type)
+void disable_msi_mode(struct pci_dev *dev, int pos, int type)
 {
 	u16 control;
 
@@ -699,6 +699,9 @@ int pci_enable_msi(struct pci_dev* dev)
 	if (!pci_msi_enable || !dev)
  		return status;
 
+	if (dev->no_msi)
+		return status;
+
 	temp = dev->irq;
 
 	if ((status = msi_init()) < 0)
--- gregkh-2.6.orig/drivers/pci/pci.h	2005-08-16 14:51:31.000000000 -0700
+++ gregkh-2.6/drivers/pci/pci.h	2005-08-16 14:57:12.000000000 -0700
@@ -46,7 +46,7 @@ extern int pci_msi_quirk;
 #else
 #define pci_msi_quirk 0
 #endif
-
+void disable_msi_mode(struct pci_dev *dev, int pos, int type);
 extern int pcie_mch_quirk;
 extern struct device_attribute pci_dev_attrs[];
 extern struct class_device_attribute class_device_attr_cpuaffinity;
--- gregkh-2.6.orig/drivers/pci/quirks.c	2005-08-16 14:55:51.000000000 -0700
+++ gregkh-2.6/drivers/pci/quirks.c	2005-08-16 14:57:12.000000000 -0700
@@ -1291,6 +1291,27 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_E7320_MCH,	quirk_pcie_mch );
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_E7525_MCH,	quirk_pcie_mch );
 
+
+/*
+ * It's possible for the MSI to get corrupted if shpc and acpi
+ * are used together on certain PXH-based systems.
+ */
+static void __devinit quirk_pcie_pxh(struct pci_dev *dev)
+{
+	disable_msi_mode(dev, pci_find_capability(dev, PCI_CAP_ID_MSI),
+					PCI_CAP_ID_MSI);
+	dev->no_msi = 1;
+
+	printk(KERN_WARNING "PCI: PXH quirk detected, "
+		"disabling MSI for SHPC device\n");
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_PXHD_0,	quirk_pcie_pxh);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_PXHD_1,	quirk_pcie_pxh);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_PXH_0,	quirk_pcie_pxh);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_PXH_1,	quirk_pcie_pxh);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_PXHV,	quirk_pcie_pxh);
+
+
 static void __devinit quirk_netmos(struct pci_dev *dev)
 {
 	unsigned int num_parallel = (dev->subsystem_device & 0xf0) >> 4;
--- gregkh-2.6.orig/include/linux/pci.h	2005-08-16 14:55:51.000000000 -0700
+++ gregkh-2.6/include/linux/pci.h	2005-08-16 14:57:37.000000000 -0700
@@ -556,7 +556,8 @@ struct pci_dev {
 	/* keep track of device state */
 	unsigned int	is_enabled:1;	/* pci_enable_device has been called */
 	unsigned int	is_busmaster:1; /* device is busmaster */
-	
+	unsigned int	no_msi:1;	/* device may not use msi */
+
 	u32		saved_config_space[16]; /* config space saved at suspend time */
 	struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */
 	int rom_attr_enabled;		/* has display of the rom attribute been enabled? */
--- gregkh-2.6.orig/include/linux/pci_ids.h	2005-08-16 14:51:31.000000000 -0700
+++ gregkh-2.6/include/linux/pci_ids.h	2005-08-16 14:57:12.000000000 -0700
@@ -2281,6 +2281,11 @@
 #define PCI_VENDOR_ID_INTEL		0x8086
 #define PCI_DEVICE_ID_INTEL_EESSC	0x0008
 #define PCI_DEVICE_ID_INTEL_21145	0x0039
+#define PCI_DEVICE_ID_INTEL_PXHD_0	0x0320
+#define PCI_DEVICE_ID_INTEL_PXHD_1	0x0321
+#define PCI_DEVICE_ID_INTEL_PXH_0	0x0329
+#define PCI_DEVICE_ID_INTEL_PXH_1	0x032A
+#define PCI_DEVICE_ID_INTEL_PXHV	0x032C
 #define PCI_DEVICE_ID_INTEL_82375	0x0482
 #define PCI_DEVICE_ID_INTEL_82424	0x0483
 #define PCI_DEVICE_ID_INTEL_82378	0x0484

--

  parent reply	other threads:[~2005-08-16 22:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20050816220001.699316000@press.kroah.org>
2005-08-16 22:15 ` [patch 0/7] fixes for 2.6.13-rc6 Greg Kroah-Hartman
2005-08-16 22:15   ` [patch 1/7] Driver core: potentially fix use after free in class_device_attr_show Greg Kroah-Hartman
2005-08-16 22:15   ` Greg Kroah-Hartman [this message]
2005-08-16 22:16   ` [patch 3/7] PCI: fix quirk-6700-fix.patch Greg Kroah-Hartman
2005-08-17  0:27     ` Andrew Morton
2005-08-17 18:45       ` Greg KH
2005-08-16 22:16   ` [patch 4/7] PCI Hotplug: new contact info Greg Kroah-Hartman
2005-08-16 22:16   ` [patch 5/7] PCI: update documentation Greg Kroah-Hartman
2005-08-16 22:16   ` [patch 6/7] USB: fix usb wacom tablet driver bug Greg Kroah-Hartman
2005-08-16 22:16   ` [patch 7/7] USB: usbmon: Copyrights and a typo Greg Kroah-Hartman

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=20050816221558.GC28619@kroah.com \
    --to=gregkh@suse.de \
    --cc=akpm@osdl.org \
    --cc=kristen.c.accardi@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --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