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: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 4/8] Stop inheriting bus flags and check root chipset bus flags instead
Date: Sun, 18 Jun 2006 21:08:56 -0400	[thread overview]
Message-ID: <20060619010855.GE29950@myri.com> (raw)
In-Reply-To: <20060619010544.GA29950@myri.com>

[PATCH 4/8] Stop inheriting bus flags and check root chipset bus flags instead

Inheriting bus flags requires to set them during the PCI hierarchy is
scanned, with EARLY or HEADER quirks. But the subordinate bus has not
been set at this point, so the bus flags cannot be set.

Signed-off-by: Brice Goglin <brice@myri.com>
---
 drivers/pci/msi.c   |   13 +++++++++----
 drivers/pci/probe.c |    2 +-
 include/linux/pci.h |    2 +-
 3 files changed, 11 insertions(+), 6 deletions(-)

Index: linux-mm/drivers/pci/probe.c
===================================================================
--- linux-mm.orig/drivers/pci/probe.c	2006-06-17 23:24:50.000000000 -0400
+++ linux-mm/drivers/pci/probe.c	2006-06-17 23:25:41.000000000 -0400
@@ -351,7 +351,7 @@
 	child->parent = parent;
 	child->ops = parent->ops;
 	child->sysdata = parent->sysdata;
-	child->bus_flags = parent->bus_flags;
+	child->bus_flags = 0;
 	child->bridge = get_device(&bridge->dev);
 
 	child->class_dev.class = &pcibus_class;
Index: linux-mm/include/linux/pci.h
===================================================================
--- linux-mm.orig/include/linux/pci.h	2006-06-17 23:24:51.000000000 -0400
+++ linux-mm/include/linux/pci.h	2006-06-17 23:25:41.000000000 -0400
@@ -242,7 +242,7 @@
 	char		name[48];
 
 	unsigned short  bridge_ctl;	/* manage NO_ISA/FBB/et al behaviors */
-	pci_bus_flags_t bus_flags;	/* Inherited by child busses */
+	pci_bus_flags_t bus_flags;
 	struct device		*bridge;
 	struct class_device	class_dev;
 	struct bin_attribute	*legacy_io; /* legacy I/O for this bus */
Index: linux-mm/drivers/pci/msi.c
===================================================================
--- linux-mm.orig/drivers/pci/msi.c	2006-06-17 23:24:50.000000000 -0400
+++ linux-mm/drivers/pci/msi.c	2006-06-17 23:25:41.000000000 -0400
@@ -911,14 +911,19 @@
 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 its bus flags */
+	if (pdev->subordinate->bus_flags & PCI_BUS_FLAGS_NO_MSI)
+		return -1;
 
 	return 0;
 }

  parent reply	other threads:[~2006-06-19  1:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-19  1:05 [PATCH 0/8] Improve MSI detection v2 Brice Goglin
2006-06-19  1:07 ` [PATCH 1/8] Rename PCI_CAP_ID_HT_IRQCONF into PCI_CAP_ID_HT Brice Goglin
2006-06-19  1:08 ` [PATCH 2/8] Factorize common MSI detection code from pci_enable_msi() and msix() Brice Goglin
2006-06-19  1:08 ` [PATCH 3/8] Blacklist PCI-E chipsets depending on Hypertransport MSI capabality Brice Goglin
2006-06-19  1:08 ` Brice Goglin [this message]
2006-06-19  1:09 ` [PATCH 5/8] Whitelist non-PCI-E chipsets that are known to support MSI Brice Goglin
2006-06-19  1:09 ` [PATCH 6/8] Disable MSI by default on non-PCI-E chipset Brice Goglin
2006-06-19  1:09 ` [PATCH 7/8] Drop existing quirks that disable MSI on some non PCI-E chipsets Brice Goglin
2006-06-19  1:10 ` [PATCH 8/8] Drop pci_msi_quirk 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=20060619010855.GE29950@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