public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: kempld-core: Fix potential hang-up during boot
@ 2014-03-20 15:12 Guenter Roeck
  2014-03-20 15:28 ` Lee Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2014-03-20 15:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Samuel Ortiz, Lee Jones, Michael Brunner, Guenter Roeck

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>
---
 drivers/mfd/kempld-core.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
index d3e2327..38917a8 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)
 		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);
 
-- 
1.7.9.7


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mfd: kempld-core: Fix potential hang-up during boot
  2014-03-20 15:12 [PATCH] mfd: kempld-core: Fix potential hang-up during boot Guenter Roeck
@ 2014-03-20 15:28 ` Lee Jones
  2014-03-20 15:36   ` Guenter Roeck
  0 siblings, 1 reply; 4+ messages in thread
From: Lee Jones @ 2014-03-20 15:28 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-kernel, Samuel Ortiz, Michael Brunner

> 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>
> ---
>  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.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mfd: kempld-core: Fix potential hang-up during boot
  2014-03-20 15:28 ` Lee Jones
@ 2014-03-20 15:36   ` Guenter Roeck
  2014-03-20 15:49     ` Lee Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2014-03-20 15:36 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Samuel Ortiz, Michael Brunner

On Thu, Mar 20, 2014 at 03:28:12PM +0000, Lee Jones wrote:
> > 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>
> > ---
> >  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.
> 

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mfd: kempld-core: Fix potential hang-up during boot
  2014-03-20 15:36   ` Guenter Roeck
@ 2014-03-20 15:49     ` Lee Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2014-03-20 15:49 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-kernel, Samuel Ortiz, Michael Brunner

> > > 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>
> > > ---
> > >  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.
> > 
> 
> 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.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-20 15:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-20 15:12 [PATCH] mfd: kempld-core: Fix potential hang-up during boot Guenter Roeck
2014-03-20 15:28 ` Lee Jones
2014-03-20 15:36   ` Guenter Roeck
2014-03-20 15:49     ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox