aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ppc/pmac.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-05-01 11:58:41 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 11:58:41 -0400
commit616299afcebfb2228f45a95aac7e63704c3733fc (patch)
treef2335aa6ae9d891911eb45acb7b09310e414706e /drivers/ide/ppc/pmac.c
parenta497aa20e5ea54fdee474192d6dc138b4832fc9e (diff)
[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>
Diffstat (limited to 'drivers/ide/ppc/pmac.c')
-rw-r--r--drivers/ide/ppc/pmac.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index 6dc273a81327..569f16767442 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1204,6 +1204,8 @@ pmac_ide_do_suspend(ide_hwif_t *hwif)
1204 } 1204 }
1205#endif /* CONFIG_BLK_DEV_IDE_PMAC_BLINK */ 1205#endif /* CONFIG_BLK_DEV_IDE_PMAC_BLINK */
1206 1206
1207 disable_irq(pmif->irq);
1208
1207 /* The media bay will handle itself just fine */ 1209 /* The media bay will handle itself just fine */
1208 if (pmif->mediabay) 1210 if (pmif->mediabay)
1209 return 0; 1211 return 0;
@@ -1236,7 +1238,6 @@ pmac_ide_do_resume(ide_hwif_t *hwif)
1236 ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, pmif->node, pmif->aapl_bus_id, 1); 1238 ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, pmif->node, pmif->aapl_bus_id, 1);
1237 msleep(10); 1239 msleep(10);
1238 ppc_md.feature_call(PMAC_FTR_IDE_RESET, pmif->node, pmif->aapl_bus_id, 0); 1240 ppc_md.feature_call(PMAC_FTR_IDE_RESET, pmif->node, pmif->aapl_bus_id, 0);
1239 msleep(jiffies_to_msecs(IDE_WAKEUP_DELAY));
1240 1241
1241 /* Kauai has it different */ 1242 /* Kauai has it different */
1242 if (pmif->kauai_fcr) { 1243 if (pmif->kauai_fcr) {
@@ -1244,11 +1245,15 @@ pmac_ide_do_resume(ide_hwif_t *hwif)
1244 fcr |= KAUAI_FCR_UATA_RESET_N | KAUAI_FCR_UATA_ENABLE; 1245 fcr |= KAUAI_FCR_UATA_RESET_N | KAUAI_FCR_UATA_ENABLE;
1245 writel(fcr, pmif->kauai_fcr); 1246 writel(fcr, pmif->kauai_fcr);
1246 } 1247 }
1248
1249 msleep(jiffies_to_msecs(IDE_WAKEUP_DELAY));
1247 } 1250 }
1248 1251
1249 /* Sanitize drive timings */ 1252 /* Sanitize drive timings */
1250 sanitize_timings(pmif); 1253 sanitize_timings(pmif);
1251 1254
1255 enable_irq(pmif->irq);
1256
1252 return 0; 1257 return 0;
1253} 1258}
1254 1259