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

2007-10-23 Thread Greg KH
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-23 Thread David Miller
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-23 Thread David Miller
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-23 Thread Shane Huang

> 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.

[EMAIL PROTECTED] ~]# cat /proc/interrupts 
   CPU0   CPU1  
17:  0133   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.c2006-12-16 13:34:57.0
-0800
+++ linux/drivers/usb/core/hcd-pci.c2006-12-16 13:57:09.0
-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);






-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-23 Thread Jeff Garzik

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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-23 Thread Jeff Garzik

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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-23 Thread David Miller
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 :-)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-23 Thread Jeff Garzik

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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-23 Thread Shane Huang
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



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-22 Thread Daniel Barkalow
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*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-22 Thread David Miller
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-22 Thread David Miller
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 :-)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-22 Thread Krzysztof Halasa
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-22 Thread Krzysztof Halasa
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-22 Thread Daniel Barkalow
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*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-22 Thread Jeff Garzik

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



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-22 Thread Daniel Barkalow
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*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-20 Thread Shane Huang

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-20 Thread David Gaarenstroom
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)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-20 Thread Benjamin Herrenschmidt

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.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-20 Thread Shane Huang

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-19 Thread Jeff Garzik

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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-19 Thread Linas Vepstas
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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-19 Thread Daniel Barkalow
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*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Fwd: [patch] PCI: disable MSI on more ATI NorthBridges

2007-10-19 Thread David Gaarenstroom
2007/10/19, Shane Huang <[EMAIL PROTECTED]>:
>
> Since we have little experience on PCI and MSI here,

"Here" as in "here at AMD"?! I'm stunned...

Both AMD and the former ATI should have quite some experience?!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-19 Thread Shane Huang

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:  0204   IO-APIC-fasteoi   HDA Intel
 17:  0479   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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-18 Thread Greg KH
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-18 Thread David Miller
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-18 Thread Shane Huang
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]; linux-kernel@vger.kernel.org;
[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.
> 



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-10-18 Thread David Miller
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch] PCI: disable MSI on more ATI NorthBridges

2007-10-18 Thread Shane Huang
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



ATI_NBs_MSI_disable.patch
Description: ATI_NBs_MSI_disable.patch