pci: Add quirk for still enabled interrupts on Intel Sandy Bridge GPUs
PATCH 1/1 pci: Add quirk for still enabled interrupts on Intel Sandy Bridge GPUs
Some BIOS implementations leave the Intel GPU interrupts enabled, even though no one is handling them (f.e. i915 driver is never loaded). Additionally the interrupt destination is not set up properly and the interrupt ends up -somewhere-.
These spurious interrupts are "sticky" and the kernel disables the (shared) interrupt line after 100.000+ generated interrupts.
Fix it by disabling the still enabled interrupts. This resolves crashes often seen on monitor unplug.
Tested on the following boards:
- Intel DH61CR: Affected
- Intel DH67BL: Affected
- Intel S1200KP server board: Affected
- Asus P8H61-M LE: Affected, but system does not crash. Probably the IRQ ends up somewhere unnoticed.
According to reports on the net, the Intel DH61WW board is also affected.
Many thanks to Jesse Barnes from Intel for helping with the register configuration and to Intel in general for providing public hardware documentation.
---
Please CC: comments.
drivers/pci/quirks.c | 34 ++++++++++++++++++++++++++++++++++ 1 files changed, 34 insertions(+), 0 deletions(-)
drivers/pci/quirks.c +34 -0
@@ -2906,6 +2906,40 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f8, quirk_intel_mc_errata);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x65f9 , quirk_intel_mc_errata);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x65fa , quirk_intel_mc_errata); +/* +* Some BIOS implementations leave the Intel GPU interrupts enabled, +* even though no one is handling them (f.e. i915 driver is never loaded). +* Additionally the interrupt destination is not set up properly +* and the interrupt ends up -somewhere-. +* +* These spurious interrupts are "sticky" and the kernel disables +* the (shared) interrupt line after 100.000+ generated interrupts. +* +* Fix it by disabling the still enabled interrupts. +* This resolves crashes often seen on monitor unplug. +*/ +#define I915_DEIER_REG 0x4400c +static void __devinit disable_igfx_irq (struct pci_dev *dev) +{ +void __iomem *regs =pci_iomap (dev,0 ,0 ); +if (regs ==NULL ) { +dev_warn (&dev->dev,"igfx quirk: Can't iomap PCI device\n" ); +return ; + } + +/* Check if any interrupt line is still enabled */ +if (readl (regs +I915_DEIER_REG ) !=0 ) { +dev_warn (&dev->dev,"BIOS left Intel GPU interrupts enabled; " +"disabling\n" ); + +writel (0 , regs +I915_DEIER_REG ); + } + +pci_iounmap (dev, regs); +} +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x0102 , disable_igfx_irq); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x010a , disable_igfx_irq); +static void pci_do_fixups (struct pci_dev *dev,struct pci_fixup *f,struct pci_fixup *end) {
Signature · 1 line
1.7.4.4
Quoted 15 lines · On Wed, 07 Dec 2011 22:08:11 +0100 Thomas Jarosch…
drivers/pci/quirks.c +15
-0+#define I915_DEIER_REG 0x4400c +static void __devinit disable_igfx_irq (struct pci_dev *dev) +{ +void __iomem *regs =pci_iomap (dev,0 ,0 ); +if (regs ==NULL ) { +dev_warn (&dev->dev,"igfx quirk: Can't iomap PCI device\n" ); +return ; + } + +/* Check if any interrupt line is still enabled */ +if (readl (regs +I915_DEIER_REG ) !=0 ) { +dev_warn (&dev->dev,"BIOS left Intel GPU interrupts enabled; " +"disabling\n" ); + +writel (0 , regs +I915_DEIER_REG );
drivers/pci/quirks.c DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f8, quirk_intel_mc_errata); · line 2945
Quoted 10 lines
drivers/pci/quirks.c +7
-0+ } + +pci_iounmap (dev, regs); +} +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x0102 , disable_igfx_irq); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x010a , disable_igfx_irq); +static void pci_do_fixups (struct pci_dev *dev,struct pci_fixup *f,struct pci_fixup *end) {
Could really be dev_dbg, I think this will be fairly common. I think we also need to ack any outstanding interrupts after disabling them in IER by writing IIR back on itself. Can you test that?
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Hi Jesse,
Quoted 7 lines · On Wednesday, 7. December 2011 22:30:00 Jesse Barnes wrote:
drivers/pci/quirks.c DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f8, quirk_intel_mc_errata); · line 2945
Quoted 5 lines
drivers/pci/quirks.c +4
-0+/* Check if any interrupt line is still enabled */ +if (readl (regs +I915_DEIER_REG ) !=0 ) { +dev_warn (&dev->dev,"BIOS left Intel GPU interrupts enabled; " +"disabling\n" ); {Could really be
dev_dbg, I think this will be fairly common.
Thanks for your review.
I prefer dev_warn() or dev_info() for two reasons:
1. This is new code. If a system crashes in the unlikely event because of this change, the user will have a better chance to see the message before we tweak around the registers.
2. All other quirks either use dev_warn() (like the Intel e100 quirk which is similar to this fix, see quirk_e100_interrupt()) or dev_info().
If there is something wrong and we activate a workaround, let the user know about it, at least for now.
User impact is minimal and users with graphical boot up don't see kernel messages anyway.
Quoted 2 lines
I think we also need to ack any outstanding interrupts after disabling them in IER by writing IIR back on itself. Can you test that?
Can you go into more detail why we need this?
Looking at the logic diagram at page 23 of this document
http://intellinuxgraphics.org/documentation/SNB/IHD_OS_Vol3_Part2.pdf
tells me we don't necessarily need this, no interrupt should slip through.
Also the i915 driver first disables IER and then clears IIR in drivers/gpu/drm/i915/i915_irq.c: ivybridge_irq_handler() or ironlake_irq_handler(). So it always initializes the GPU to a sane state before enabling the interrupts.
Thanks,
Thomas
Quoted 10 lines · On Wednesday, 7. December 2011 22:08:11 Thomas Jarosch wrote:
Some BIOS implementations leave the Intel GPU interrupts enabled, even though no one is handling them (f.e. i915 driver is never loaded). Additionally the interrupt destination is not set up properly and the interrupt ends up -somewhere-.
These spurious interrupts are "sticky" and the kernel disables the (shared) interrupt line after 100.000+ generated interrupts.
Fix it by disabling the still enabled interrupts. This resolves crashes often seen on monitor unplug.
Happy new year 2012!
Any news on the status of this patch?
Cheers,
Thomas
Quoted 9 lines · On Tue, 10 Jan 2012 11:45:52 +0100 Thomas Jarosch…
Quoted 8 lines · On Wednesday, 7. December 2011 22:08:11 Thomas Jarosch wrote:
Some BIOS implementations leave the Intel GPU interrupts enabled, even though no one is handling them (f.e. i915 driver is never loaded). Additionally the interrupt destination is not set up properly and the interrupt ends up -somewhere-.
These spurious interrupts are "sticky" and the kernel disables the (shared) interrupt line after 100.000+ generated interrupts.
Quoted 6 lines
Quoted 2 lines
Fix it by disabling the still enabled interrupts. This resolves crashes often seen on monitor unplug.
Happy new year 2012!
Any news on the status of this patch?
Did you get my last reply:
Could really be dev_dbg, I think this will be fairly common. I think we also need to ack any outstanding interrupts after disabling them in IER by writing IIR back on itself. Can you test that?
Other than that I'd like to apply it.
Thanks,
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Hi Jesse,
Quoted 1 line · On Friday, 27. January 2012 18:28:40 Jesse Barnes wrote:
Did you get my last reply:
Yes, I also replied to it. Here's my reply in the archives in case it got lost somehow:
https://lkml.org/lkml/2011/12/8/66
Best regards,
Thomas
Jesse Barnes
AppliedQuoted 10 lines · On Wed, 07 Dec 2011 22:08:11 +0100 Thomas Jarosch…
Some BIOS implementations leave the Intel GPU interrupts enabled, even though no one is handling them (f.e. i915 driver is never loaded). Additionally the interrupt destination is not set up properly and the interrupt ends up -somewhere-.
These spurious interrupts are "sticky" and the kernel disables the (shared) interrupt line after 100.000+ generated interrupts.
Fix it by disabling the still enabled interrupts. This resolves crashes often seen on monitor unplug.
Applied to my -next branch finally (sorry I missed your last reply), thanks Thomas.
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Quoted 7 lines · On Wednesday, 7. December 2011 22:08:11 Thomas Jarosch wrote:
Some BIOS implementations leave the Intel GPU interrupts enabled, even though no one is handling them (f.e. i915 driver is never loaded). Additionally the interrupt destination is not set up properly and the interrupt ends up -somewhere-.
These spurious interrupts are "sticky" and the kernel disables the (shared) interrupt line after 100.000+ generated interrupts.
Just a small heads up: Boards with the new Intel Ivy bridge chipset are affected, too. Currently known to be affected is
Intel Desktop Board DH77EB
Would be nice if Intel fixes the shared BIOS code...
Thanks to Drew Weaver for reporting the issue. I currently don't have time to prepare another quirk.
Best regards
Thomas Jarosch
Yeah it is very unfortunate that this hasn't been fixed in the BIOS.
-----Original Message-----
From: Thomas Jarosch [mailto:[email protected]]
Sent: Wednesday, April 25, 2012 11:22 AM
To: [email protected]
Cc: Jesse Barnes; [email protected]; Drew Weaver; Charlie Suffin
Subject: Re: [PATCH] pci: Add quirk for still enabled interrupts on Intel Sandy Bridge GPUs
Quoted 7 lines · On Wednesday, 7. December 2011 22:08:11 Thomas Jarosch wrote:
Some BIOS implementations leave the Intel GPU interrupts enabled, even though no one is handling them (f.e. i915 driver is never loaded). Additionally the interrupt destination is not set up properly and the interrupt ends up -somewhere-.
These spurious interrupts are "sticky" and the kernel disables the (shared) interrupt line after 100.000+ generated interrupts.
Just a small heads up: Boards with the new Intel Ivy bridge chipset are affected, too. Currently known to be affected is
Intel Desktop Board DH77EB
Would be nice if Intel fixes the shared BIOS code...
Thanks to Drew Weaver for reporting the issue. I currently don't have time to prepare another quirk.
Best regards
Thomas Jarosch