2007-10-18 09:16:12

by Huang, Shane

[permalink] [raw]
Subject: [patch] PCI: disable MSI on more ATI NorthBridges

More ATI North Bridges like RS780 can't do MSI like its predecessors
in linux. Disable MSIs on them.

Signed-off-by: Shane Huang <[email protected]>

Since there is some word wrapping problem with my mail client MS outlook
if I copy the patch into the text, so I'll have to attach the patch as
an attachment. Please check it.


Thanks
Best Regards
Shane


Attachments:
ATI_NBs_MSI_disable.patch (2.79 kB)
ATI_NBs_MSI_disable.patch

2007-10-18 10:19:53

by David Miller

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

From: "Shane Huang" <[email protected]>
Date: Thu, 18 Oct 2007 17:14:36 +0800

> More ATI North Bridges like RS780 can't do MSI like its predecessors
> in linux. Disable MSIs on them.
>
> Signed-off-by: Shane Huang <[email protected]>

Can we get some detail as to why these north bridges have to have MSI
disabled completely? I can't believe that all 6 of these ATI
controllers which will now be listed in the quirk table cannot use MSI
at all.

I've discovered several cases where it was a buggy device or a driver
bug that caused someone to erroneously submit patches that disable MSI
completely for the bridge they were behind.

I don't want that to happen any more. One way to prevent that is to
have a full detailed justification for the MSI disabling in the
changelog or in the comments for the MSI quirk.

Thank you.

2007-10-18 10:38:37

by Huang, Shane

[permalink] [raw]
Subject: RE: [patch] PCI: disable MSI on more ATI NorthBridges

Hi Miller:

Thank you for your response.

The reason why MSIs of these northbridges do not work is still under
further debug, we are NOT able to tell its hardware issue or software
issue at this time. But enablement of them will lead to the OS
installation failure in many distributions like openSUSE, Ubuntu etc:
https://bugzilla.novell.com/show_bug.cgi?id=302016

So we have to disable them firstly before we find out the root cause,
maybe they are just workarounds.

If you guys know much more about this MSI problem, don't hesitate to
tell us, we can debug on some of the hardware platforms.

BTW, There already some disablements to some ATI NB MSIs in the kernel,
the reasons are similar.


Thanks
Shane


> -----Original Message-----
> From: David Miller [mailto:[email protected]]
> Sent: Thursday, October 18, 2007 6:20 PM
> To: Shane Huang
> Cc: [email protected]; [email protected]; [email protected];
[email protected]; Su, Henry; Yang, Libin
> Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges
>
> From: "Shane Huang" <[email protected]>
> Date: Thu, 18 Oct 2007 17:14:36 +0800
>
> > More ATI North Bridges like RS780 can't do MSI like its predecessors
> > in linux. Disable MSIs on them.
> >
> > Signed-off-by: Shane Huang <[email protected]>
>
> Can we get some detail as to why these north bridges have to have MSI
> disabled completely? I can't believe that all 6 of these ATI
> controllers which will now be listed in the quirk table cannot use MSI
> at all.
>
> I've discovered several cases where it was a buggy device or a driver
> bug that caused someone to erroneously submit patches that disable MSI
> completely for the bridge they were behind.
>
> I don't want that to happen any more. One way to prevent that is to
> have a full detailed justification for the MSI disabling in the
> changelog or in the comments for the MSI quirk.
>
> Thank you.
>



2007-10-18 11:46:19

by David Miller

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

From: "Shane Huang" <[email protected]>
Date: Thu, 18 Oct 2007 18:37:59 +0800

> Hi Miller:
>
> Thank you for your response.
>
> The reason why MSIs of these northbridges do not work is still under
> further debug, we are NOT able to tell its hardware issue or software
> issue at this time. But enablement of them will lead to the OS
> installation failure in many distributions like openSUSE, Ubuntu etc:
> https://bugzilla.novell.com/show_bug.cgi?id=302016
>
> So we have to disable them firstly before we find out the root cause,
> maybe they are just workarounds.

This logic seems backwards, to me. "shoot first, ask questions later"
To me this it not how to approach this problem.

Once you turn MSI off, there is next to no incentive to fix the
problem because users aren't running into it any longer.

The only two devices in that bug report which should be using MSI
would be the SATA controller and the broadcom ethernet NIC. And by
the failed bootup logs provided by the user the problem is clearly
with the SATA controller.

One common problem we're finding is that some devices have a hardware
bug where setting INTX_DISABLE in the PCI COMMAND register masks MSI
interrupts too.

I mention this because the user in that report mentions that the
kernel upgrade causes the failure, and one thing we started doing not
too long ago was to set the INTX_DISABLE bit when MSI is enabled for a
device.

So maybe this SATA controller has this problem too. It is easy to
test, simply comment out all of the pci_intx() function calls in
drivers/pci/msi.c and perform a test boot with MSI enabled.

I would rather you approach analysis of these kinds of MSI bugs in
this manner, instead of disabling MSI wholesale. Because with the
latter approach it is nearly guarenteed that the real reason will only
be discovered with an extremely low priority.

Thank you.

2007-10-18 15:25:52

by Greg KH

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

On Thu, Oct 18, 2007 at 04:46:11AM -0700, David Miller wrote:
> From: "Shane Huang" <[email protected]>
> Date: Thu, 18 Oct 2007 18:37:59 +0800
>
> > Hi Miller:
> >
> > Thank you for your response.
> >
> > The reason why MSIs of these northbridges do not work is still under
> > further debug, we are NOT able to tell its hardware issue or software
> > issue at this time. But enablement of them will lead to the OS
> > installation failure in many distributions like openSUSE, Ubuntu etc:
> > https://bugzilla.novell.com/show_bug.cgi?id=302016
> >
> > So we have to disable them firstly before we find out the root cause,
> > maybe they are just workarounds.
>
> This logic seems backwards, to me. "shoot first, ask questions later"
> To me this it not how to approach this problem.
>
> Once you turn MSI off, there is next to no incentive to fix the
> problem because users aren't running into it any longer.

I agree with David here. Please work to find the root cause of this
problem. If it turns out that all of these chipsets have broken MSI and
can't handle it at all (oops, that's a major bug...) then we will accept
this patch.

But for now, let's not take a band-aid that prevents others from working
to solve the real issues here.

thanks,

greg k-h

2007-10-19 13:17:33

by Shane Huang

[permalink] [raw]
Subject: RE: [patch] PCI: disable MSI on more ATI NorthBridges


Hi Guys:

> This logic seems backwards, to me. "shoot first, ask questions later"
> To me this it not how to approach this problem.
>
> Once you turn MSI off, there is next to no incentive to fix the
> problem because users aren't running into it any longer.
>
> The only two devices in that bug report which should be using MSI
> would be the SATA controller and the broadcom ethernet NIC. And by
> the failed bootup logs provided by the user the problem is clearly
> with the SATA controller.
>
> One common problem we're finding is that some devices have a hardware
> bug where setting INTX_DISABLE in the PCI COMMAND register masks MSI
> interrupts too.
>
> I mention this because the user in that report mentions that the
> kernel upgrade causes the failure, and one thing we started doing not
> too long ago was to set the INTX_DISABLE bit when MSI is enabled for a
> device.

Yes, you are right, to find out the root cause is better. Thank you
for all your suggestion and information to us.
Since we have little experience on PCI and MSI here, we had to try to
disable MSI before we find a better solution. But as you are giving
us help now on this case, it's great! Then let's go...

> So maybe this SATA controller has this problem too. It is easy to
> test, simply comment out all of the pci_intx() function calls in
> drivers/pci/msi.c and perform a test boot with MSI enabled.
>
> I would rather you approach analysis of these kinds of MSI bugs in
> this manner, instead of disabling MSI wholesale. Because with the
> latter approach it is nearly guarenteed that the real reason will only
> be discovered with an extremely low priority.

I'm using kernel 2.6.23-rc5 to debug this MSI problem, which can NOT
boot on our Trevally board(RS690+SB700) without any kernel modification.

But if I comment out all the pci_intx() function calls in
drivers/pci/msi.c, it can boot now with MSI enabled as you expected!

# cat /proc/interrupts
CPU0 CPU1
0: 318 174060 IO-APIC-edge timer
8: 0 1 IO-APIC-edge rtc
9: 0 0 IO-APIC-fasteoi acpi
16: 0 204 IO-APIC-fasteoi HDA Intel
17: 0 479 IO-APIC-fasteoi ohci_hcd:usb1, ohci_hcd:usb2, ehci_hcd:usb6
18: 1 2 IO-APIC-fasteoi ohci_hcd:usb3, ohci_hcd:usb4, ohci_hcd:usb5
19: 0 0 IO-APIC-fasteoi ehci_hcd:usb7
22: 4 1 IO-APIC-fasteoi yenta
8412: 0 1315 PCI-MSI-edge eth0
8413: 381 4858 PCI-MSI-edge ahci
NMI: 0 0
LOC: 174285 174210
ERR: 0

Also if I keep the pci_intx() calls in drivers/pci/msi.c and ONLY
comment out the pci_intx() call in drivers/ata/ahci.c
My system can boot up too with MSI enabled!

So does it mean that the root cause is our SB700 SATA controller
has a hardware bug where setting INTX_DISABLE in the PCI COMMAND
register masks MSI interrupts too?
And what is the software solution or workaround?

I will continue debug this MSI problem next week. Any suggestions,
please don't hesitate to tell us.


Thanks
Best Regards

Shane

_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx

2007-10-19 17:48:52

by Daniel Barkalow

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

On Thu, 18 Oct 2007, David Miller wrote:

> From: "Shane Huang" <[email protected]>
> Date: Thu, 18 Oct 2007 18:37:59 +0800
>
> > Hi Miller:
> >
> > Thank you for your response.
> >
> > The reason why MSIs of these northbridges do not work is still under
> > further debug, we are NOT able to tell its hardware issue or software
> > issue at this time. But enablement of them will lead to the OS
> > installation failure in many distributions like openSUSE, Ubuntu etc:
> > https://bugzilla.novell.com/show_bug.cgi?id=302016
> >
> > So we have to disable them firstly before we find out the root cause,
> > maybe they are just workarounds.
>
> This logic seems backwards, to me. "shoot first, ask questions later"
> To me this it not how to approach this problem.
>
> Once you turn MSI off, there is next to no incentive to fix the
> problem because users aren't running into it any longer.
>
> The only two devices in that bug report which should be using MSI
> would be the SATA controller and the broadcom ethernet NIC. And by
> the failed bootup logs provided by the user the problem is clearly
> with the SATA controller.

And the same SATA controller could show up behind a different northbridge.
It would be unfortunate to hit the same device bug independantly on each
system and work around it by doing something that won't help the next
user.

> One common problem we're finding is that some devices have a hardware
> bug where setting INTX_DISABLE in the PCI COMMAND register masks MSI
> interrupts too.
>
> I mention this because the user in that report mentions that the
> kernel upgrade causes the failure, and one thing we started doing not
> too long ago was to set the INTX_DISABLE bit when MSI is enabled for a
> device.
>
> So maybe this SATA controller has this problem too. It is easy to
> test, simply comment out all of the pci_intx() function calls in
> drivers/pci/msi.c and perform a test boot with MSI enabled.

Have we gotten around to having a device quirk for this? I bet it won't be
too long before we see a system where the SATA controller doesn't work
with INTX disabled and the ethernet controller doesn't work with it
enabled, since we've seen devices with each of these bugs.

-Daniel
*This .sig left intentionally blank*

2007-10-19 19:58:38

by linas

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

On Fri, Oct 19, 2007 at 09:17:23PM +0800, Shane Huang wrote:
> Since we have little experience on PCI and MSI here, we had to try to

As someone else pointed out, AMD should have *lots* of people with
pci and msi experience on the payroll. (Folks here buy AMD-designed
pci chips ...)

> ONLY
> comment out the pci_intx() call in drivers/ata/ahci.c
> My system can boot up too with MSI enabled!
>
> So does it mean that the root cause is our SB700 SATA controller
> has a hardware bug where setting INTX_DISABLE in the PCI COMMAND
> register masks MSI interrupts too?

That's what it sounds like, to me.

> And what is the software solution or workaround?

Not sure. Sounds like the device driver needs a quirk for this part.

The over-worked Jeff Garzik is the maintainer for that driver.

You should probably provide the pci device id for this beast.

--linas

2007-10-19 20:21:40

by Jeff Garzik

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

Linas Vepstas wrote:
> On Fri, Oct 19, 2007 at 09:17:23PM +0800, Shane Huang wrote:
>> Since we have little experience on PCI and MSI here, we had to try to
>
> As someone else pointed out, AMD should have *lots* of people with
> pci and msi experience on the payroll. (Folks here buy AMD-designed
> pci chips ...)
>
>> ONLY
>> comment out the pci_intx() call in drivers/ata/ahci.c
>> My system can boot up too with MSI enabled!
>>
>> So does it mean that the root cause is our SB700 SATA controller
>> has a hardware bug where setting INTX_DISABLE in the PCI COMMAND
>> register masks MSI interrupts too?
>
> That's what it sounds like, to me.
>
>> And what is the software solution or workaround?
>
> Not sure. Sounds like the device driver needs a quirk for this part.


Take a look at tg3.c net driver change
2fbe43f6f631dd7ce19fb1499d6164a5bdb34568 which is a similar situation.

However, it may turn out that removing the pci_intx() stuff as a general
rule is easier than quirking these devices, if enough of them turn out
to have this hardware bug.

The tg3.c change should illustrate how to fix immediately, though.

Jeff

2007-10-20 14:50:41

by Shane Huang

[permalink] [raw]
Subject: RE: [patch] PCI: disable MSI on more ATI NorthBridges


Quoting "David G"
> "Here" as in "here at AMD"?! I'm stunned...
> Both AMD and the former ATI should have quite some experience?!

When I used "here", I was just meaning our youthful linux southbridge
drivers team instead of the whole AMD. Sorry for the confusion to you.


Quoting "Linas"
> As someone else pointed out, AMD should have *lots* of people with
> pci and msi experience on the payroll. (Folks here buy AMD-designed
> pci chips ...)

Yes, absolutely AMD has lots of people with PCI and MSI experience,
but this MSI issue is mainly under the debug of our team now.
I think our team will cooperate with other teams more closely to provide
linux chipset support besides fixing the MSI problem in the future.


Quoting "Jeff"
> Take a look at tg3.c net driver change
> 2fbe43f6f631dd7ce19fb1499d6164a5bdb34568 which is a similar
> situation. However, it may turn out that removing the pci_intx()
> stuff as a general rule is easier than quirking these devices, if enough
> of them turn out to have this hardware bug. The tg3.c change should
> illustrate how to fix immediately, though.

Thanks for your suggestion. I will continue to debug this problem next
Monday when I'm back to the office.


Thanks
Best Regards

Shane

_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us

2007-10-21 01:45:51

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges


On Fri, 2007-10-19 at 16:21 -0400, Jeff Garzik wrote:
> Take a look at tg3.c net driver change
> 2fbe43f6f631dd7ce19fb1499d6164a5bdb34568 which is a similar situation.
>
> However, it may turn out that removing the pci_intx() stuff as a
> general
> rule is easier than quirking these devices, if enough of them turn
> out
> to have this hardware bug.

We'd have to count how many have this bug vs. how many will emit both
intx and msi unless pci_intx is cleared, and then how many do that
regardless of pci_intx :-)

yuck

Ben.


2007-10-21 02:29:39

by David Gaarenstroom

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

If the pci_intx change will be applied to the SATA driver, can it be
applied for the ATI USB-HCDs too? See
http://lkml.org/lkml/2006/12/21/47 for more details. That should help
most of the ATI MSI quirks. It helped me (Acer Aspire 502x laptop with
ATI RS480/SB400).


> When I used "here", I was just meaning our youthful linux southbridge
> drivers team instead of the whole AMD. Sorry for the confusion to you.

I am still somewhat confused: most people developing the Linux kernel
are limited to look at this hardware from the outside. They had to
find out by trial and error. I really hope your colleagues will be
more actively helping your team and (other) Linux kernel developers.
But I'm glad AMD has such a team.
(So while you're at it, ask about the ATI USB HCDs and any other MSI quirk too)

2007-10-21 06:00:34

by Shane Huang

[permalink] [raw]
Subject: RE: [patch] PCI: disable MSI on more ATI NorthBridges


Hi David

>> When I used "here", I was just meaning our youthful linux southbridge
>> drivers team instead of the whole AMD. Sorry for the confusion to you.
>
> I am still somewhat confused: most people developing the Linux kernel
> are limited to look at this hardware from the outside. They had to
> find out by trial and error. I really hope your colleagues will be
> more actively helping your team and (other) Linux kernel developers.
> But I'm glad AMD has such a team.

Well... I think the cooperation will become more and more smoothly as
time goes by. In fact, other teams are always helping us.

As to the other problems such as USB-HCD, we need some investigation
before I can send you any response.


Thanks
Best Regards

Shane

_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE

2007-10-22 20:26:43

by Daniel Barkalow

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

On Fri, 19 Oct 2007, Jeff Garzik wrote:

> Linas Vepstas wrote:
> > On Fri, Oct 19, 2007 at 09:17:23PM +0800, Shane Huang wrote:
> > > Since we have little experience on PCI and MSI here, we had to try to
> >
> > As someone else pointed out, AMD should have *lots* of people with
> > pci and msi experience on the payroll. (Folks here buy AMD-designed pci
> > chips ...)
> >
> > > ONLY
> > > comment out the pci_intx() call in drivers/ata/ahci.c
> > > My system can boot up too with MSI enabled!
> > >
> > > So does it mean that the root cause is our SB700 SATA controller
> > > has a hardware bug where setting INTX_DISABLE in the PCI COMMAND
> > > register masks MSI interrupts too?
> >
> > That's what it sounds like, to me.
> >
> > > And what is the software solution or workaround?
> >
> > Not sure. Sounds like the device driver needs a quirk for this part.
>
>
> Take a look at tg3.c net driver change
> 2fbe43f6f631dd7ce19fb1499d6164a5bdb34568 which is a similar situation.
>
> However, it may turn out that removing the pci_intx() stuff as a general rule
> is easier than quirking these devices, if enough of them turn out to have this
> hardware bug.

At a first approximation, ATI/AMD devices don't send any interrupts if
intx is disabled, nVidia devices send legacy interrupts in addition to MSI
ones if intx isn't disabled, and Intel devices actually work correctly. So
we need at least one kind of device quirk for intx and msi. (And doing it
in the drivers doesn't work, since everybody is making things driven by
snd_hda_intel and would like msi, afaict)

-Daniel
*This .sig left intentionally blank*

2007-10-22 20:41:26

by Jeff Garzik

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

Daniel Barkalow wrote:
> On Fri, 19 Oct 2007, Jeff Garzik wrote:
>
>> Linas Vepstas wrote:
>>> On Fri, Oct 19, 2007 at 09:17:23PM +0800, Shane Huang wrote:
>>>> Since we have little experience on PCI and MSI here, we had to try to
>>> As someone else pointed out, AMD should have *lots* of people with
>>> pci and msi experience on the payroll. (Folks here buy AMD-designed pci
>>> chips ...)
>>>
>>>> ONLY
>>>> comment out the pci_intx() call in drivers/ata/ahci.c
>>>> My system can boot up too with MSI enabled!
>>>>
>>>> So does it mean that the root cause is our SB700 SATA controller
>>>> has a hardware bug where setting INTX_DISABLE in the PCI COMMAND
>>>> register masks MSI interrupts too?
>>> That's what it sounds like, to me.
>>>
>>>> And what is the software solution or workaround?
>>> Not sure. Sounds like the device driver needs a quirk for this part.
>>
>> Take a look at tg3.c net driver change
>> 2fbe43f6f631dd7ce19fb1499d6164a5bdb34568 which is a similar situation.
>>
>> However, it may turn out that removing the pci_intx() stuff as a general rule
>> is easier than quirking these devices, if enough of them turn out to have this
>> hardware bug.
>
> At a first approximation, ATI/AMD devices don't send any interrupts if
> intx is disabled, nVidia devices send legacy interrupts in addition to MSI
> ones if intx isn't disabled, and Intel devices actually work correctly. So
> we need at least one kind of device quirk for intx and msi. (And doing it
> in the drivers doesn't work, since everybody is making things driven by
> snd_hda_intel and would like msi, afaict)

Note that INTX_DISABLE is a recent addition to PCI. Older PCI devices
support neither MSI nor INTX-disable, so make sure such devices don't
creep into your sample.

In general it is documented that INTX_DISABLE should apply only to INTx#
so devices that disable MSI based on that bit are out of spec. But
unfortunately that is rather irrelevant, since we see these out-of-spec
devices in the field today.

Jeff



2007-10-22 21:31:19

by Daniel Barkalow

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

On Mon, 22 Oct 2007, Jeff Garzik wrote:

> Daniel Barkalow wrote:
> > On Fri, 19 Oct 2007, Jeff Garzik wrote:
> >
> > > Linas Vepstas wrote:
> > > > On Fri, Oct 19, 2007 at 09:17:23PM +0800, Shane Huang wrote:
> > > > > Since we have little experience on PCI and MSI here, we had to try to
> > > > As someone else pointed out, AMD should have *lots* of people with
> > > > pci and msi experience on the payroll. (Folks here buy AMD-designed pci
> > > > chips ...)
> > > >
> > > > > ONLY
> > > > > comment out the pci_intx() call in drivers/ata/ahci.c
> > > > > My system can boot up too with MSI enabled!
> > > > >
> > > > > So does it mean that the root cause is our SB700 SATA controller
> > > > > has a hardware bug where setting INTX_DISABLE in the PCI COMMAND
> > > > > register masks MSI interrupts too?
> > > > That's what it sounds like, to me.
> > > >
> > > > > And what is the software solution or workaround?
> > > > Not sure. Sounds like the device driver needs a quirk for this part.
> > >
> > > Take a look at tg3.c net driver change
> > > 2fbe43f6f631dd7ce19fb1499d6164a5bdb34568 which is a similar situation.
> > >
> > > However, it may turn out that removing the pci_intx() stuff as a general
> > > rule
> > > is easier than quirking these devices, if enough of them turn out to have
> > > this
> > > hardware bug.
> >
> > At a first approximation, ATI/AMD devices don't send any interrupts if intx
> > is disabled, nVidia devices send legacy interrupts in addition to MSI ones
> > if intx isn't disabled, and Intel devices actually work correctly. So we
> > need at least one kind of device quirk for intx and msi. (And doing it in
> > the drivers doesn't work, since everybody is making things driven by
> > snd_hda_intel and would like msi, afaict)
>
> Note that INTX_DISABLE is a recent addition to PCI. Older PCI devices support
> neither MSI nor INTX-disable, so make sure such devices don't creep into your
> sample.

I have a device that supports MSI and INTX-disable, and, with MSI on (and
delivering interrupts successfully) also sends legacy interrupts (on
the IRQ that is no longer associated with the device) unless INTX is
disabled. Without the intx_disable(), the kernel disables the IRQ
entirely and breaks a random other device in my system.

It's:

00:07.0 Bridge: nVidia Corporation MCP61 Ethernet (rev a2)

I haven't tried MSI with the other devices in the system, but I expect
that this:

00:05.0 Audio device: nVidia Corporation MCP61 High Definition Audio (rev a2)

will have the same issue, and use a multi-vendor driver.

> In general it is documented that INTX_DISABLE should apply only to INTx# so
> devices that disable MSI based on that bit are out of spec. But unfortunately
> that is rather irrelevant, since we see these out-of-spec devices in the field
> today.

It's likewise documented (although maybe arguable in wording) that the
device shouldn't send legacy interrupts if MSI is in use, regardless of
INTX_DISABLE, but this also happens in the field.

I think that the current Linux behavior with respect to INTX_DISABLE is
simply due to which hardware bug was present in the device whose driver
first got Linux support, but one or the other or both needs a quirk, since
there's no behavior that works with everything. And it's still impossible
to tell which bug is more common, since MSI isn't used most of the time,
even if the hardware supports it, so it's pretty arbitrary which way Linux
goes in the non-quirk case.

-Daniel
*This .sig left intentionally blank*

2007-10-22 23:40:32

by Krzysztof Halasa

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

Jeff Garzik <[email protected]> writes:

> Note that INTX_DISABLE is a recent addition to PCI.

It's PCI 2.3.

> Older PCI devices
> support neither MSI nor INTX-disable, so make sure such devices don't
> creep into your sample.

MSI has been introduced by PCI 2.2 (and thus PCI-X 1.0) so there may
be devices with MSI but without INTx-disable bit. I guess I have some
early PCI-X hardware with MSI but I don't know if they have INTx-disable
bit and I can't currently test that.
And it probably doesn't matter.

> In general it is documented that INTX_DISABLE should apply only to
> INTx# so devices that disable MSI based on that bit are out of spec.

The wording is:
10: This bit disables the device from asserting INTx#. A value of 0
enables the assertion of its INTx# signal. A value of 1 disables the
assertion of its INTx# signal. This bit's state after RST# is 0. Refer
to Section 6.8.1.3 for control of MSI.

So strictly speaking it mandates disabling/enabling INTx but says
nothing about other things (e.g. MSI). Some common sense dictates
it shouldn't disable MSI, I guess.

The "MSI Enable" description doesn't leave any doubt:
0: MSI Enable: If 1, the function is permitted to use MSI to request
service and is prohibited from using its INTx# pin [...]

> But unfortunately that is rather irrelevant, since we see these
> out-of-spec devices in the field today.

Right.
--
Krzysztof Halasa

2007-10-22 23:49:13

by Krzysztof Halasa

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

Daniel Barkalow <[email protected]> writes:

> 00:05.0 Audio device: nVidia Corporation MCP61 High Definition Audio (rev a2)
>
> will have the same issue, and use a multi-vendor driver.

I think MCP55 HDA did not have such problem, though I may be wrong
(AFAIR it worked with shared IRQ and with MSI).
--
Krzysztof Halasa

2007-10-22 23:58:18

by David Miller

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

From: Krzysztof Halasa <[email protected]>
Date: Tue, 23 Oct 2007 01:40:18 +0200

> Jeff Garzik <[email protected]> writes:
>
> > In general it is documented that INTX_DISABLE should apply only to
> > INTx# so devices that disable MSI based on that bit are out of spec.
>
> The wording is:
> 10: This bit disables the device from asserting INTx#. A value of 0
> enables the assertion of its INTx# signal. A value of 1 disables the
> assertion of its INTx# signal. This bit's state after RST# is 0. Refer
> to Section 6.8.1.3 for control of MSI.
>
> So strictly speaking it mandates disabling/enabling INTx but says
> nothing about other things (e.g. MSI). Some common sense dictates
> it shouldn't disable MSI, I guess.

Right, and every vendor I've spoken to who had the INTX_DISABLE
bug clearly acknowledged that it was a bug in their RTL design
and that they considered the spec to be clear on this matter
in that INTX_DISABLE should not influence MSI in any way.

> The "MSI Enable" description doesn't leave any doubt:
> 0: MSI Enable: If 1, the function is permitted to use MSI to request
> service and is prohibited from using its INTx# pin [...]

Things get more complicated with PCI-Express because INTx# isn't an
out-of-band "pin", but rather a message sent over the bus :-)

2007-10-23 00:13:17

by David Miller

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

From: Daniel Barkalow <[email protected]>
Date: Mon, 22 Oct 2007 17:31:04 -0400 (EDT)

> It's likewise documented (although maybe arguable in wording) that the
> device shouldn't send legacy interrupts if MSI is in use, regardless of
> INTX_DISABLE, but this also happens in the field.
>
> I think that the current Linux behavior with respect to INTX_DISABLE is
> simply due to which hardware bug was present in the device whose driver
> first got Linux support, but one or the other or both needs a quirk, since
> there's no behavior that works with everything. And it's still impossible
> to tell which bug is more common, since MSI isn't used most of the time,
> even if the hardware supports it, so it's pretty arbitrary which way Linux
> goes in the non-quirk case.

I think this pretty much sums up the situation accurately.

My suggestion is:

1) Leave the pci_intx() twiddling code in drivers/pci/msi.c

2) Add quirks for "INTX_DISABLE turns off MSI too", this sets
a flag in the pci_dev.

3) The pci_intx() calls in drivers/pci/msi.c are skipped if this
flag from #2 is set.

4) Add quirk entries for drivers/net/tg3.c chips and these SATA
devices we are learning about here, as well as any others we
are aware of right now.

5) Remove the pci_intx() workaround code from drivers/net/tg3.c
and elsewhere.

2007-10-23 05:52:56

by Daniel Barkalow

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

On Mon, 22 Oct 2007, David Miller wrote:

> My suggestion is:
>
> 1) Leave the pci_intx() twiddling code in drivers/pci/msi.c
>
> 2) Add quirks for "INTX_DISABLE turns off MSI too", this sets
> a flag in the pci_dev.
>
> 3) The pci_intx() calls in drivers/pci/msi.c are skipped if this
> flag from #2 is set.
>
> 4) Add quirk entries for drivers/net/tg3.c chips and these SATA
> devices we are learning about here, as well as any others we
> are aware of right now.
>
> 5) Remove the pci_intx() workaround code from drivers/net/tg3.c
> and elsewhere.

Seems right to me, and pretty straightforward, except that I don't really
understand the pm-related logic in there to know how that should work and
whether intx will need to be enabled somewhere in addition to not
disabling it in the msi enable code.

-Daniel
*This .sig left intentionally blank*

2007-10-23 09:48:21

by Huang, Shane

[permalink] [raw]
Subject: RE: [patch] PCI: disable MSI on more ATI NorthBridges

Hi David:

> I think this pretty much sums up the situation accurately.
>
> My suggestion is:
>
> 1) Leave the pci_intx() twiddling code in drivers/pci/msi.c
>
> 2) Add quirks for "INTX_DISABLE turns off MSI too", this sets
> a flag in the pci_dev.
>
> 3) The pci_intx() calls in drivers/pci/msi.c are skipped if this
> flag from #2 is set.
>
> 4) Add quirk entries for drivers/net/tg3.c chips and these SATA
> devices we are learning about here, as well as any others we
> are aware of right now.
>
> 5) Remove the pci_intx() workaround code from drivers/net/tg3.c
> and elsewhere.

This quirk seems good to me. Waiting for your final decision....

This SB700 SATA controller MSI/INTx problem has been reported to our
hardware team. I will forward the update information or response to
you when I get any from HW team.


Thanks
Shane



2007-10-23 10:01:49

by Jeff Garzik

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

David Miller wrote:
> My suggestion is:
>
> 1) Leave the pci_intx() twiddling code in drivers/pci/msi.c
>
> 2) Add quirks for "INTX_DISABLE turns off MSI too", this sets
> a flag in the pci_dev.
>
> 3) The pci_intx() calls in drivers/pci/msi.c are skipped if this
> flag from #2 is set.
>
> 4) Add quirk entries for drivers/net/tg3.c chips and these SATA
> devices we are learning about here, as well as any others we
> are aware of right now.
>
> 5) Remove the pci_intx() workaround code from drivers/net/tg3.c
> and elsewhere.


Sounds good to me also.

Jeff


2007-10-23 10:06:14

by David Miller

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

From: Jeff Garzik <[email protected]>
Date: Tue, 23 Oct 2007 06:01:17 -0400

> David Miller wrote:
> > My suggestion is:
...
> Sounds good to me also.

Ok, it seems I've sort-of self-nominated myself to implement
this so I'll try to work on it tomorrow :-)

2007-10-23 10:14:17

by Jeff Garzik

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

Krzysztof Halasa wrote:
> Jeff Garzik <[email protected]> writes:
>
>> Note that INTX_DISABLE is a recent addition to PCI.
>
> It's PCI 2.3.

Yes.


>> Older PCI devices
>> support neither MSI nor INTX-disable, so make sure such devices don't
>> creep into your sample.
>
> MSI has been introduced by PCI 2.2 (and thus PCI-X 1.0) so there may
> be devices with MSI but without INTx-disable bit. I guess I have some
> early PCI-X hardware with MSI but I don't know if they have INTx-disable
> bit and I can't currently test that.
> And it probably doesn't matter.

Time will tell :)


>> In general it is documented that INTX_DISABLE should apply only to
>> INTx# so devices that disable MSI based on that bit are out of spec.
>
> The wording is:
> 10: This bit disables the device from asserting INTx#. A value of 0
> enables the assertion of its INTx# signal. A value of 1 disables the
> assertion of its INTx# signal. This bit's state after RST# is 0. Refer
> to Section 6.8.1.3 for control of MSI.
>
> So strictly speaking it mandates disabling/enabling INTx but says
> nothing about other things (e.g. MSI). Some common sense dictates
> it shouldn't disable MSI, I guess.
>
> The "MSI Enable" description doesn't leave any doubt:
> 0: MSI Enable: If 1, the function is permitted to use MSI to request
> service and is prohibited from using its INTx# pin [...]

Right. I was merely describing the end result, the union of that
language as it applies to the kernel.

Jeff


2007-10-23 10:15:27

by Jeff Garzik

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

Daniel Barkalow wrote:
> I have a device that supports MSI and INTX-disable, and, with MSI on (and
> delivering interrupts successfully) also sends legacy interrupts (on
> the IRQ that is no longer associated with the device) unless INTX is
> disabled. Without the intx_disable(), the kernel disables the IRQ
> entirely and breaks a random other device in my system.


That sort of behavior is an example of why I wrote pci_intx() in the
first place, and employed it by default throughout the ATA drivers
(before it migrated into PCI core).

Jeff


2007-10-23 10:56:33

by Huang, Shane

[permalink] [raw]
Subject: RE: [patch] PCI: disable MSI on more ATI NorthBridges


> If the pci_intx change will be applied to the SATA driver, can it be
> applied for the ATI USB-HCDs too? See
> http://lkml.org/lkml/2006/12/21/47 for more details. That should help
> most of the ATI MSI quirks. It helped me (Acer Aspire 502x laptop with
> ATI RS480/SB400).

I checked the USB MSI problem above(also has reported to our hardware
team),
the cause seems same as our SB700 SATA controller MSI problem.

I also did some small USB MSI debug on our SB700 board with 2.6.23-rc5:
The USB part of the second patch(attached at the end of this mail)
does not work for SB700 USB EHCI/OHCI controllers, no matter INTx is
enabled or disabled before enter MSI. The USB host controllers are
always using IO-APIC, which is different from SB400. I don't know why.

[root@localhost ~]# cat /proc/interrupts
CPU0 CPU1
17: 0 133 IO-APIC-fasteoi ohci_hcd:usb1,
ohci_hcd:usb2, ehci_hcd:usb6
18: 1 2 IO-APIC-fasteoi ohci_hcd:usb3,
ohci_hcd:usb4, ohci_hcd:usb5
19: 0 0 IO-APIC-fasteoi ehci_hcd:usb7

Also I wonder why the USB MSI patch is not added into kernel at last?
Will it lead to other bugs?


Thanks
Best Regards
Shane


======> USB part of the second patch in lkml.org/lkml/2006/12/21/47
diff -uprdN linux/drivers/usb/core/hcd-pci.c
linux/drivers/usb/core/hcd-pci.c
--- linux/drivers/usb/core/hcd-pci.c 2006-12-16 13:34:57.000000000
-0800
+++ linux/drivers/usb/core/hcd-pci.c 2006-12-16 13:57:09.000000000
-0800
@@ -69,6 +69,7 @@ int usb_hcd_pci_probe (struct pci_dev *d

if (pci_enable_device (dev) < 0)
return -ENODEV;
+ pci_enable_msi(dev);
dev->current_state = PCI_D0;
dev->dev.power.power_state = PMSG_ON;

@@ -139,6 +140,7 @@ int usb_hcd_pci_probe (struct pci_dev *d
release_region (hcd->rsrc_start, hcd->rsrc_len);
err2:
usb_put_hcd (hcd);
+ pci_disable_msi (dev);
err1:
pci_disable_device (dev);
dev_err (&dev->dev, "init %s fail, %d\n", pci_name(dev),
retval);
@@ -177,6 +179,7 @@ void usb_hcd_pci_remove (struct pci_dev
release_region (hcd->rsrc_start, hcd->rsrc_len);
}
usb_put_hcd (hcd);
+ pci_disable_msi(dev);
pci_disable_device(dev);
}
EXPORT_SYMBOL (usb_hcd_pci_remove);
@@ -391,6 +394,7 @@ int usb_hcd_pci_resume (struct pci_dev *
"can't re-enable after resume, %d!\n", retval);
return retval;
}
+ pci_enable_msi (dev);
pci_set_master (dev);
pci_restore_state (dev);






2007-10-24 02:41:36

by David Miller

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

From: "Shane Huang" <[email protected]>
Date: Tue, 23 Oct 2007 18:56:03 +0800

> Also I wonder why the USB MSI patch is not added into kernel at last?
> Will it lead to other bugs?

Probably someone just needs to be more vocal and active in pushing it
to the USB subsystem maintainer(s). I've even had trouble getting
even simple bug fixes integrated recently, so perhaps it will take a
few retransmits and some patience to get it included.

Anyways, thanks for bringing it to our attention.

Greg, can you at least devote a few minutes to going over that USB MSI
patch, giving it any obvious things it needs (perhaps some
pci_msi_enable() return value checks, for example, but may not be
needed at all in this case) and then stash it somewhere so it doesn't
get lost in the void?

Thanks.

2007-10-24 02:46:27

by David Miller

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

From: David Miller <[email protected]>
Date: Tue, 23 Oct 2007 03:06:22 -0700 (PDT)

> Ok, it seems I've sort-of self-nominated myself to implement
> this so I'll try to work on it tomorrow :-)

I have a working implementation, fully tested on a machine
with Tigon3 ethernet chips that have the quirk in question.

Patch set coming up next.

2007-10-24 06:55:59

by Greg KH

[permalink] [raw]
Subject: Re: [patch] PCI: disable MSI on more ATI NorthBridges

On Tue, Oct 23, 2007 at 07:41:55PM -0700, David Miller wrote:
> From: "Shane Huang" <[email protected]>
> Date: Tue, 23 Oct 2007 18:56:03 +0800
>
> > Also I wonder why the USB MSI patch is not added into kernel at last?
> > Will it lead to other bugs?
>
> Probably someone just needs to be more vocal and active in pushing it
> to the USB subsystem maintainer(s). I've even had trouble getting
> even simple bug fixes integrated recently, so perhaps it will take a
> few retransmits and some patience to get it included.

Yeah, I appologize for some of our developers, they seem a bit grumpy at
times :(

> Greg, can you at least devote a few minutes to going over that USB MSI
> patch, giving it any obvious things it needs (perhaps some
> pci_msi_enable() return value checks, for example, but may not be
> needed at all in this case) and then stash it somewhere so it doesn't
> get lost in the void?

Can someone forward it to me so that I can see it? I can't seem to
locate it at the moment, was I copied on it?

thanks,

greg k-h

2008-01-24 11:01:38

by Huang, Shane

[permalink] [raw]
Subject: [patch] PCI: disable the MSI of AMD RS690

This patch recover Tejun's commit
4be8f906435a6af241821ab5b94b2b12cb7d57d8
because there is one MSI bug on RS690+SB600 board which will lead to
boot failure. This bug is NOT same as the one in SB700 SATA controller,
quirk_msi_intx_disable_bug does not work to SB600. Disablement the MSI
of RS690 is the workaround.

Signed-off-by: Shane Huang <[email protected]>


Since there is some word wrapping problem with my mail client MS outlook
if I copy the patch into the text, so I'll also attach the patch as an
attachment. Please check it.


diff -ruN old/drivers/pci/quirks.c new/drivers/pci/quirks.c
--- old/drivers/pci/quirks.c 2008-01-07 05:45:38.000000000 +0800
+++ new/drivers/pci/quirks.c 2008-01-22 11:02:00.000000000 +0800
@@ -1623,6 +1623,7 @@
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS,
PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_disable_all_msi);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200,
quirk_disable_all_msi);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480,
quirk_disable_all_msi);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS690,
quirk_disable_all_msi);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351,
quirk_disable_all_msi);

/* Disable MSI on chipsets that are known to not support it */
diff -ruN old/include/linux/pci_ids.h new/include/linux/pci_ids.h
--- old/include/linux/pci_ids.h 2008-01-07 05:45:38.000000000 +0800
+++ new/include/linux/pci_ids.h 2008-01-22 11:01:55.000000000 +0800
@@ -360,6 +360,7 @@
#define PCI_DEVICE_ID_ATI_RS400_166 0x5a32
#define PCI_DEVICE_ID_ATI_RS400_200 0x5a33
#define PCI_DEVICE_ID_ATI_RS480 0x5950
+#define PCI_DEVICE_ID_ATI_RS690 0x7910
/* ATI IXP Chipset */
#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349
#define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353



Thanks
Best Regards
Shane


Attachments:
disable_RS690_MSI.patch (1.26 kB)
disable_RS690_MSI.patch

2008-01-24 11:15:25

by Huang, Shane

[permalink] [raw]
Subject: [patch] PCI: modify SB700 SATA MSI quirk

SB700 SATA MSI bug will be fixed in SB700 revision A21 at hardware
level,
but the SB700 revision older than A21 will also be found in the market.
This patch modify the original quirk commit
bc38b411fe696fad32b261f492cb4afbf1835256 instead of withdrawing it.


Signed-off-by: Shane Huang <[email protected]>


Since there is some word wrapping problem with my mail client MS
outlook, I also attach the patch as an attachment. Please check it.



diff -ruN old/drivers/pci/quirks.c new/drivers/pci/quirks.c
--- old/drivers/pci/quirks.c 2008-01-07 05:45:38.000000000 +0800
+++ new/drivers/pci/quirks.c 2008-01-22 11:31:09.000000000 +0800
@@ -1709,6 +1709,22 @@
{
dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG;
}
+static void __devinit quirk_msi_intx_disable_ati_bug(struct pci_dev
*dev)
+{
+ struct pci_dev *p;
+ u8 rev = 0;
+
+ /* SB700 MSI issue will be fixed at HW level from revision A21,
+ * we need check PCI REVISION ID of SMBus controller to get
SB700 revision.
+ */
+ p = pci_get_device(PCI_VENDOR_ID_ATI,
PCI_DEVICE_ID_ATI_SBX00_SMBUS, NULL);
+ if (p!=NULL) {
+ pci_read_config_byte(p, PCI_CLASS_REVISION, &rev);
+ }
+ if ((rev < 0x3B) && (rev >= 0x30)) {
+ dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG;
+ }
+}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
PCI_DEVICE_ID_TIGON3_5780,
quirk_msi_intx_disable_bug);
@@ -1729,17 +1745,17 @@
quirk_msi_intx_disable_bug);

DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4390,
- quirk_msi_intx_disable_bug);
+ quirk_msi_intx_disable_ati_bug);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4391,
- quirk_msi_intx_disable_bug);
+ quirk_msi_intx_disable_ati_bug);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4392,
- quirk_msi_intx_disable_bug);
+ quirk_msi_intx_disable_ati_bug);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4393,
- quirk_msi_intx_disable_bug);
+ quirk_msi_intx_disable_ati_bug);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4394,
- quirk_msi_intx_disable_bug);
+ quirk_msi_intx_disable_ati_bug);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4395,
- quirk_msi_intx_disable_bug);
+ quirk_msi_intx_disable_ati_bug);

DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4373,
quirk_msi_intx_disable_bug);


Thanks
Best Regards
Shane


Attachments:
modify_SB700_MSI_issue.patch (1.75 kB)
modify_SB700_MSI_issue.patch

2008-01-24 11:15:47

by Brice Goglin

[permalink] [raw]
Subject: Re: [patch] PCI: disable the MSI of AMD RS690

Shane Huang wrote:
> This patch recover Tejun's commit
> 4be8f906435a6af241821ab5b94b2b12cb7d57d8
> because there is one MSI bug on RS690+SB600 board which will lead to
> boot failure. This bug is NOT same as the one in SB700 SATA controller,
> quirk_msi_intx_disable_bug does not work to SB600. Disablement the MSI
> of RS690 is the workaround.
>
> diff -ruN old/drivers/pci/quirks.c new/drivers/pci/quirks.c
> --- old/drivers/pci/quirks.c 2008-01-07 05:45:38.000000000 +0800
> +++ new/drivers/pci/quirks.c 2008-01-22 11:02:00.000000000 +0800
> @@ -1623,6 +1623,7 @@
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS,
> PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_disable_all_msi);
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200,
> quirk_disable_all_msi);
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480,
> quirk_disable_all_msi);
> +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS690,
> quirk_disable_all_msi);

This patch disable MSI for the _whole_ system, not only behind the
RS690. Is this on purpose? Is MSI really going to be broken on any
bus that's _not_ behind RS690. If not, you might want to use
quirk_disable_msi() instead (as we do for AMD8131).

Brice

2008-01-25 00:19:43

by Tejun Heo

[permalink] [raw]
Subject: Re: [patch] PCI: modify SB700 SATA MSI quirk

Shane Huang wrote:
> SB700 SATA MSI bug will be fixed in SB700 revision A21 at hardware
> level,
> but the SB700 revision older than A21 will also be found in the market.
> This patch modify the original quirk commit
> bc38b411fe696fad32b261f492cb4afbf1835256 instead of withdrawing it.
>
>
> Signed-off-by: Shane Huang <[email protected]>
>
>
> Since there is some word wrapping problem with my mail client MS
> outlook, I also attach the patch as an attachment. Please check it.

Can you please get a decent email client? Thunderbird + toggle word
wrap + external editor combination works fine.

> diff -ruN old/drivers/pci/quirks.c new/drivers/pci/quirks.c
> --- old/drivers/pci/quirks.c 2008-01-07 05:45:38.000000000 +0800
> +++ new/drivers/pci/quirks.c 2008-01-22 11:31:09.000000000 +0800
> @@ -1709,6 +1709,22 @@
> {
> dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG;
> }
> +static void __devinit quirk_msi_intx_disable_ati_bug(struct pci_dev
> *dev)
> +{
> + struct pci_dev *p;
> + u8 rev = 0;
> +
> + /* SB700 MSI issue will be fixed at HW level from revision A21,
> + * we need check PCI REVISION ID of SMBus controller to get
> SB700 revision.
> + */
> + p = pci_get_device(PCI_VENDOR_ID_ATI,
> PCI_DEVICE_ID_ATI_SBX00_SMBUS, NULL);

It would be nice if things stay under 80col limit although we don't
follow that too well in quirks.c.

> + if (p!=NULL) {

We usually write 'if (p)' and don't use unless necessary.

> + pci_read_config_byte(p, PCI_CLASS_REVISION, &rev);
> + }
> + if ((rev < 0x3B) && (rev >= 0x30)) {
> + dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG;
> + }
> +}
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
> PCI_DEVICE_ID_TIGON3_5780,
> quirk_msi_intx_disable_bug);
> @@ -1729,17 +1745,17 @@
> quirk_msi_intx_disable_bug);
>
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4390,
> - quirk_msi_intx_disable_bug);
> + quirk_msi_intx_disable_ati_bug);
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4391,
> - quirk_msi_intx_disable_bug);
> + quirk_msi_intx_disable_ati_bug);
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4392,
> - quirk_msi_intx_disable_bug);
> + quirk_msi_intx_disable_ati_bug);
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4393,
> - quirk_msi_intx_disable_bug);
> + quirk_msi_intx_disable_ati_bug);
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4394,
> - quirk_msi_intx_disable_bug);
> + quirk_msi_intx_disable_ati_bug);
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4395,
> - quirk_msi_intx_disable_bug);
> + quirk_msi_intx_disable_ati_bug);

--
tejun

2008-01-25 03:27:50

by Huang, Shane

[permalink] [raw]
Subject: RE: [patch] PCI: modify SB700 SATA MSI quirk

I did some modification to this patch and send it again, Please check
it.
The quirk to 0x4395 has been removed because 0x4395 only belongs to
SB800.


Thanks
Shane


> -----Original Message-----
> From: Shane Huang
>
> SB700 SATA MSI bug will be fixed in SB700 revision A21 at
> hardware level,
> but the SB700 revision older than A21 will also be found in
> the market.
> This patch modify the original quirk commit
> bc38b411fe696fad32b261f492cb4afbf1835256 instead of withdrawing it.
>
>
> Signed-off-by: Shane Huang <[email protected]>


diff -ruN linux-2.6.24-rc7_org/drivers/pci/quirks.c
linux-2.6.24-rc7_new/drivers/pci/quirks.c
--- linux-2.6.24-rc7_org/drivers/pci/quirks.c 2008-01-23
14:44:53.000000000 +0800
+++ linux-2.6.24-rc7_new/drivers/pci/quirks.c 2008-01-25
10:55:21.000000000 +0800
@@ -1709,6 +1709,24 @@
{
dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG;
}
+static void __devinit quirk_msi_intx_disable_ati_bug(struct pci_dev
*dev)
+{
+ struct pci_dev *p;
+ u8 rev = 0;
+
+ /* SB700 MSI issue will be fixed at HW level from revision A21,
+ * we need check PCI REVISION ID of SMBus controller to get
SB700
+ * revision.
+ */
+ p = pci_get_device(PCI_VENDOR_ID_ATI,
PCI_DEVICE_ID_ATI_SBX00_SMBUS,
+ NULL);
+ if (p) {
+ pci_read_config_byte(p, PCI_CLASS_REVISION, &rev);
+ }
+ if ((rev < 0x3B) && (rev >= 0x30)) {
+ dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG;
+ }
+}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
PCI_DEVICE_ID_TIGON3_5780,
quirk_msi_intx_disable_bug);
@@ -1729,17 +1747,15 @@
quirk_msi_intx_disable_bug);

DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4390,
- quirk_msi_intx_disable_bug);
+ quirk_msi_intx_disable_ati_bug);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4391,
- quirk_msi_intx_disable_bug);
+ quirk_msi_intx_disable_ati_bug);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4392,
- quirk_msi_intx_disable_bug);
+ quirk_msi_intx_disable_ati_bug);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4393,
- quirk_msi_intx_disable_bug);
+ quirk_msi_intx_disable_ati_bug);
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4394,
- quirk_msi_intx_disable_bug);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4395,
- quirk_msi_intx_disable_bug);
+ quirk_msi_intx_disable_ati_bug);

DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4373,
quirk_msi_intx_disable_bug);


Attachments:
modify_SB700_MSI_2.patch (1.78 kB)
modify_SB700_MSI_2.patch

2008-01-25 03:36:17

by Tejun Heo

[permalink] [raw]
Subject: Re: [patch] PCI: modify SB700 SATA MSI quirk

Shane Huang wrote:
> I did some modification to this patch and send it again, Please check
> it.
> The quirk to 0x4395 has been removed because 0x4395 only belongs to
> SB800.
>
>> SB700 SATA MSI bug will be fixed in SB700 revision A21 at
>> hardware level,
>> but the SB700 revision older than A21 will also be found in
>> the market.
>> This patch modify the original quirk commit
>> bc38b411fe696fad32b261f492cb4afbf1835256 instead of withdrawing it.

You need to merge the above two messages into one patch description.

>> Signed-off-by: Shane Huang <[email protected]>

After S-O-B, you can put --- and between it and the patch body, you can
say things which you wanna mention but don't think should be included in
commit message.

> +static void __devinit quirk_msi_intx_disable_ati_bug(struct pci_dev
> *dev)
> +{
> + struct pci_dev *p;
> + u8 rev = 0;
> +
> + /* SB700 MSI issue will be fixed at HW level from revision A21,
> + * we need check PCI REVISION ID of SMBus controller to get
> SB700
> + * revision.
> + */
> + p = pci_get_device(PCI_VENDOR_ID_ATI,
> PCI_DEVICE_ID_ATI_SBX00_SMBUS,
> + NULL);
> + if (p) {
> + pci_read_config_byte(p, PCI_CLASS_REVISION, &rev);

Please drop unnecessary braces and you can you p->revision.

> + }
> + if ((rev < 0x3B) && (rev >= 0x30)) {
> + dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG;
> + }

Hmm... So, if there's no SMBUS device the quirk applies. Is this
intended? If that can't happen, just do if (!p) return;

Also, pci_get_device() requires matching pci_dev_put().

> +}
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_BROADCOM,
> PCI_DEVICE_ID_TIGON3_5780,
> quirk_msi_intx_disable_bug);
> @@ -1729,17 +1747,15 @@
> quirk_msi_intx_disable_bug);
>
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4390,
> - quirk_msi_intx_disable_bug);
> + quirk_msi_intx_disable_ati_bug);
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4391,
> - quirk_msi_intx_disable_bug);
> + quirk_msi_intx_disable_ati_bug);
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4392,
> - quirk_msi_intx_disable_bug);
> + quirk_msi_intx_disable_ati_bug);
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4393,
> - quirk_msi_intx_disable_bug);
> + quirk_msi_intx_disable_ati_bug);
> DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4394,
> - quirk_msi_intx_disable_bug);
> -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x4395,
> - quirk_msi_intx_disable_bug);
> + quirk_msi_intx_disable_ati_bug);

You tested this, right?

--
tejun

2008-01-25 03:52:18

by Huang, Shane

[permalink] [raw]
Subject: RE: [patch] PCI: modify SB700 SATA MSI quirk

Hi Tejun:


> You need to merge the above two messages into one patch description.
>
> After S-O-B, you can put --- and between it and the patch
> body, you can say things which you wanna mention but don't
> think should be included in commit message.

OK, I'll have to submit another update patch later.




Thanks
Shane

2008-01-25 04:31:14

by Greg KH

[permalink] [raw]
Subject: Re: [patch] PCI: modify SB700 SATA MSI quirk

On Fri, Jan 25, 2008 at 11:48:29AM +0800, Shane Huang wrote:
> Hi Tejun:
>
>
> > You need to merge the above two messages into one patch description.
> >
> > After S-O-B, you can put --- and between it and the patch
> > body, you can say things which you wanna mention but don't
> > think should be included in commit message.
>
> OK, I'll have to submit another update patch later.

I recommend running the scripts/checkpatch.pl script on any proposed
patches like this before you send them. It will find a lot of these
problems for you :)

thanks,

greg k-h

2008-01-25 10:40:31

by Huang, Shane

[permalink] [raw]
Subject: RE: [patch] PCI: disable the MSI of AMD RS690

Hi Brice:


> > +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS690,
> > quirk_disable_all_msi);
>
> This patch disable MSI for the _whole_ system, not only behind the
> RS690. Is this on purpose? Is MSI really going to be broken on any
> bus that's _not_ behind RS690. If not, you might want to use
> quirk_disable_msi() instead (as we do for AMD8131).


quirk_disable_msi() can not fix the issue in my debug,
quirk_msi_intx_disable_bug() which can fix SB700 SATA MSI bug does not
work either.
quirk_disable_all_msi is the only workaround I found.

If there is any other guy who also has one SB600+RS690 board, and can
help
to verify this RS690 MSI disablement patch with a new kernel version
such as
2.6.24-rc7, that's great.


BTW:
RS690 MSI disablement should NOT affect SB700 MSI, because as I know,
there will not be the combination of RS690+SB700 on the market.


Thanks
Shane