mtd: nand: make suspend work if device is accessed by kernel threads.

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Feb 26 13:59:02 EST 2010


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=49ef3c6ee11e221b26caf4ac55c2702a37cca103
Commit:     49ef3c6ee11e221b26caf4ac55c2702a37cca103
Parent:     026ec57886b67c092bf7baecd029a7c1c4998c28
Author:     Maxim Levitsky <maximlevitsky at gmail.com>
AuthorDate: Mon Feb 22 20:39:34 2010 +0200
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Feb 26 17:43:21 2010 +0000

    mtd: nand: make suspend work if device is accessed by kernel threads.
    
    Since all userspace threads are frozen at the time the nand_suspend is called,
    they aren't inside any nand function.
    
    We don't call try_to_freeze in nand ether. Thus the only user that can
    be inside the nand functions is an non freezeable kernel thread. Thus we
    can safely wait for it to finish.
    
    Signed-off-by: Maxim Levitsky <maximlevitsky at gmail.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/nand_base.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ed62e1e..7442b3a 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -773,9 +773,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);



More information about the linux-mtd-cvs mailing list