Patchwork [11/16] MTD: nand: make suspend work if device is accessed by kernel threads

login
register
mail settings
Submitter Maxim Levitsky
Date Jan. 29, 2010, 2:50 p.m.
Message ID <1264776663-7042-12-git-send-email-maximlevitsky@gmail.com>
Download mbox | patch
Permalink /patch/43930/
State Accepted
Commit 49ef3c6ee11e221b26caf4ac55c2702a37cca103
Headers show

Comments

Maxim Levitsky - Jan. 29, 2010, 2:50 p.m.
Since all userspace threads are frozen when nand_suspend is called
 this means they aren't inside any nand function.
We don't call try_to_freeze in nand ether. Thus only user tha can be insize
the nand functions is an non freezeable kernel thread.
Thus we just wait till it finish the access to the device.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
---
 drivers/mtd/nand/nand_base.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

Patch

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 29e986e..961c98f 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -744,9 +744,6 @@  nand_get_device(struct nand_chip *chip, struct mtd_info *mtd, int new_state)
 			chip->state = FL_PM_SUSPENDED;
 			spin_unlock(lock);
 			return 0;
-		} else {
-			spin_unlock(lock);
-			return -EAGAIN;
 		}
 	}
 	set_current_state(TASK_UNINTERRUPTIBLE);