]> err.no Git - linux-2.6/commit
[MTD] NAND: Reorganize chip locking
authorThomas Gleixner <tglx@linutronix.de>
Tue, 31 May 2005 19:39:20 +0000 (20:39 +0100)
committerThomas Gleixner <tglx@mtd.linutronix.de>
Wed, 29 Jun 2005 12:15:17 +0000 (14:15 +0200)
commit0dfc62465ef92c7ddcb1ba223bf062453566fd0f
tree0156e9b9996cf43dd67ceed53a2b8da0a516cdec
parent7ca6448dbfb398bba36eda3c01bc14b86c3675be
[MTD] NAND: Reorganize chip locking

The code was wrong in several aspects. The locking order was
inconsistent, the device aquire code did not reset a variable
after a wakeup and the wakeup handling was not working for
applications where multiple chips are sharing a single
hardware controller.
When a hardware controller is available the locking is now
reduced to the hardware controller lock and the waitqueue is
moved to the hardware controller structure in order to avoid
a wake_up_all().

The problem was pointed out by Ben Dooks, who also found the
missing variable reset as main cause for his deadlock problem.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/mtd/nand/nand_base.c
include/linux/mtd/nand.h