Skip to contentSkip to conversation

sata_mv: fix SoC interrupt breakage

PATCH In review Mark Lord 2 participants 2 messages Feb 19, 2009 – Feb 25, 2009 libata

lore
Share & tools
lore

Mark Lord

author
#0 lore raw

PATCH 1/1 sata_mv: fix SoC interrupt breakage

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.

---

This is for 2.6.29 (upstream-fixes).
Despite appearances, this patch simply removes a single unnecessary if-stmt from the code. It looks larger due to the resulting change in indentation level.

drivers/ata/sata_mv.c renamed from drivers/ata/sata_mv.c.orig +11 -13
@@ -3114,19 +3114,17 @@
 		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);
-
-		/* 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);
-	}
+	/* 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);
+
+	/*
+	 * 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;
 }
#1 lore raw
Quoted 10 lines · Mark Lord

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.

Quoted 8 lines

---

This is for 2.6.29 (upstream-fixes).
Despite appearances, this patch simply removes a single unnecessary if-stmt from the code. It looks larger due to the resulting change in indentation level.

applied manually... not even patch(1) liked this one, and patch(1) is far less strict than git-am patch import tool. Other peoples' patches are processing just fine.

Jeff