From: Jani Nikula <ext-jani.1.nikula@nokia.com> To: Tomi.Valkeinen@nokia.com, tony@atomide.com Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, ext-jani.1.nikula@nokia.com Subject: [PATCH v2 02/21] OMAP: DSS2: Taal: add locks to taal_bl_update_status Date: Mon, 03 May 2010 06:18:22 +0000 [thread overview] Message-ID: <c95257e8042f471c55a38133020d1d63e22161f3.1272621452.git.ext-jani.1.nikula@nokia.com> (raw) In-Reply-To: <1ef57e99d69aaf89b8e61074aa8ce2e5f6632d28.1272621452.git.ext-jani.1.nikula@nokia.com> From: Valkeinen Tomi (Nokia-D/Helsinki) <Tomi.Valkeinen@nokia.com> From: Tomi Valkeinen <tomi.valkeinen@nokia.com> taal_bl_update_status was missing locks to protect taal_data. This caused a kernel crash randomly, as the code attempted to set the brightness while the OMAP's DSI block was actually disabled. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> --- drivers/video/omap2/displays/panel-taal.c | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index 43fce5f..5f5afba 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c @@ -290,24 +290,26 @@ static int taal_bl_update_status(struct backlight_device *dev) dev_dbg(&dssdev->dev, "update brightness to %d\n", level); + mutex_lock(&td->lock); + if (td->use_dsi_bl) { if (td->enabled) { dsi_bus_lock(); r = taal_dcs_write_1(DCS_BRIGHTNESS, level); dsi_bus_unlock(); - if (r) - return r; + } else { + r = 0; } } else { if (!dssdev->set_backlight) - return -EINVAL; - - r = dssdev->set_backlight(dssdev, level); - if (r) - return r; + r = -EINVAL; + else + r = dssdev->set_backlight(dssdev, level); } - return 0; + mutex_unlock(&td->lock); + + return r; } static int taal_bl_get_intensity(struct backlight_device *dev) -- 1.6.5.2
WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <ext-jani.1.nikula@nokia.com> To: Tomi.Valkeinen@nokia.com, tony@atomide.com Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, ext-jani.1.nikula@nokia.com Subject: [PATCH v2 02/21] OMAP: DSS2: Taal: add locks to taal_bl_update_status Date: Mon, 3 May 2010 09:18:22 +0300 [thread overview] Message-ID: <c95257e8042f471c55a38133020d1d63e22161f3.1272621452.git.ext-jani.1.nikula@nokia.com> (raw) In-Reply-To: <1ef57e99d69aaf89b8e61074aa8ce2e5f6632d28.1272621452.git.ext-jani.1.nikula@nokia.com> In-Reply-To: <cover.1272621452.git.ext-jani.1.nikula@nokia.com> From: Valkeinen Tomi (Nokia-D/Helsinki) <Tomi.Valkeinen@nokia.com> From: Tomi Valkeinen <tomi.valkeinen@nokia.com> taal_bl_update_status was missing locks to protect taal_data. This caused a kernel crash randomly, as the code attempted to set the brightness while the OMAP's DSI block was actually disabled. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com> --- drivers/video/omap2/displays/panel-taal.c | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c index 43fce5f..5f5afba 100644 --- a/drivers/video/omap2/displays/panel-taal.c +++ b/drivers/video/omap2/displays/panel-taal.c @@ -290,24 +290,26 @@ static int taal_bl_update_status(struct backlight_device *dev) dev_dbg(&dssdev->dev, "update brightness to %d\n", level); + mutex_lock(&td->lock); + if (td->use_dsi_bl) { if (td->enabled) { dsi_bus_lock(); r = taal_dcs_write_1(DCS_BRIGHTNESS, level); dsi_bus_unlock(); - if (r) - return r; + } else { + r = 0; } } else { if (!dssdev->set_backlight) - return -EINVAL; - - r = dssdev->set_backlight(dssdev, level); - if (r) - return r; + r = -EINVAL; + else + r = dssdev->set_backlight(dssdev, level); } - return 0; + mutex_unlock(&td->lock); + + return r; } static int taal_bl_get_intensity(struct backlight_device *dev) -- 1.6.5.2
next prev parent reply other threads:[~2010-05-03 6:18 UTC|newest] Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-05-03 6:18 [PATCH v2 00/21] OMAP: DSS2: Taal panel driver updates Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 01/21] OMAP: DSS2: Taal: Add panel hardware reset Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` Jani Nikula [this message] 2010-05-03 6:18 ` [PATCH v2 02/21] OMAP: DSS2: Taal: add locks to taal_bl_update_status Jani Nikula 2010-05-03 6:18 ` [PATCH v2 03/21] OMAP: DSS2: Taal: Add locks to protect taal data access Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 04/21] OMAP: DSS2: Taal: Cosmetic improvement to backlight properties initialization Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 05/21] OMAP: DSS2: Taal: Remove platform enable/disable Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 06/21] OMAP: DSS2: Taal: Fix request_irq() error handling Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 07/21] OMAP: DSS2: Taal: Remove ESD work cancel from driver probe " Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 08/21] OMAP: DSS2: Taal: Improve taal_power_on() " Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 09/21] OMAP: DSS2: Taal: Bail out from taal_run_test() if panel is not enabled Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 10/21] OMAP: DSS2: Taal: Change DSI bus locking to avoid deadlock in ESD work Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 11/21] OMAP: DSS2: Taal: Check taal_power_on() return value in taal_resume() Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 12/21] OMAP: DSS2: Taal: Change ESD work management Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 13/21] OMAP: DSS2: Taal: Change probe error handling labels Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 14/21] OMAP: DSS2: Taal: Add proper external TE support Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 15/21] OMAP: DSS2: Add Nokia DSI command mode panel configuration struct Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 16/21] OMAP: DSS2: Taal: Use Nokia DSI panel data Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 17/21] OMAP: DSS2: Taal: Configure ESD check in " Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 18/21] OMAP: DSS2: Taal: Add panel specific configuration structure Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 19/21] OMAP: DSS2: Taal: Print panel name in addition to revision Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 20/21] OMAP: DSS2: Taal: Add regulator configuration support Jani Nikula 2010-05-03 6:18 ` Jani Nikula 2010-05-03 6:18 ` [PATCH v2 21/21] OMAP: DSS2: Taal: CABC workaround is Taal specific Jani Nikula 2010-05-03 6:18 ` Jani Nikula
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=c95257e8042f471c55a38133020d1d63e22161f3.1272621452.git.ext-jani.1.nikula@nokia.com \ --to=ext-jani.1.nikula@nokia.com \ --cc=Tomi.Valkeinen@nokia.com \ --cc=linux-fbdev@vger.kernel.org \ --cc=linux-omap@vger.kernel.org \ --cc=tony@atomide.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.