Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] ppc32: Fix IDE related crash on wakeup

I noticed an occasional crash on wakeup from sleep on my powerbook
(strangly never happened before, probably timing related) that appears to
be due to a dangling interrupt while the chip is put to sleep and beeing
reset on wakeup.

This patch fixes is by disabling the irq in the ide pmac driver while
asleep and only re-enable it after the chip has been fully reset. This is
safe to do so as the interrupt of these apple IDE cells is never shared.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Benjamin Herrenschmidt and committed by
Linus Torvalds
616299af a497aa20

+6 -1
+6 -1
drivers/ide/ppc/pmac.c
··· 1204 1204 } 1205 1205 #endif /* CONFIG_BLK_DEV_IDE_PMAC_BLINK */ 1206 1206 1207 + disable_irq(pmif->irq); 1208 + 1207 1209 /* The media bay will handle itself just fine */ 1208 1210 if (pmif->mediabay) 1209 1211 return 0; ··· 1238 1236 ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, pmif->node, pmif->aapl_bus_id, 1); 1239 1237 msleep(10); 1240 1238 ppc_md.feature_call(PMAC_FTR_IDE_RESET, pmif->node, pmif->aapl_bus_id, 0); 1241 - msleep(jiffies_to_msecs(IDE_WAKEUP_DELAY)); 1242 1239 1243 1240 /* Kauai has it different */ 1244 1241 if (pmif->kauai_fcr) { ··· 1245 1244 fcr |= KAUAI_FCR_UATA_RESET_N | KAUAI_FCR_UATA_ENABLE; 1246 1245 writel(fcr, pmif->kauai_fcr); 1247 1246 } 1247 + 1248 + msleep(jiffies_to_msecs(IDE_WAKEUP_DELAY)); 1248 1249 } 1249 1250 1250 1251 /* Sanitize drive timings */ 1251 1252 sanitize_timings(pmif); 1253 + 1254 + enable_irq(pmif->irq); 1252 1255 1253 1256 return 0; 1254 1257 }