mfd: kempld-core: Fix potential hang-up during boot
authorGuenter Roeck <linux@roeck-us.net>
Thu, 20 Mar 2014 15:12:28 +0000 (08:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 May 2014 14:59:25 +0000 (07:59 -0700)
commit00834e4d81ffd1e58206d24ed096f8210958096f
tree9c0db61788cac8b7052e5d802522e1b5ebe5b4f2
parent9ae64846e73d519426778a0cad99b17d2a8a38c9
mfd: kempld-core: Fix potential hang-up during boot

commit 204747c970c0d568721c76ab8a57dde0e5dcf0d5 upstream.

On PXT and COMe-cPC2 boards it is observed that the hardware
mutex is acquired but not being released during initialization.
This can result in a hang-up during boot if the driver is built
into the kernel.

Releasing the mutex twice if it was acquired fixes the problem.
Subsequent request/release cycles work as expected, so the fix is
only needed during initialization.

Reviewed-by: Michael Brunner <michael.brunner@kontron.com>
Tested-by: Michael Brunner <michael.brunner@kontron.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mfd/kempld-core.c