[4.2.y-ckt stable] Patch "mtd: nand: fix shutdown/reboot for multi-chip systems" has been added to staging queue
Kamal Mostafa
kamal at canonical.com
Thu Jan 14 22:27:39 UTC 2016
This is a note to let you know that I have just added a patch titled
mtd: nand: fix shutdown/reboot for multi-chip systems
to the linux-4.2.y-queue branch of the 4.2.y-ckt extended stable tree
which can be found at:
http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-4.2.y-queue
This patch is scheduled to be released in version 4.2.8-ckt2.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 4.2.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Kamal
---8<------------------------------------------------------------
>From 71299630ef234eaf65fb1ab61998040e7476f149 Mon Sep 17 00:00:00 2001
From: Brian Norris <computersforpeace at gmail.com>
Date: Mon, 9 Nov 2015 16:37:28 -0800
Subject: mtd: nand: fix shutdown/reboot for multi-chip systems
commit 9ca641b0f02a3a1eedbc8c296e695326da9bbaf9 upstream.
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 6b0d9a841249 ("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: 72ea403669c7 ("mtd: nand: added nand_shutdown")
Reported-by: Andrew E. Mileski <andrewm at isoar.ca>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
Cc: Scott Branden <sbranden at broadcom.com>
Cc: Andrew E. Mileski <andrewm at isoar.ca>
Acked-by: Scott Branden <sbranden at broadcom.com>
Reviewed-by: Boris Brezillon <boris.brezillon at free-electrons.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
drivers/mtd/nand/nand_base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ceb68ca..066f967 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2964,7 +2964,7 @@ static void nand_resume(struct mtd_info *mtd)
*/
static void nand_shutdown(struct mtd_info *mtd)
{
- nand_get_device(mtd, FL_SHUTDOWN);
+ nand_get_device(mtd, FL_PM_SUSPENDED);
}
/* Set default functions */
--
1.9.1
More information about the kernel-team
mailing list