Blackfin: fix suspend/resume failure with some on-chip ROMs
authorMichael Hennerich <michael.hennerich@analog.com>
Tue, 20 Oct 2009 13:38:04 +0000 (13:38 +0000)
committerMike Frysinger <vapier@gentoo.org>
Wed, 25 Nov 2009 07:35:33 +0000 (02:35 -0500)
Some Blackfin on-chip ROMs utilize some MDMA channels during the suspend
and resume process, but don't clean up after themselves.  So manually
clear all DMA channels when resuming since no DMA could have been running
at this point in time.  Now Linux should be able to work regardless of any
laziness on the part of the on-chip ROM or boot loader.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
arch/blackfin/kernel/bfin_dma_5xx.c

index 1f170216d2f9b35f475db4a7fa37d9c2064a9fe3..3946aff4f4148b6133f31429fbbe9facb40b35c0 100644 (file)
@@ -225,8 +225,13 @@ int blackfin_dma_suspend(void)
 void blackfin_dma_resume(void)
 {
        int i;
-       for (i = 0; i < MAX_DMA_SUSPEND_CHANNELS; ++i)
-               dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map;
+
+       for (i = 0; i < MAX_DMA_CHANNELS; ++i) {
+               dma_ch[i].regs->cfg = 0;
+
+               if (i < MAX_DMA_SUSPEND_CHANNELS)
+                       dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map;
+       }
 }
 #endif