From: Michael Hanselmann <linux-kernel@hansmi.ch>
To: Richard Purdie <rpurdie@rpsys.net>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
"Antonino A. Daplas" <adaplas@pol.net>
Subject: Re: [patch 5/6] Convert to use mutexes instead of semaphores
Date: Tue, 29 Aug 2006 22:54:32 +0200 [thread overview]
Message-ID: <20060829205432.GA13522@hansmi.ch> (raw)
In-Reply-To: <1155314751.25767.6.camel@localhost.localdomain>
On Fri, Aug 11, 2006 at 05:45:51PM +0100, Richard Purdie wrote:
> On Fri, 2006-08-11 at 10:07 -0400, Dmitry Torokhov wrote:
> > On 8/11/06, Michael Hanselmann <linux-kernel@hansmi.ch> wrote:
> > > Because I am responsible/wrote for the broken code, how should I
> > > proceed?
Somehow this got lost, sorry. The patch below fixes at least the
wrongly ordered up()/down() calls. I know there are outstanding with the
backlight code in general, but those issues aren't that easy to fix.
Is it okay? If yes, I'm going to send it to akpm.
Signed-off-by: Michael Hanselmann <linux-kernel@hansmi.ch>
---
diff -Nrup --exclude-from linux-exclude-from linux-2.6.18-rc5.orig/drivers/macintosh/via-pmu-backlight.c linux-2.6.18-rc5/drivers/macintosh/via-pmu-backlight.c
--- linux-2.6.18-rc5.orig/drivers/macintosh/via-pmu-backlight.c 2006-08-29 22:27:01.000000000 +0200
+++ linux-2.6.18-rc5/drivers/macintosh/via-pmu-backlight.c 2006-08-29 22:40:58.000000000 +0200
@@ -168,11 +168,11 @@ void __init pmu_backlight_init()
mutex_unlock(&info->bl_mutex);
}
- up(&bd->sem);
+ down(&bd->sem);
bd->props->brightness = level;
bd->props->power = FB_BLANK_UNBLANK;
bd->props->update_status(bd);
- down(&bd->sem);
+ up(&bd->sem);
mutex_lock(&pmac_backlight_mutex);
if (!pmac_backlight)
diff -Nrup --exclude-from linux-exclude-from linux-2.6.18-rc5.orig/drivers/video/aty/aty128fb.c linux-2.6.18-rc5/drivers/video/aty/aty128fb.c
--- linux-2.6.18-rc5.orig/drivers/video/aty/aty128fb.c 2006-08-29 22:27:01.000000000 +0200
+++ linux-2.6.18-rc5/drivers/video/aty/aty128fb.c 2006-08-29 22:41:24.000000000 +0200
@@ -1801,10 +1801,10 @@ static struct backlight_properties aty12
static void aty128_bl_set_power(struct fb_info *info, int power)
{
mutex_lock(&info->bl_mutex);
- up(&info->bl_dev->sem);
+ down(&info->bl_dev->sem);
info->bl_dev->props->power = power;
__aty128_bl_update_status(info->bl_dev);
- down(&info->bl_dev->sem);
+ up(&info->bl_dev->sem);
mutex_unlock(&info->bl_mutex);
}
@@ -1839,11 +1839,11 @@ static void aty128_bl_init(struct aty128
219 * FB_BACKLIGHT_MAX / MAX_LEVEL);
mutex_unlock(&info->bl_mutex);
- up(&bd->sem);
+ down(&bd->sem);
bd->props->brightness = aty128_bl_data.max_brightness;
bd->props->power = FB_BLANK_UNBLANK;
bd->props->update_status(bd);
- down(&bd->sem);
+ up(&bd->sem);
#ifdef CONFIG_PMAC_BACKLIGHT
mutex_lock(&pmac_backlight_mutex);
diff -Nrup --exclude-from linux-exclude-from linux-2.6.18-rc5.orig/drivers/video/aty/atyfb_base.c linux-2.6.18-rc5/drivers/video/aty/atyfb_base.c
--- linux-2.6.18-rc5.orig/drivers/video/aty/atyfb_base.c 2006-08-29 22:27:01.000000000 +0200
+++ linux-2.6.18-rc5/drivers/video/aty/atyfb_base.c 2006-08-29 22:41:47.000000000 +0200
@@ -2200,10 +2200,10 @@ static struct backlight_properties aty_b
static void aty_bl_set_power(struct fb_info *info, int power)
{
mutex_lock(&info->bl_mutex);
- up(&info->bl_dev->sem);
+ down(&info->bl_dev->sem);
info->bl_dev->props->power = power;
__aty_bl_update_status(info->bl_dev);
- down(&info->bl_dev->sem);
+ up(&info->bl_dev->sem);
mutex_unlock(&info->bl_mutex);
}
@@ -2234,11 +2234,11 @@ static void aty_bl_init(struct atyfb_par
0xFF * FB_BACKLIGHT_MAX / MAX_LEVEL);
mutex_unlock(&info->bl_mutex);
- up(&bd->sem);
+ down(&bd->sem);
bd->props->brightness = aty_bl_data.max_brightness;
bd->props->power = FB_BLANK_UNBLANK;
bd->props->update_status(bd);
- down(&bd->sem);
+ up(&bd->sem);
#ifdef CONFIG_PMAC_BACKLIGHT
mutex_lock(&pmac_backlight_mutex);
diff -Nrup --exclude-from linux-exclude-from linux-2.6.18-rc5.orig/drivers/video/aty/radeon_backlight.c linux-2.6.18-rc5/drivers/video/aty/radeon_backlight.c
--- linux-2.6.18-rc5.orig/drivers/video/aty/radeon_backlight.c 2006-08-29 22:27:01.000000000 +0200
+++ linux-2.6.18-rc5/drivers/video/aty/radeon_backlight.c 2006-08-29 22:39:23.000000000 +0200
@@ -195,11 +195,11 @@ void radeonfb_bl_init(struct radeonfb_in
217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL);
mutex_unlock(&rinfo->info->bl_mutex);
- up(&bd->sem);
+ down(&bd->sem);
bd->props->brightness = radeon_bl_data.max_brightness;
bd->props->power = FB_BLANK_UNBLANK;
bd->props->update_status(bd);
- down(&bd->sem);
+ up(&bd->sem);
#ifdef CONFIG_PMAC_BACKLIGHT
mutex_lock(&pmac_backlight_mutex);
diff -Nrup --exclude-from linux-exclude-from linux-2.6.18-rc5.orig/drivers/video/nvidia/nv_backlight.c linux-2.6.18-rc5/drivers/video/nvidia/nv_backlight.c
--- linux-2.6.18-rc5.orig/drivers/video/nvidia/nv_backlight.c 2006-08-29 22:27:01.000000000 +0200
+++ linux-2.6.18-rc5/drivers/video/nvidia/nv_backlight.c 2006-08-29 22:43:03.000000000 +0200
@@ -113,10 +113,10 @@ static struct backlight_properties nvidi
void nvidia_bl_set_power(struct fb_info *info, int power)
{
mutex_lock(&info->bl_mutex);
- up(&info->bl_dev->sem);
+ down(&info->bl_dev->sem);
info->bl_dev->props->power = power;
__nvidia_bl_update_status(info->bl_dev);
- down(&info->bl_dev->sem);
+ up(&info->bl_dev->sem);
mutex_unlock(&info->bl_mutex);
}
@@ -151,11 +151,11 @@ void nvidia_bl_init(struct nvidia_par *p
0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL);
mutex_unlock(&info->bl_mutex);
- up(&bd->sem);
+ down(&bd->sem);
bd->props->brightness = nvidia_bl_data.max_brightness;
bd->props->power = FB_BLANK_UNBLANK;
bd->props->update_status(bd);
- down(&bd->sem);
+ up(&bd->sem);
#ifdef CONFIG_PMAC_BACKLIGHT
mutex_lock(&pmac_backlight_mutex);
diff -Nrup --exclude-from linux-exclude-from linux-2.6.18-rc5.orig/drivers/video/riva/fbdev.c linux-2.6.18-rc5/drivers/video/riva/fbdev.c
--- linux-2.6.18-rc5.orig/drivers/video/riva/fbdev.c 2006-08-29 22:27:01.000000000 +0200
+++ linux-2.6.18-rc5/drivers/video/riva/fbdev.c 2006-08-29 22:43:26.000000000 +0200
@@ -355,10 +355,10 @@ static struct backlight_properties riva_
static void riva_bl_set_power(struct fb_info *info, int power)
{
mutex_lock(&info->bl_mutex);
- up(&info->bl_dev->sem);
+ down(&info->bl_dev->sem);
info->bl_dev->props->power = power;
__riva_bl_update_status(info->bl_dev);
- down(&info->bl_dev->sem);
+ up(&info->bl_dev->sem);
mutex_unlock(&info->bl_mutex);
}
@@ -393,11 +393,11 @@ static void riva_bl_init(struct riva_par
0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL);
mutex_unlock(&info->bl_mutex);
- up(&bd->sem);
+ down(&bd->sem);
bd->props->brightness = riva_bl_data.max_brightness;
bd->props->power = FB_BLANK_UNBLANK;
bd->props->update_status(bd);
- down(&bd->sem);
+ up(&bd->sem);
#ifdef CONFIG_PMAC_BACKLIGHT
mutex_lock(&pmac_backlight_mutex);
next prev parent reply other threads:[~2006-08-29 20:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-11 5:03 [patch 0/6] Backlight & lcd fixes/cleanups Dmitry Torokhov
2006-08-11 5:03 ` [patch 1/6] Convert to use default class device attributes Dmitry Torokhov
2006-08-11 5:03 ` [patch 2/6] Fix error handling when registering new device Dmitry Torokhov
2006-08-11 5:03 ` [patch 3/6] Get rid of excessive amount of likely()s Dmitry Torokhov
2006-08-11 5:03 ` [patch 4/6] Remove "owner" from backlight_properties structure Dmitry Torokhov
2006-08-11 5:03 ` [patch 5/6] Convert to use mutexes instead of semaphores Dmitry Torokhov
2006-08-11 12:58 ` Dmitry Torokhov
2006-08-11 13:16 ` Richard Purdie
2006-08-11 13:34 ` Dmitry Torokhov
2006-08-11 13:42 ` Michael Hanselmann
2006-08-11 14:07 ` Dmitry Torokhov
2006-08-11 16:45 ` Richard Purdie
2006-08-11 17:20 ` Dmitry Torokhov
2006-08-29 20:54 ` Michael Hanselmann [this message]
2006-08-11 5:03 ` [patch 6/6] Move per-device data out of backlight_properties Dmitry Torokhov
2006-08-11 8:02 ` Richard Purdie
2006-08-11 12:27 ` Dmitry Torokhov
2006-08-11 12:55 ` Richard Purdie
2006-08-11 13:10 ` Dmitry Torokhov
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=20060829205432.GA13522@hansmi.ch \
--to=linux-kernel@hansmi.ch \
--cc=adaplas@pol.net \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®