From: Brice Goglin <brice@myri.com>
To: Greg KH <gregkh@suse.de>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: AMD 8131 MSI quirk called too late, bus_flags not inherited ?
Date: Tue, 23 May 2006 03:05:27 -0400 [thread overview]
Message-ID: <20060523070526.GA30499@myri.com> (raw)
In-Reply-To: <20060523041958.GA8415@suse.de>
On Mon, May 22, 2006 at 09:19:58PM -0700, Greg KH wrote:
> On Sun, May 21, 2006 at 03:24:07PM +0200, Brice Goglin wrote:
> >
> > Right, thanks. Greg, what do you think of putting the attached patch in
> > 2.6.17 ?
>
> Ok, does everyone agree that this patch fixes the issues for them? I've
> had a few other private emails saying that the current code doesn't work
> properly and hadn't been able to determine what was happening. Thanks
> for these patches.
>
> > By the way, do we need to check dev->no_msi in pci_enable_msix() too ?
>
> Yes, good catch, care to respin the patch and give it a good changelog
> entry?
Here you are:
The PCI_BUS_FLAGS_NO_MSI bus flags does not appear do be inherited
correctly from the amd8131 MSI quirk to its parent busses. It makes
devices behind a bridge behind amd8131 try to enable MSI while the
amd8131 does not support it.
We fix this by looking at flags of all parent busses in
pci_enable_msi() and pci_enable_msix().
By the way, also add the missing dev->no_msi check in pci_enable_msix()
Signed-off-by: Brice Goglin <brice@myri.com>
Index: linux-mm/drivers/pci/msi.c
===================================================================
--- linux-mm.orig/drivers/pci/msi.c 2006-05-21 15:12:04.000000000 +0200
+++ linux-mm/drivers/pci/msi.c 2006-05-23 08:31:02.000000000 +0200
@@ -916,6 +916,7 @@
**/
int pci_enable_msi(struct pci_dev* dev)
{
+ struct pci_bus *bus;
int pos, temp, status = -EINVAL;
u16 control;
@@ -925,8 +926,9 @@
if (dev->no_msi)
return status;
- if (dev->bus->bus_flags & PCI_BUS_FLAGS_NO_MSI)
- return -EINVAL;
+ for (bus = dev->bus; bus; bus = bus->parent)
+ if (bus->bus_flags & PCI_BUS_FLAGS_NO_MSI)
+ return -EINVAL;
temp = dev->irq;
@@ -1162,6 +1164,7 @@
**/
int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec)
{
+ struct pci_bus *bus;
int status, pos, nr_entries, free_vectors;
int i, j, temp;
u16 control;
@@ -1170,6 +1173,13 @@
if (!pci_msi_enable || !dev || !entries)
return -EINVAL;
+ if (dev->no_msi)
+ return -EINVAL;
+
+ for (bus = dev->bus; bus; bus = bus->parent)
+ if (bus->bus_flags & PCI_BUS_FLAGS_NO_MSI)
+ return -EINVAL;
+
status = msi_init();
if (status < 0)
return status;
next prev parent reply other threads:[~2006-05-23 7:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-15 21:11 AMD 8131 MSI quirk called too late, bus_flags not inherited ? Brice Goglin
2006-05-18 15:54 ` Greg KH
2006-05-21 10:16 ` Michael S. Tsirkin
2006-05-21 10:58 ` Brice Goglin
2006-05-21 12:17 ` Michael S. Tsirkin
2006-05-21 12:31 ` Brice Goglin
2006-05-21 13:10 ` Michael S. Tsirkin
2006-05-21 13:24 ` Brice Goglin
2006-05-23 4:19 ` Greg KH
2006-05-23 7:05 ` Brice Goglin [this message]
2006-05-24 16:59 ` Michael S. Tsirkin
2006-05-24 17:05 ` Rajesh Shah
2006-05-21 13:29 ` Michael S. Tsirkin
[not found] <fa.WOQy7TVxeMkzxI+BbQP2Wqi34A0@ifi.uio.no>
[not found] ` <fa.7RUPmW8q906KfAmuRItEvwbAUvg@ifi.uio.no>
2006-05-21 19:19 ` Dave Olson
[not found] <fa.qrx8XYAhsFvMnCfipnnEkuNPFSA@ifi.uio.no>
[not found] ` <fa.hVNDQ4A/sPeiQKqlsb6JDQFEpLE@ifi.uio.no>
2006-05-23 7:32 ` Dave Olson
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=20060523070526.GA30499@myri.com \
--to=brice@myri.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@mellanox.co.il \
/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