aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/kempld-core.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2014-03-20 11:12:28 -0400
committerLee Jones <lee.jones@linaro.org>2014-03-20 11:58:25 -0400
commit204747c970c0d568721c76ab8a57dde0e5dcf0d5 (patch)
tree2235bb09163819c324a8bbb1473fcdd394c37779 /drivers/mfd/kempld-core.c
parent5a78401623740c892868d5929b33f5cda8fe819e (diff)
mfd: kempld-core: Fix potential hang-up during boot
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. Cc: <stable@vger.kernel.org> 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>
Diffstat (limited to 'drivers/mfd/kempld-core.c')
-rw-r--r--drivers/mfd/kempld-core.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
index 20a6afcfb36c..07692604e119 100644
--- a/drivers/mfd/kempld-core.c
+++ b/drivers/mfd/kempld-core.c
@@ -322,9 +322,12 @@ static int kempld_detect_device(struct kempld_device_data *pld)
322 return -ENODEV; 322 return -ENODEV;
323 } 323 }
324 324
325 /* Release hardware mutex if aquired */ 325 /* Release hardware mutex if acquired */
326 if (!(index_reg & KEMPLD_MUTEX_KEY)) 326 if (!(index_reg & KEMPLD_MUTEX_KEY)) {
327 iowrite8(KEMPLD_MUTEX_KEY, pld->io_index); 327 iowrite8(KEMPLD_MUTEX_KEY, pld->io_index);
328 /* PXT and COMe-cPC2 boards may require a second release */
329 iowrite8(KEMPLD_MUTEX_KEY, pld->io_index);
330 }
328 331
329 mutex_unlock(&pld->lock); 332 mutex_unlock(&pld->lock);
330 333