Patchwork [2/2] OneNAND: OMAP: do not use DMA if oops in progress

login
register
mail settings
Submitter Aaro Koskinen
Date Oct. 1, 2009, 3:16 p.m.
Message ID <1254410216-24444-2-git-send-email-aaro.koskinen@nokia.com>
Download mbox | patch
Permalink /patch/34733/
State Accepted
Commit 932f5d21ccd2705f1fb22e8a9e0da42013dcee17
Headers show

Comments

Aaro Koskinen - Oct. 1, 2009, 3:16 p.m.
Otherwise we may hang if we are called from panic() through mtdoops.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
---
 drivers/mtd/onenand/omap2.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index 0108ed4..b1e04ff 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -294,7 +294,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) {
@@ -371,7 +371,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) {