public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Brice Goglin <brice@myri.com>
To: linux-pci@atrey.karlin.mff.cuni.cz
Cc: linux-kernel@vger.kernel.org
Subject: [patch 3/7] Check root chipset no_msi flag instead of all parent busses flags
Date: Sun, 02 Jul 2006 20:40:02 -0400	[thread overview]
Message-ID: <20060703004055.835863000@myri.com> (raw)
In-Reply-To: 20060703003959.942374000@myri.com

[-- Attachment #1: 03-use_root_chipset_dev_no_msi_instead_of_pci_bus_flags.patch --]
[-- Type: text/plain, Size: 2378 bytes --]

MSI only requires support in the root chipset, which may not even have
a subordinate bus.
pci_msi_supported() now checks the no_msi flag in the root_chipset pci_dev
struct instead of the PCI_BUS_FLAGS_NO_MSI flag of all its parent busses.
The MSI quirk now sets the no_msi flag accordingly.

Signed-off-by: Brice Goglin <brice@myri.com>
---
 drivers/pci/msi.c    |   15 ++++++++++-----
 drivers/pci/quirks.c |   10 ++++------
 2 files changed, 14 insertions(+), 11 deletions(-)

Index: linux-git/drivers/pci/msi.c
===================================================================
--- linux-git.orig/drivers/pci/msi.c	2006-07-02 20:28:28.000000000 -0400
+++ linux-git/drivers/pci/msi.c	2006-07-02 20:28:58.000000000 -0400
@@ -905,19 +905,24 @@
  * @dev: pointer to the pci_dev data structure of MSI device function
  *
  * MSI must be globally enabled and supported by the device and
- * its parent busses.
+ * its root chipset.
  **/
 static
 int pci_msi_supported(struct pci_dev * dev)
 {
-	struct pci_bus *bus;
+	struct pci_dev *pdev;
 
 	if (!pci_msi_enable || !dev || dev->no_msi)
 		return -1;
 
-	for (bus = dev->bus; bus; bus = bus->parent)
-		if (bus->bus_flags & PCI_BUS_FLAGS_NO_MSI)
-			return -1;
+	/* find root complex for our device */
+	pdev = dev;
+	while (pdev->bus && pdev->bus->self)
+		pdev = pdev->bus->self;
+
+	/* check whether it supports MSI */
+	if (pdev->no_msi)
+		return -1;
 
 	return 0;
 }
Index: linux-git/drivers/pci/quirks.c
===================================================================
--- linux-git.orig/drivers/pci/quirks.c	2006-07-02 20:25:32.000000000 -0400
+++ linux-git/drivers/pci/quirks.c	2006-07-02 20:28:41.000000000 -0400
@@ -1508,12 +1508,10 @@
 /* Disable MSI on chipsets that are known to not support it */
 static void __devinit quirk_disable_msi(struct pci_dev *dev)
 {
-	if (dev->subordinate) {
-		printk(KERN_WARNING "PCI: MSI quirk detected. "
-		       "PCI_BUS_FLAGS_NO_MSI set for %s subordinate bus.\n",
-		       pci_name(dev));
-		dev->subordinate->bus_flags |= PCI_BUS_FLAGS_NO_MSI;
-	}
+	printk(KERN_WARNING "PCI: MSI quirk detected. "
+	       "MSI disabled on chipset %s.\n",
+	       pci_name(dev));
+	dev->no_msi = 1;
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8131_BRIDGE, quirk_disable_msi);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE,


  parent reply	other threads:[~2006-07-03  0:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-03  0:39 [patch 0/7] Improve MSI detection v5 Brice Goglin
2006-07-03  0:40 ` [patch 1/7] Merge existing MSI disabling quirks Brice Goglin
2006-07-03  0:40 ` [patch 2/7] Factorize common MSI detection code from pci_enable_msi() and msix() Brice Goglin
2006-07-03  0:40 ` Brice Goglin [this message]
2006-07-04  7:06   ` [patch 3/7] Check root chipset no_msi flag instead of all parent busses flags Grant Grundler
2006-07-04 23:12     ` Brice Goglin
2006-07-05  3:48       ` Grant Grundler
2006-07-05  4:38         ` Brice Goglin
2006-07-06 15:39           ` Grant Grundler
2006-07-06 15:46             ` Brice Goglin
2006-07-06  0:50   ` Benjamin Herrenschmidt
2006-07-03  0:40 ` [patch 4/7] Rename PCI_CAP_ID_HT_IRQCONF into PCI_CAP_ID_HT Brice Goglin
2006-07-03  0:40 ` [patch 5/7] Blacklist PCI-E chipsets depending on Hypertransport MSI capability Brice Goglin
2006-07-03  0:40 ` [patch 6/7] Drop pci_msi_quirk Brice Goglin
2006-07-03  0:40 ` [patch 7/7] Drop pci bus_flags Brice Goglin

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=20060703004055.835863000@myri.com \
    --to=brice@myri.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    /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