kernel_optimize_test/drivers/mtd
Brian Norris 9ca641b0f0 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 6b0d9a8412 ("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: 72ea403669 ("mtd: nand: added nand_shutdown")
Reported-by: Andrew E. Mileski <andrewm@isoar.ca>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: Scott Branden <sbranden@broadcom.com>
Cc: Andrew E. Mileski <andrewm@isoar.ca>
Acked-by: Scott Branden <sbranden@broadcom.com>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
2015-11-16 10:51:39 -08:00
..
chips mtd: chips: fixup dependencies, to prevent build error 2015-05-28 11:07:48 -07:00
devices MTD updates for 4.4-rc1: 2015-11-06 11:50:24 -08:00
lpddr mtd: lpddr: show parent device in sysfs 2015-10-13 09:21:17 -07:00
maps mtd: maps: rbtx4939-flash: fix compile error 2015-10-19 18:21:25 -07:00
nand mtd: nand: fix shutdown/reboot for multi-chip systems 2015-11-16 10:51:39 -08:00
onenand mtd: onenand: omap2: drop owner and name assignment 2015-10-13 12:56:43 -07:00
spi-nor mtd: fsl-quadspi: fix macro collision problems with READ/WRITE 2015-10-26 14:44:56 -07:00
tests mtd: tests: Replace timeval with ktime_t 2015-10-26 13:23:47 -07:00
ubi This pull request includes the following UBI/UBIFS changes: 2015-11-10 16:35:06 -08:00
afs.c
ar7part.c
bcm47xxpart.c
bcm63xxpart.c
cmdlinepart.c mtd: cmdlinepart: convert printk() to pr_*() 2015-09-28 18:37:32 -07:00
ftl.c
inftlcore.c
inftlmount.c
Kconfig
Makefile
mtd_blkdevs.c mtd: blkdevs: fix potential deadlock + lockdep warnings 2015-10-30 17:24:43 -07:00
mtdblock_ro.c
mtdblock.c
mtdchar.c mtd: provide proper 32/64-bit compat_ioctl() support for BLKPG 2015-09-29 13:37:04 -07:00
mtdconcat.c
mtdcore.c Merge branch 'akpm' (patches from Andrew) 2015-11-07 14:32:45 -08:00
mtdcore.h
mtdoops.c
mtdpart.c mtd: mtdpart: Do not fail mtd probe when parsing partitions fails 2015-10-26 18:43:48 -07:00
mtdsuper.c
mtdswap.c
nftlcore.c
nftlmount.c
ofpart.c mtd: ofpart: move ofpart partitions to a dedicated dt node 2015-10-30 14:01:39 -07:00
redboot.c
rfd_ftl.c
sm_ftl.c
sm_ftl.h
ssfdc.c