All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ARM: OMAPFB: panel-sony-acx565akm: fix bad unlock balance
@ 2013-11-11 18:41 ` Aaro Koskinen
  0 siblings, 0 replies; 4+ messages in thread
From: Aaro Koskinen @ 2013-11-11 18:41 UTC (permalink / raw)
  To: Tomi Valkeinen, linux-omap, linux-fbdev
  Cc: Eduardo Valentin, Aaro Koskinen, stable

When booting Nokia N900 smartphone with v3.12 + omap2plus_defconfig
(LOCKDEP enabled) and CONFIG_DISPLAY_PANEL_SONY_ACX565AKM enabled,
the following BUG is seen during the boot:

[    7.302154] ==================[    7.307128] [ BUG: bad unlock balance detected! ]
[    7.312103] 3.12.0-los.git-2093492-00120-g5e01dc7 #3 Not tainted
[    7.318450] -------------------------------------
[    7.323425] kworker/u2:1/12 is trying to release lock (&ddata->mutex) at:
[    7.330657] [<c031b760>] acx565akm_enable+0x12c/0x18c
[    7.335998] but there are no more locks to release!

Fix by removing double unlock and handling the locking completely inside
acx565akm_panel_power_on() when doing the power on.

Reported-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: stable@vger.kernel.org
---
 drivers/video/omap2/displays-new/panel-sony-acx565akm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
index e6d56f7..d94f35d 100644
--- a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
+++ b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
@@ -526,6 +526,8 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)
 	struct omap_dss_device *in = ddata->in;
 	int r;
 
+	mutex_lock(&ddata->mutex);
+
 	dev_dbg(&ddata->spi->dev, "%s\n", __func__);
 
 	in->ops.sdi->set_timings(in, &ddata->videomode);
@@ -614,10 +616,7 @@ static int acx565akm_enable(struct omap_dss_device *dssdev)
 	if (omapdss_device_is_enabled(dssdev))
 		return 0;
 
-	mutex_lock(&ddata->mutex);
 	r = acx565akm_panel_power_on(dssdev);
-	mutex_unlock(&ddata->mutex);
-
 	if (r)
 		return r;
 
-- 
1.8.4.2


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

* [PATCH v2] ARM: OMAPFB: panel-sony-acx565akm: fix bad unlock balance
@ 2013-11-11 18:41 ` Aaro Koskinen
  0 siblings, 0 replies; 4+ messages in thread
From: Aaro Koskinen @ 2013-11-11 18:41 UTC (permalink / raw)
  To: Tomi Valkeinen, linux-omap, linux-fbdev
  Cc: Eduardo Valentin, Aaro Koskinen, stable

When booting Nokia N900 smartphone with v3.12 + omap2plus_defconfig
(LOCKDEP enabled) and CONFIG_DISPLAY_PANEL_SONY_ACX565AKM enabled,
the following BUG is seen during the boot:

[    7.302154] =====================================
[    7.307128] [ BUG: bad unlock balance detected! ]
[    7.312103] 3.12.0-los.git-2093492-00120-g5e01dc7 #3 Not tainted
[    7.318450] -------------------------------------
[    7.323425] kworker/u2:1/12 is trying to release lock (&ddata->mutex) at:
[    7.330657] [<c031b760>] acx565akm_enable+0x12c/0x18c
[    7.335998] but there are no more locks to release!

Fix by removing double unlock and handling the locking completely inside
acx565akm_panel_power_on() when doing the power on.

Reported-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: stable@vger.kernel.org
---
 drivers/video/omap2/displays-new/panel-sony-acx565akm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
index e6d56f7..d94f35d 100644
--- a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
+++ b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
@@ -526,6 +526,8 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)
 	struct omap_dss_device *in = ddata->in;
 	int r;
 
+	mutex_lock(&ddata->mutex);
+
 	dev_dbg(&ddata->spi->dev, "%s\n", __func__);
 
 	in->ops.sdi->set_timings(in, &ddata->videomode);
@@ -614,10 +616,7 @@ static int acx565akm_enable(struct omap_dss_device *dssdev)
 	if (omapdss_device_is_enabled(dssdev))
 		return 0;
 
-	mutex_lock(&ddata->mutex);
 	r = acx565akm_panel_power_on(dssdev);
-	mutex_unlock(&ddata->mutex);
-
 	if (r)
 		return r;
 
-- 
1.8.4.2

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

* Re: [PATCH v2] ARM: OMAPFB: panel-sony-acx565akm: fix bad unlock balance
  2013-11-11 18:41 ` Aaro Koskinen
@ 2013-11-18 13:36   ` Tomi Valkeinen
  -1 siblings, 0 replies; 4+ messages in thread
From: Tomi Valkeinen @ 2013-11-18 13:36 UTC (permalink / raw)
  To: Aaro Koskinen, linux-omap, linux-fbdev; +Cc: Eduardo Valentin, stable

[-- Attachment #1: Type: text/plain, Size: 2088 bytes --]

On 2013-11-11 20:41, Aaro Koskinen wrote:
> When booting Nokia N900 smartphone with v3.12 + omap2plus_defconfig
> (LOCKDEP enabled) and CONFIG_DISPLAY_PANEL_SONY_ACX565AKM enabled,
> the following BUG is seen during the boot:
> 
> [    7.302154] =====================================
> [    7.307128] [ BUG: bad unlock balance detected! ]
> [    7.312103] 3.12.0-los.git-2093492-00120-g5e01dc7 #3 Not tainted
> [    7.318450] -------------------------------------
> [    7.323425] kworker/u2:1/12 is trying to release lock (&ddata->mutex) at:
> [    7.330657] [<c031b760>] acx565akm_enable+0x12c/0x18c
> [    7.335998] but there are no more locks to release!
> 
> Fix by removing double unlock and handling the locking completely inside
> acx565akm_panel_power_on() when doing the power on.
> 
> Reported-by: Eduardo Valentin <eduardo.valentin@ti.com>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> Cc: stable@vger.kernel.org
> ---
>  drivers/video/omap2/displays-new/panel-sony-acx565akm.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
> index e6d56f7..d94f35d 100644
> --- a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
> +++ b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
> @@ -526,6 +526,8 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)
>  	struct omap_dss_device *in = ddata->in;
>  	int r;
>  
> +	mutex_lock(&ddata->mutex);
> +
>  	dev_dbg(&ddata->spi->dev, "%s\n", __func__);
>  
>  	in->ops.sdi->set_timings(in, &ddata->videomode);
> @@ -614,10 +616,7 @@ static int acx565akm_enable(struct omap_dss_device *dssdev)
>  	if (omapdss_device_is_enabled(dssdev))
>  		return 0;
>  
> -	mutex_lock(&ddata->mutex);
>  	r = acx565akm_panel_power_on(dssdev);
> -	mutex_unlock(&ddata->mutex);
> -
>  	if (r)
>  		return r;
>  
> 

Thanks, this is better. lock and unlock in different functions makes me
feel very uneasy...

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

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

* Re: [PATCH v2] ARM: OMAPFB: panel-sony-acx565akm: fix bad unlock balance
@ 2013-11-18 13:36   ` Tomi Valkeinen
  0 siblings, 0 replies; 4+ messages in thread
From: Tomi Valkeinen @ 2013-11-18 13:36 UTC (permalink / raw)
  To: Aaro Koskinen, linux-omap, linux-fbdev; +Cc: Eduardo Valentin, stable

[-- Attachment #1: Type: text/plain, Size: 2088 bytes --]

On 2013-11-11 20:41, Aaro Koskinen wrote:
> When booting Nokia N900 smartphone with v3.12 + omap2plus_defconfig
> (LOCKDEP enabled) and CONFIG_DISPLAY_PANEL_SONY_ACX565AKM enabled,
> the following BUG is seen during the boot:
> 
> [    7.302154] =====================================
> [    7.307128] [ BUG: bad unlock balance detected! ]
> [    7.312103] 3.12.0-los.git-2093492-00120-g5e01dc7 #3 Not tainted
> [    7.318450] -------------------------------------
> [    7.323425] kworker/u2:1/12 is trying to release lock (&ddata->mutex) at:
> [    7.330657] [<c031b760>] acx565akm_enable+0x12c/0x18c
> [    7.335998] but there are no more locks to release!
> 
> Fix by removing double unlock and handling the locking completely inside
> acx565akm_panel_power_on() when doing the power on.
> 
> Reported-by: Eduardo Valentin <eduardo.valentin@ti.com>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> Cc: stable@vger.kernel.org
> ---
>  drivers/video/omap2/displays-new/panel-sony-acx565akm.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
> index e6d56f7..d94f35d 100644
> --- a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
> +++ b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
> @@ -526,6 +526,8 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)
>  	struct omap_dss_device *in = ddata->in;
>  	int r;
>  
> +	mutex_lock(&ddata->mutex);
> +
>  	dev_dbg(&ddata->spi->dev, "%s\n", __func__);
>  
>  	in->ops.sdi->set_timings(in, &ddata->videomode);
> @@ -614,10 +616,7 @@ static int acx565akm_enable(struct omap_dss_device *dssdev)
>  	if (omapdss_device_is_enabled(dssdev))
>  		return 0;
>  
> -	mutex_lock(&ddata->mutex);
>  	r = acx565akm_panel_power_on(dssdev);
> -	mutex_unlock(&ddata->mutex);
> -
>  	if (r)
>  		return r;
>  
> 

Thanks, this is better. lock and unlock in different functions makes me
feel very uneasy...

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

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

end of thread, other threads:[~2013-11-18 13:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-11 18:41 [PATCH v2] ARM: OMAPFB: panel-sony-acx565akm: fix bad unlock balance Aaro Koskinen
2013-11-11 18:41 ` Aaro Koskinen
2013-11-18 13:36 ` Tomi Valkeinen
2013-11-18 13:36   ` Tomi Valkeinen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.