Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3cd3a86b6fdcb80ad097850a0990bcf6251422fe
Commit:     3cd3a86b6fdcb80ad097850a0990bcf6251422fe
Parent:     30a7eb298af849bae3050e0a3f4c130995da22b0
Author:     Adrian Hunter <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 12 10:34:01 2007 +0300
Committer:  David Woodhouse <[EMAIL PROTECTED]>
CommitDate: Sun Oct 14 13:37:53 2007 +0100

    [MTD] [OneNAND] Avoid deadlock in erase callback; release chip lock first.
    
    When the erase callback performs some other action on the flash, it's
    highly likely to deadlock unless we actually release the chip lock
    before calling it.
    
    This patch mirrors that same change already done for NAND.
    
    Signed-off-by: Adrian Hunter <[EMAIL PROTECTED]>
    Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
---
 drivers/mtd/onenand/onenand_base.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/onenand/onenand_base.c 
b/drivers/mtd/onenand/onenand_base.c
index a8c426b..dd28355 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -1711,13 +1711,14 @@ static int onenand_erase(struct mtd_info *mtd, struct 
erase_info *instr)
 erase_exit:
 
        ret = instr->state == MTD_ERASE_DONE ? 0 : -EIO;
-       /* Do call back function */
-       if (!ret)
-               mtd_erase_callback(instr);
 
        /* Deselect and wake up anyone waiting on the device */
        onenand_release_device(mtd);
 
+       /* Do call back function */
+       if (!ret)
+               mtd_erase_callback(instr);
+
        return ret;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to