From: Ivaylo Dimitrov <redacted>
Commit c37dd677988ca50bc8bc60ab5ab053720583c168 fixes the unbalanced
unlock in acx565akm_enable but introduces another problem - if
acx565akm_panel_power_on exits early, the mutex is not unlocked. Fix
that by unlocking the mutex on early return. Also add mutex protection in
acx565akm_panel_power_off and remove an unused variable
Signed-off-by: Ivaylo Dimitrov <redacted>
---
.../omap2/displays-new/panel-sony-acx565akm.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
From: Pavel Machek <hidden> Date: 2014-01-04 12:51:16
On Mon 2013-12-30 18:17:52, Ivaylo Dimitrov wrote:
From: Ivaylo Dimitrov <redacted>
Commit c37dd677988ca50bc8bc60ab5ab053720583c168 fixes the unbalanced
unlock in acx565akm_enable but introduces another problem - if
acx565akm_panel_power_on exits early, the mutex is not unlocked. Fix
that by unlocking the mutex on early return. Also add mutex protection in
acx565akm_panel_power_off and remove an unused variable
Signed-off-by: Ivaylo Dimitrov <redacted>
On Mon 2013-12-30 18:17:52, Ivaylo Dimitrov wrote:
quoted
From: Ivaylo Dimitrov <redacted>
Commit c37dd677988ca50bc8bc60ab5ab053720583c168 fixes the unbalanced
unlock in acx565akm_enable but introduces another problem - if
acx565akm_panel_power_on exits early, the mutex is not unlocked. Fix
that by unlocking the mutex on early return. Also add mutex protection in
acx565akm_panel_power_off and remove an unused variable
Signed-off-by: Ivaylo Dimitrov <redacted>
Reviewed-by: Pavel Machek <redacted>
Hmm, I introduced a bug with that patch (recursive lock), will send a
new version that fixes it
Regards,
Ivo
From: Ivaylo Dimitrov <redacted>
Commit c37dd677988ca50bc8bc60ab5ab053720583c168 fixes the unbalanced
unlock in acx565akm_enable but introduces another problem - if
acx565akm_panel_power_on exits early, the mutex is not unlocked. Fix
that by unlocking the mutex on early return. Also add mutex protection in
acx565akm_panel_power_off and remove an unused variable
Signed-off-by: Ivaylo Dimitrov <redacted>
---
.../omap2/displays-new/panel-sony-acx565akm.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
From: Tomi Valkeinen <hidden> Date: 2014-01-10 10:57:16
On 2014-01-05 15:13, Ivaylo Dimitrov wrote:
From: Ivaylo Dimitrov <redacted>
Commit c37dd677988ca50bc8bc60ab5ab053720583c168 fixes the unbalanced
unlock in acx565akm_enable but introduces another problem - if
acx565akm_panel_power_on exits early, the mutex is not unlocked. Fix
that by unlocking the mutex on early return. Also add mutex protection in
acx565akm_panel_power_off and remove an unused variable
I think this is just getting more messy. How about we more or less revert the c37dd677988ca50bc8bc60ab5ab053720583c168 and fix it like this:
@@ -346,28 +346,22 @@ static int acx565akm_get_actual_brightness(struct panel_drv_data *ddata)staticintacx565akm_bl_update_status(structbacklight_device*dev){structpanel_drv_data*ddata=dev_get_drvdata(&dev->dev);-intr;intlevel;dev_dbg(&ddata->spi->dev,"%s\n",__func__);-mutex_lock(&ddata->mutex);-if(dev->props.fb_blank==FB_BLANK_UNBLANK&&dev->props.power==FB_BLANK_UNBLANK)level=dev->props.brightness;elselevel=0;-r=0;if(ddata->has_bc)acx565akm_set_brightness(ddata,level);else-r=-ENODEV;--mutex_unlock(&ddata->mutex);+return-ENODEV;-returnr;+return0;}staticintacx565akm_bl_get_intensity(structbacklight_device*dev)
@@ -390,9 +384,33 @@ static int acx565akm_bl_get_intensity(struct backlight_device *dev)return0;}+staticintacx565akm_bl_update_status_locked(structbacklight_device*dev)+{+structpanel_drv_data*ddata=dev_get_drvdata(&dev->dev);+intr;++mutex_lock(&ddata->mutex);+r=acx565akm_bl_update_status(dev);+mutex_unlock(&ddata->mutex);++returnr;+}++staticintacx565akm_bl_get_intensity_locked(structbacklight_device*dev)+{+structpanel_drv_data*ddata=dev_get_drvdata(&dev->dev);+intr;++mutex_lock(&ddata->mutex);+r=acx565akm_bl_get_intensity(dev);+mutex_unlock(&ddata->mutex);++returnr;+}+staticconststructbacklight_opsacx565akm_bl_ops={-.get_brightness=acx565akm_bl_get_intensity,-.update_status=acx565akm_bl_update_status,+.get_brightness=acx565akm_bl_get_intensity_locked,+.update_status=acx565akm_bl_update_status_locked,};/*--------------------Auto Brightness control via Sysfs---------------------*/
@@ -526,8 +544,6 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)structomap_dss_device*in=ddata->in;intr;-mutex_lock(&ddata->mutex);-dev_dbg(&ddata->spi->dev,"%s\n",__func__);in->ops.sdi->set_timings(in,&ddata->videomode);
@@ -568,8 +584,6 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)set_display_state(ddata,1);set_cabc_mode(ddata,ddata->cabc_mode);-mutex_unlock(&ddata->mutex);-returnacx565akm_bl_update_status(ddata->bl_dev);}
From: Ivaylo Dimitrov <redacted>
Commit c37dd677988ca50bc8bc60ab5ab053720583c168 fixes the unbalanced
unlock in acx565akm_enable but introduces another problem - if
acx565akm_panel_power_on exits early, the mutex is not unlocked. Fix
that by unlocking the mutex on early return. Also add mutex protection in
acx565akm_panel_power_off and remove an unused variable
I think this is just getting more messy. How about we more or less revert the c37dd677988ca50bc8bc60ab5ab053720583c168 and fix it like this:
I am fine with whatever patch you may come with, as long as it fixes the
issue.
The patch does not apply cleanly on top of rc7, however I applied it by
hand. So far it seems it fixes the issue brought by
c37dd677988ca50bc8bc60ab5ab053720583c168, though I didn't test if
mutex_lock/mutex_unlock are complementary in every code path (at least
not explicitly, I guess maemo is doing it for us anyway :) ).
So, shall I send a patch incorporating your code changes, or you will do it?
Regards,
Ivo
From: Tomi Valkeinen <hidden> Date: 2014-01-13 10:21:25
On 2014-01-11 11:39, Ivaylo Dimitrov wrote:
The patch does not apply cleanly on top of rc7, however I applied it by
hand. So far it seems it fixes the issue brought by
c37dd677988ca50bc8bc60ab5ab053720583c168, though I didn't test if
mutex_lock/mutex_unlock are complementary in every code path (at least
not explicitly, I guess maemo is doing it for us anyway :) ).
Ok, thanks.
So, shall I send a patch incorporating your code changes, or you will do
it?
Hi Tomi,
On 13.01.2014 12:20, Tomi Valkeinen wrote:
On 2014-01-11 11:39, Ivaylo Dimitrov wrote:
quoted
The patch does not apply cleanly on top of rc7, however I applied it by
hand. So far it seems it fixes the issue brought by
c37dd677988ca50bc8bc60ab5ab053720583c168, though I didn't test if
mutex_lock/mutex_unlock are complementary in every code path (at least
not explicitly, I guess maemo is doing it for us anyway :) ).
Ok, thanks.
quoted
So, shall I send a patch incorporating your code changes, or you will do
it?
I can handle it.
Tomi
I still don't see those fixes in mainline, shall I send a patch?
Ivo
From: Tomi Valkeinen <hidden> Date: 2015-12-29 07:46:53
On 25/12/15 15:29, Ivaylo Dimitrov wrote:
Hi Tomi,
On 13.01.2014 12:20, Tomi Valkeinen wrote:
quoted
On 2014-01-11 11:39, Ivaylo Dimitrov wrote:
quoted
The patch does not apply cleanly on top of rc7, however I applied it by
hand. So far it seems it fixes the issue brought by
c37dd677988ca50bc8bc60ab5ab053720583c168, though I didn't test if
mutex_lock/mutex_unlock are complementary in every code path (at least
not explicitly, I guess maemo is doing it for us anyway :) ).
Ok, thanks.
quoted
So, shall I send a patch incorporating your code changes, or you will do
it?
I can handle it.
Tomi
I still don't see those fixes in mainline, shall I send a patch?
Oh, I'm sorry, I must have forgotten about that. Please, send a new patch.
Tomi