Skip to contentSkip to conversation

mfd: kempld-core: Fix potential hang-up during boot

PATCH In review Guenter Roeck 2 participants 4 messages Mar 20, 2014 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/mfd/kempld-core.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/mfd/kempld-core.c +5 -2
index d3e2327..38917a8 100644
@@ -322,9 +322,12 @@ static int kempld_detect_device(struct kempld_device_data *pld)
 		return -ENODEV;
 	}
 
-	/* Release hardware mutex if aquired */
-	if (!(index_reg & KEMPLD_MUTEX_KEY))
+	/* Release hardware mutex if acquired */
+	if (!(index_reg & KEMPLD_MUTEX_KEY)) {
 		iowrite8(KEMPLD_MUTEX_KEY, pld->io_index);
+		/* PXT and COMe-cPC2 boards may require a second release */
+		iowrite8(KEMPLD_MUTEX_KEY, pld->io_index);
+	}
 
 	mutex_unlock(&pld->lock);
 
Signature · 1 line
1.7.9.7
#1 lore raw
Quoted 9 lines

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.

Quoted 6 lines
---
 drivers/mfd/kempld-core.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

I was going to stop taking patches for this cycle, but as this looks like a bugfix I'll apply it, thanks.

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#2 lore raw
Quoted 16 lines · Lee Jones
Quoted 9 lines

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.

Quoted 6 lines
---
 drivers/mfd/kempld-core.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Quoted 3 lines

I was going to stop taking patches for this cycle, but as this looks like a bugfix I'll apply it, thanks.

Hi Lee,

Great.

I should have added a note - the patch will also be needed in -stable; the driver is used in both 3.12 and 3.13.

Thanks,
Guenter

#3 lore raw
Quoted 20 lines
Quoted 16 lines
Quoted 9 lines

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.

Quoted 6 lines
---
 drivers/mfd/kempld-core.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Quoted 3 lines

I was going to stop taking patches for this cycle, but as this looks like a bugfix I'll apply it, thanks.

Quoted 6 lines

Hi Lee,

Great.

I should have added a note - the patch will also be needed in -stable; the driver is used in both 3.12 and 3.13.

Very well. I'll add the Cc to the commit log.

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog