Commit 616299af authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Linus Torvalds

[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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a497aa20
...@@ -1204,6 +1204,8 @@ pmac_ide_do_suspend(ide_hwif_t *hwif) ...@@ -1204,6 +1204,8 @@ pmac_ide_do_suspend(ide_hwif_t *hwif)
} }
#endif /* CONFIG_BLK_DEV_IDE_PMAC_BLINK */ #endif /* CONFIG_BLK_DEV_IDE_PMAC_BLINK */
disable_irq(pmif->irq);
/* The media bay will handle itself just fine */ /* The media bay will handle itself just fine */
if (pmif->mediabay) if (pmif->mediabay)
return 0; return 0;
...@@ -1236,7 +1238,6 @@ pmac_ide_do_resume(ide_hwif_t *hwif) ...@@ -1236,7 +1238,6 @@ pmac_ide_do_resume(ide_hwif_t *hwif)
ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, pmif->node, pmif->aapl_bus_id, 1); ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, pmif->node, pmif->aapl_bus_id, 1);
msleep(10); msleep(10);
ppc_md.feature_call(PMAC_FTR_IDE_RESET, pmif->node, pmif->aapl_bus_id, 0); ppc_md.feature_call(PMAC_FTR_IDE_RESET, pmif->node, pmif->aapl_bus_id, 0);
msleep(jiffies_to_msecs(IDE_WAKEUP_DELAY));
/* Kauai has it different */ /* Kauai has it different */
if (pmif->kauai_fcr) { if (pmif->kauai_fcr) {
...@@ -1244,11 +1245,15 @@ pmac_ide_do_resume(ide_hwif_t *hwif) ...@@ -1244,11 +1245,15 @@ pmac_ide_do_resume(ide_hwif_t *hwif)
fcr |= KAUAI_FCR_UATA_RESET_N | KAUAI_FCR_UATA_ENABLE; fcr |= KAUAI_FCR_UATA_RESET_N | KAUAI_FCR_UATA_ENABLE;
writel(fcr, pmif->kauai_fcr); writel(fcr, pmif->kauai_fcr);
} }
msleep(jiffies_to_msecs(IDE_WAKEUP_DELAY));
} }
/* Sanitize drive timings */ /* Sanitize drive timings */
sanitize_timings(pmif); sanitize_timings(pmif);
enable_irq(pmif->irq);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment