The patch titled backlight last round of fixes has been added to the -mm tree. Its filename is backlight-last-round-of-fixes.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: backlight last round of fixes From: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> Fix some more problems (inverted use of semaphores in some places). He also moved my checks into within the protected section which is better. Signed-off-by: Michael Hanselmann <linux-kernel@xxxxxxxxx> Signed-off-by: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> Cc: "Antonino A. Daplas" <adaplas@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/macintosh/via-pmu-backlight.c | 4 ++-- drivers/video/aty/aty128fb.c | 19 ++++++++++--------- drivers/video/aty/atyfb_base.c | 19 ++++++++++--------- drivers/video/aty/radeon_backlight.c | 4 ++-- drivers/video/nvidia/nv_backlight.c | 18 ++++++++++-------- drivers/video/riva/fbdev.c | 19 ++++++++++--------- 6 files changed, 44 insertions(+), 39 deletions(-) diff -puN drivers/macintosh/via-pmu-backlight.c~backlight-last-round-of-fixes drivers/macintosh/via-pmu-backlight.c --- a/drivers/macintosh/via-pmu-backlight.c~backlight-last-round-of-fixes +++ a/drivers/macintosh/via-pmu-backlight.c @@ -167,11 +167,11 @@ void __init pmu_backlight_init() pmu_backlight_data.max_brightness / 15); } - 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 -puN drivers/video/aty/aty128fb.c~backlight-last-round-of-fixes drivers/video/aty/aty128fb.c --- a/drivers/video/aty/aty128fb.c~backlight-last-round-of-fixes +++ a/drivers/video/aty/aty128fb.c @@ -1800,14 +1800,15 @@ static struct backlight_properties aty12 static void aty128_bl_set_power(struct fb_info *info, int power) { - if (info->bl_dev == NULL) - return; - mutex_lock(&info->bl_mutex); - up(&info->bl_dev->sem); - info->bl_dev->props->power = power; - __aty128_bl_update_status(info->bl_dev); - down(&info->bl_dev->sem); + + if (info->bl_dev) { + down(&info->bl_dev->sem); + info->bl_dev->props->power = power; + __aty128_bl_update_status(info->bl_dev); + up(&info->bl_dev->sem); + } + mutex_unlock(&info->bl_mutex); } @@ -1842,11 +1843,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 -puN drivers/video/aty/atyfb_base.c~backlight-last-round-of-fixes drivers/video/aty/atyfb_base.c --- a/drivers/video/aty/atyfb_base.c~backlight-last-round-of-fixes +++ a/drivers/video/aty/atyfb_base.c @@ -2199,14 +2199,15 @@ static struct backlight_properties aty_b static void aty_bl_set_power(struct fb_info *info, int power) { - if (info->bl_dev == NULL) - return; - mutex_lock(&info->bl_mutex); - up(&info->bl_dev->sem); - info->bl_dev->props->power = power; - __aty_bl_update_status(info->bl_dev); - down(&info->bl_dev->sem); + + if (info->bl_dev) { + down(&info->bl_dev->sem); + info->bl_dev->props->power = power; + __aty_bl_update_status(info->bl_dev); + up(&info->bl_dev->sem); + } + mutex_unlock(&info->bl_mutex); } @@ -2237,11 +2238,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 -puN drivers/video/aty/radeon_backlight.c~backlight-last-round-of-fixes drivers/video/aty/radeon_backlight.c --- a/drivers/video/aty/radeon_backlight.c~backlight-last-round-of-fixes +++ a/drivers/video/aty/radeon_backlight.c @@ -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 -puN drivers/video/nvidia/nv_backlight.c~backlight-last-round-of-fixes drivers/video/nvidia/nv_backlight.c --- a/drivers/video/nvidia/nv_backlight.c~backlight-last-round-of-fixes +++ a/drivers/video/nvidia/nv_backlight.c @@ -112,13 +112,15 @@ static struct backlight_properties nvidi void nvidia_bl_set_power(struct fb_info *info, int power) { - if (info->bl_dev == NULL) - return; mutex_lock(&info->bl_mutex); - up(&info->bl_dev->sem); - info->bl_dev->props->power = power; - __nvidia_bl_update_status(info->bl_dev); - down(&info->bl_dev->sem); + + if (info->bl_dev) { + down(&info->bl_dev->sem); + info->bl_dev->props->power = power; + __nvidia_bl_update_status(info->bl_dev); + up(&info->bl_dev->sem); + } + mutex_unlock(&info->bl_mutex); } @@ -153,11 +155,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 -puN drivers/video/riva/fbdev.c~backlight-last-round-of-fixes drivers/video/riva/fbdev.c --- a/drivers/video/riva/fbdev.c~backlight-last-round-of-fixes +++ a/drivers/video/riva/fbdev.c @@ -354,14 +354,15 @@ static struct backlight_properties riva_ static void riva_bl_set_power(struct fb_info *info, int power) { - if (info->bl_dev == NULL) - return; - mutex_lock(&info->bl_mutex); - up(&info->bl_dev->sem); - info->bl_dev->props->power = power; - __riva_bl_update_status(info->bl_dev); - down(&info->bl_dev->sem); + + if (info->bl_dev) { + down(&info->bl_dev->sem); + info->bl_dev->props->power = power; + __riva_bl_update_status(info->bl_dev); + up(&info->bl_dev->sem); + } + mutex_unlock(&info->bl_mutex); } @@ -396,11 +397,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); _ Patches currently in -mm which might be from benh@xxxxxxxxxxxxxxxxxxx are origin.patch exit-early-in-floppy_init-when-no-floppy-exists.patch powerpc-more-via-pmu-backlight-fixes.patch powerpc-fix-powermac-irq-handling-bug.patch backlight-last-round-of-fixes.patch macintosh-mangle-caps-lock-events-on-adb-keyboards.patch git-powerpc.patch introduce-mechanism-for-registering-active-regions-of-memory.patch have-power-use-add_active_range-and-free_area_init_nodes.patch have-x86-use-add_active_range-and-free_area_init_nodes.patch have-x86-use-add_active_range-and-free_area_init_nodes-fix.patch have-x86_64-use-add_active_range-and-free_area_init_nodes.patch have-ia64-use-add_active_range-and-free_area_init_nodes.patch account-for-memmap-and-optionally-the-kernel-image-as-holes.patch make-prot_write-imply-prot_read.patch apple-motion-sensor-driver-2.patch simplify-update_times-avoid-jiffies-jiffies_64-aliasing-problem-2.patch windfarm_smu_satc-simplify-around-i2c_add_driver.patch introduce-kernel_execve.patch rename-the-provided-execve-functions-to-kernel_execve.patch provide-kernel_execve-on-all-architectures.patch provide-kernel_execve-on-all-architectures-fix.patch remove-the-use-of-_syscallx-macros-in-uml.patch sh64-remove-the-use-of-kernel-syscalls.patch remove-remaining-errno-and-__kernel_syscalls__-references.patch genirq-convert-the-x86_64-architecture-to-irq-chips.patch genirq-convert-the-i386-architecture-to-irq-chips.patch genirq-irq-convert-the-move_irq-flag-from-a-32bit-word-to-a-single-bit.patch genirq-irq-add-moved_masked_irq.patch genirq-x86_64-irq-reenable-migrating-irqs-to-other-cpus.patch genirq-msi-simplify-msi-enable-and-disable.patch genirq-msi-make-the-msi-boolean-tests-return-either-0-or-1.patch genirq-msi-implement-helper-functions-read_msi_msg-and-write_msi_msg.patch genirq-msi-refactor-the-msi_ops.patch genirq-msi-simplify-the-msi-irq-limit-policy.patch genirq-irq-add-a-dynamic-irq-creation-api.patch genirq-ia64-irq-dynamic-irq-support.patch genirq-i386-irq-dynamic-irq-support.patch genirq-x86_64-irq-dynamic-irq-support.patch genirq-msi-make-the-msi-code-irq-based-and-not-vector-based.patch genirq-x86_64-irq-move-msi-message-composition-into-io_apicc.patch genirq-i386-irq-move-msi-message-composition-into-io_apicc.patch genirq-msi-only-build-msi-apicc-on-ia64.patch genirq-x86_64-irq-remove-the-msi-assumption-that-irq-==-vector.patch genirq-i386-irq-remove-the-msi-assumption-that-irq-==-vector.patch genirq-irq-remove-msi-hacks.patch genirq-irq-generalize-the-check-for-hardirq_bits.patch genirq-x86_64-irq-make-the-external-irq-handlers-report-their-vector-not-the-irq-number.patch genirq-x86_64-irq-make-vector_irq-per-cpu.patch genirq-x86_64-irq-make-vector_irq-per-cpu-warning-fix.patch genirq-x86_64-irq-kill-gsi_irq_sharing.patch genirq-x86_64-irq-kill-irq-compression.patch add-hypertransport-capability-defines.patch add-hypertransport-capability-defines-fix.patch initial-generic-hypertransport-interrupt-support.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html