From: Adrian Hunter Date: Fri, 12 Oct 2007 07:34:01 +0000 (+0300) Subject: [MTD] [OneNAND] Avoid deadlock in erase callback; release chip lock first. X-Git-Tag: v2.6.24-rc1~1324^2~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cd3a86b6fdcb80ad097850a0990bcf6251422fe;p=linux-2.6 [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 Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c index a8c426bf47..dd28355690 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; }