OneNAND: OMAP: do not use DMA if oops in progress

Submitted by Aaro Koskinen on Feb. 10, 2010, 5:03 p.m.

Details

Message ID 1265821399-29940-1-git-send-email-Aaro.Koskinen@nokia.com
State New, archived
Headers show

Commit Message

Aaro Koskinen Feb. 10, 2010, 5:03 p.m.
From: Aaro Koskinen <aaro.koskinen@nokia.com>

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(-)

Comments

Artem Bityutskiy Feb. 16, 2010, 8:12 a.m.
On Wed, 2010-02-10 at 19:03 +0200, Aaro.Koskinen@nokia.com wrote:
> From: Aaro Koskinen <aaro.koskinen@nokia.com>
> 
> Otherwise we may hang if we are called from panic() through mtdoops.
> 
> Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>

Pushed to my l2-mtd-2.6.git / master.

Patch hide | download patch | download mbox

diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index 75f38b9..dfbab6c 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -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) {