Re: [PATCH] pci: Add quirk for still enabled interrupts on IntelSandy Bridge GPUs

From: Jesse Barnes
Date: Wed Dec 07 2011 - 16:30:12 EST


On Wed, 07 Dec 2011 22:08:11 +0100
Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx> wrote:
> +#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)
> {

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?

--
Jesse Barnes, Intel Open Source Technology Center

Attachment: signature.asc
Description: PGP signature