mtd: OneNAND: do not use DMA if oops in progress
authorAaro Koskinen <aaro.koskinen@nokia.com>
Wed, 10 Feb 2010 17:03:19 +0000 (19:03 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 26 Feb 2010 13:22:01 +0000 (13:22 +0000)
Otherwise we may hang if we are called from panic() through mtdoops.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/onenand/omap2.c

index 75f38b9..dfbab6c 100644 (file)
@@ -308,7 +308,7 @@ static int omap3_onenand_read_bufferram(struct mtd_info *mtd, int area,
                goto out_copy;
 
        /* panic_write() may be in an interrupt context */
-       if (in_interrupt())
+       if (in_interrupt() || oops_in_progress)
                goto out_copy;
 
        if (buf >= high_memory) {
@@ -385,7 +385,7 @@ static int omap3_onenand_write_bufferram(struct mtd_info *mtd, int area,
                goto out_copy;
 
        /* panic_write() may be in an interrupt context */
-       if (in_interrupt())
+       if (in_interrupt() || oops_in_progress)
                goto out_copy;
 
        if (buf >= high_memory) {