This is a note to let you know that I've just added the patch titled mtd: atmel_nand: fix bug driver will in a dead lock if no nand detected to the 3.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mtd-atmel_nand-fix-bug-driver-will-in-a-dead-lock-if-no-nand-detected.patch and it can be found in the queue-3.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From a749d13acd8e079ed4c77a9456d842dc94af8f17 Mon Sep 17 00:00:00 2001 From: Josh Wu <josh.wu@xxxxxxxxx> Date: Tue, 5 Nov 2013 17:59:07 +0800 Subject: mtd: atmel_nand: fix bug driver will in a dead lock if no nand detected From: Josh Wu <josh.wu@xxxxxxxxx> commit a749d13acd8e079ed4c77a9456d842dc94af8f17 upstream. In the atmel driver probe function, the code shows like following: atmel_nand_probe(...) { ... err_nand_ioremap: platform_driver_unregister(&atmel_nand_nfc_driver); return res; } If no nand flash detected, the driver probe function will goto err_nand_ioremap label. Then platform_driver_unregister() will be called. It will get the lock of atmel_nand device since it is parent of nfc_device. The problem is the lock is already hold by atmel_nand_probe itself. So system will be in a dead lock. This patch just simply removed to platform_driver_unregister() call. When atmel_nand driver is quit the platform_driver_unregister() will be called in atmel_nand_remove(). [Brian: the NAND platform probe really has no business registering/unregistering another driver; this fixes the deadlock, but we should follow up the likely racy behavior here with a better architecture] Signed-off-by: Josh Wu <josh.wu@xxxxxxxxx> Signed-off-by: Brian Norris <computersforpeace@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/mtd/nand/atmel_nand.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c @@ -2177,7 +2177,6 @@ err_no_card: if (host->dma_chan) dma_release_channel(host->dma_chan); err_nand_ioremap: - platform_driver_unregister(&atmel_nand_nfc_driver); return res; } Patches currently in stable-queue which might be from josh.wu@xxxxxxxxx are queue-3.12/mtd-atmel_nand-fix-bug-driver-will-in-a-dead-lock-if-no-nand-detected.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html