mtd: nand: make suspend work if device is accessed by kernel threads.
authorMaxim Levitsky <maximlevitsky@gmail.com>
Mon, 22 Feb 2010 18:39:34 +0000 (20:39 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 26 Feb 2010 17:43:21 +0000 (17:43 +0000)
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@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/nand_base.c

index ed62e1ee0f815b0829d97307113c10d1d214bf09..7442b3a29b256341601638d0f2b1597881d51f79 100644 (file)
@@ -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);