Skip to content

Commit 9ca641b

Browse files
mtd: nand: fix shutdown/reboot for multi-chip systems
If multiple NAND chips are registered to the same controller, then when rebooting the system, the first one will grab the controller lock, while the second will wait forever for the first one to release it. i.e., a classic deadlock. This problem was solved for a similar case (suspend/resume) back in commit 6b0d9a8 ("mtd: nand: fix multi-chip suspend problem"), and the shutdown state really isn't much different for us, so rather than adding a new special case to nand_get_device(), we can just overload the FL_PM_SUSPENDED state. Now, multiple chips can "get" the same controller lock (preventing further I/O), while we still allow other chips to pass through nand_shutdown(). Original report: http://thread.gmane.org/gmane.linux.drivers.mtd/59726 http://lists.infradead.org/pipermail/linux-mtd/2015-July/059992.html Fixes: 72ea403 ("mtd: nand: added nand_shutdown") Reported-by: Andrew E. Mileski <[email protected]> Signed-off-by: Brian Norris <[email protected]> Cc: Scott Branden <[email protected]> Cc: Andrew E. Mileski <[email protected]> Acked-by: Scott Branden <[email protected]> Reviewed-by: Boris Brezillon <[email protected]>
1 parent 96dd922 commit 9ca641b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mtd/nand/nand_base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3110,7 +3110,7 @@ static void nand_resume(struct mtd_info *mtd)
31103110
*/
31113111
static void nand_shutdown(struct mtd_info *mtd)
31123112
{
3113-
nand_get_device(mtd, FL_SHUTDOWN);
3113+
nand_get_device(mtd, FL_PM_SUSPENDED);
31143114
}
31153115

31163116
/* Set default functions */

0 commit comments

Comments
 (0)