Patchwork OMAP: OneNAND: panic_write may be in an interrupt context

login
register
mail settings
Submitter Adrian Hunter
Date March 23, 2009, 1:07 p.m.
Message ID <49C78990.8020100@nokia.com>
Download mbox | patch
Permalink /patch/24914/
State New
Headers show

Comments

Adrian Hunter - March 23, 2009, 1:07 p.m.
From 92a79a1a210845d64077e7ac100ddde8f251018b Mon Sep 17 00:00:00 2001
From: Adrian Hunter <adrian.hunter@nokia.com>
Date: Mon, 23 Mar 2009 14:57:38 +0200
Subject: [PATCH] OMAP: OneNAND: panic_write may be in an interrupt context

panic_write may read in an interrupt context.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
---
 drivers/mtd/onenand/omap2.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Patch

diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index 77a4f14..2c199b3 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -294,6 +294,10 @@  static int omap3_onenand_read_bufferram(struct mtd_info *mtd, int area,
 	if (bram_offset & 3 || (size_t)buf & 3 || count < 384)
 		goto out_copy;
 
+	/* panic_write() may be in an interrupt context */
+	if (in_interrupt())
+		goto out_copy;
+
 	if (buf >= high_memory) {
 		struct page *p1;