sata_mv: fix SoC interrupt breakage
authorMark Lord <liml@rtr.ca>
Thu, 19 Feb 2009 15:38:04 +0000 (10:38 -0500)
committerJeff Garzik <jgarzik@redhat.com>
Wed, 25 Feb 2009 20:25:35 +0000 (15:25 -0500)
For some reason, sata_mv doesn't clear interrupt status during init
when it's running on an SoC host adapter.  If the bootloader has
touched the SATA controller before starting Linux, Linux can end up
enabling the SATA interrupt with events pending, which will cause the
interrupt to be marked as spurious and then be disabled, which then
breaks all further accesses to the controller.

This patch makes the SoC path clear interrupt status on init like in
the non-SoC case.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/sata_mv.c

index 4ae1a41..7007edd 100644 (file)
@@ -3114,19 +3114,17 @@ static int mv_init_host(struct ata_host *host, unsigned int board_idx)
                writelfl(0, hc_mmio + HC_IRQ_CAUSE_OFS);
        }
 
-       if (!IS_SOC(hpriv)) {
-               /* Clear any currently outstanding host interrupt conditions */
-               writelfl(0, mmio + hpriv->irq_cause_ofs);
+       /* Clear any currently outstanding host interrupt conditions */
+       writelfl(0, mmio + hpriv->irq_cause_ofs);
 
-               /* and unmask interrupt generation for host regs */
-               writelfl(hpriv->unmask_all_irqs, mmio + hpriv->irq_mask_ofs);
+       /* and unmask interrupt generation for host regs */
+       writelfl(hpriv->unmask_all_irqs, mmio + hpriv->irq_mask_ofs);
 
-               /*
-                * enable only global host interrupts for now.
-                * The per-port interrupts get done later as ports are set up.
-                */
-               mv_set_main_irq_mask(host, 0, PCI_ERR);
-       }
+       /*
+        * enable only global host interrupts for now.
+        * The per-port interrupts get done later as ports are set up.
+        */
+       mv_set_main_irq_mask(host, 0, PCI_ERR);
 done:
        return rc;
 }