]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] siimage: enable interrupts on Adaptec SA-1210 card
authorJohn W. Linville <linville@tuxdriver.com>
Wed, 9 Nov 2005 23:19:14 +0000 (00:19 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Wed, 9 Nov 2005 23:19:14 +0000 (00:19 +0100)
The siimage driver proports to support the Adaptec SA-1210 SATA
controller.  However, at least some of those cards boot-up with their
interrupts disabled internally.  The siimage driver currently ignores
that fact, so that driver does not actually work with those cards.
This patch enables those interrupts on cards that need it.

[ This is implemented based on similar code in the libata-based
  sata_sil driver. ]

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/pci/siimage.c

index 2b9961b881355a8eafa826fb8e6cd7b2762e569b..022d244f2eb098dc3c99a13929ebbb5d109b7102 100644 (file)
@@ -701,6 +701,7 @@ static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name)
        unsigned long barsize   = pci_resource_len(dev, 5);
        u8 tmpbyte      = 0;
        void __iomem *ioaddr;
+       u32 tmp, irq_mask;
 
        /*
         *      Drop back to PIO if we can't map the mmio. Some
@@ -726,6 +727,14 @@ static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name)
        pci_set_drvdata(dev, (void *) ioaddr);
 
        if (pdev_is_sata(dev)) {
+               /* make sure IDE0/1 interrupts are not masked */
+               irq_mask = (1 << 22) | (1 << 23);
+               tmp = readl(ioaddr + 0x48);
+               if (tmp & irq_mask) {
+                       tmp &= ~irq_mask;
+                       writel(tmp, ioaddr + 0x48);
+                       readl(ioaddr + 0x48); /* flush */
+               }
                writel(0, ioaddr + 0x148);
                writel(0, ioaddr + 0x1C8);
        }