[PATCH] ARM: OMAPFB: panel-sony-acx565akm: fix bad unlock balance

Subsystems: framebuffer layer, the rest

STALE4674d

5 messages, 3 authors, 2013-12-11 · open the first message on its own page

[PATCH] ARM: OMAPFB: panel-sony-acx565akm: fix bad unlock balance

From: Aaro Koskinen <aaro.koskinen@iki.fi>
Date: 2013-11-06 21:24:30

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 the extra mutex_unlock().

Reported-by: Eduardo Valentin <redacted>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: stable@vger.kernel.org
---
 drivers/video/omap2/displays-new/panel-sony-acx565akm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
index e6d56f7..72fe2a8 100644
--- a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
+++ b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
@@ -616,7 +616,7 @@ static int acx565akm_enable(struct omap_dss_device *dssdev)
 
 	mutex_lock(&ddata->mutex);
 	r = acx565akm_panel_power_on(dssdev);
-	mutex_unlock(&ddata->mutex);
+	/* NOTE: acx565akm_panel_power_on() will unlock the mutex. */
 
 	if (r)
 		return r;
-- 
1.8.4.2

Re: [PATCH] ARM: OMAPFB: panel-sony-acx565akm: fix bad unlock balance

From: Tomi Valkeinen <hidden>
Date: 2013-11-11 13:37:37

On 2013-11-06 23:24, Aaro Koskinen wrote:
quoted hunk
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 the extra mutex_unlock().

Reported-by: Eduardo Valentin <redacted>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: stable@vger.kernel.org
---
 drivers/video/omap2/displays-new/panel-sony-acx565akm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
index e6d56f7..72fe2a8 100644
--- a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
+++ b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
@@ -616,7 +616,7 @@ static int acx565akm_enable(struct omap_dss_device *dssdev)
 
 	mutex_lock(&ddata->mutex);
 	r = acx565akm_panel_power_on(dssdev);
-	mutex_unlock(&ddata->mutex);
+	/* NOTE: acx565akm_panel_power_on() will unlock the mutex. */
 
 	if (r)
 		return r;
Hm why would you fix it like this? Why not remove the mutex_unlock from
acx565akm_panel_power_on()? Looks to me like that one is the buggy one.

 Tomi

Re: [PATCH] ARM: OMAPFB: panel-sony-acx565akm: fix bad unlock balance

From: Aaro Koskinen <aaro.koskinen@iki.fi>
Date: 2013-11-11 18:37:30

Hi,

On Mon, Nov 11, 2013 at 03:37:37PM +0200, Tomi Valkeinen wrote:
On 2013-11-06 23:24, Aaro Koskinen wrote:
quoted
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 the extra mutex_unlock().

Reported-by: Eduardo Valentin <redacted>
Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: stable@vger.kernel.org
---
 drivers/video/omap2/displays-new/panel-sony-acx565akm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
index e6d56f7..72fe2a8 100644
--- a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
+++ b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
@@ -616,7 +616,7 @@ static int acx565akm_enable(struct omap_dss_device *dssdev)
 
 	mutex_lock(&ddata->mutex);
 	r = acx565akm_panel_power_on(dssdev);
-	mutex_unlock(&ddata->mutex);
+	/* NOTE: acx565akm_panel_power_on() will unlock the mutex. */
 
 	if (r)
 		return r;
Hm why would you fix it like this? Why not remove the mutex_unlock from
acx565akm_panel_power_on()? Looks to me like that one is the buggy one.
The unlock needs to be there because acx565akm_bl_update_status()
also locks the mutex. I'll send a new version where the mutex_lock()
is done inside acx565akm_panel_power_on().

A.

[PATCH] ARM: OMAPFB: panel-sony-acx565akm: fix missing unlock in acx565akm_panel_power_on()

From: Wei Yongjun <hidden>
Date: 2013-12-06 12:55:12

From: Wei Yongjun <redacted>

Add the missing unlock before return from function
acx565akm_panel_power_on() in the error handling case.

Signed-off-by: Wei Yongjun <redacted>
---
 drivers/video/omap2/displays-new/panel-sony-acx565akm.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
index d94f35d..69aa4a1 100644
--- a/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
+++ b/drivers/video/omap2/displays-new/panel-sony-acx565akm.c
@@ -536,7 +536,7 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)
 	r = in->ops.sdi->enable(in);
 	if (r) {
 		pr_err("%s sdi enable failed\n", __func__);
-		return r;
+		goto out;
 	}
 
 	/*FIXME tweak me */
@@ -547,7 +547,8 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)
 
 	if (ddata->enabled) {
 		dev_dbg(&ddata->spi->dev, "panel already enabled\n");
-		return 0;
+		r = 0;
+		goto out;
 	}
 
 	/*
@@ -571,6 +572,10 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)
 	mutex_unlock(&ddata->mutex);
 
 	return acx565akm_bl_update_status(ddata->bl_dev);
+
+out:
+	mutex_unlock(&ddata->mutex);
+	return r;
 }
 
 static void acx565akm_panel_power_off(struct omap_dss_device *dssdev)

Re: [PATCH] ARM: OMAPFB: panel-sony-acx565akm: fix missing unlock in acx565akm_panel_power_on()

From: Tomi Valkeinen <hidden>
Date: 2013-12-11 14:29:57

Hi,

On 2013-12-06 14:55, Wei Yongjun wrote:
From: Wei Yongjun <redacted>

Add the missing unlock before return from function
acx565akm_panel_power_on() in the error handling case.

Signed-off-by: Wei Yongjun <redacted>
A fix for this has already been merged:
c37dd677988ca50bc8bc60ab5ab053720583c168 (ARM: OMAPFB:
panel-sony-acx565akm: fix bad unlock balance)

 Tomi

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help