Re: [patch 5/6] Convert to use mutexes instead of semaphores



On Fri, 2006-08-11 at 08:58 -0400, Dmitry Torokhov wrote:
On 8/11/06, Dmitry Torokhov <dtor@xxxxxxxxxxxxx> wrote:
Backlight: convert to use mutexes instead of semaphores


Apparently I missed that several drivers also use bd->sem so they need
to be converted too... But what is it with the drivers:

static void aty128_bl_set_power(struct fb_info *info, int power)
{
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);
mutex_unlock(&info->bl_mutex);
}

Why we are doing up() before down()??? And it is in almost every
driver that uses backlight... Do I need more coffee? [CC-ing bunch of
people trying to get an answer...]

It looks totally wrong.

In the archives, there are a number of comments from me questioning
whether that driver needs to touch bl_dev->sem anyway (esp. given the
mutex as well). I never did find out what it was trying to protect
against...

Richard

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Canon Bjc_4300 error!
    ... Have you tried updating the printer drivers for your printer? ... To get more information and resources about how to help protect ... >> Go into the Printers folder of the Control Panel, and delete the Canon ... >> Microsoft MVP - Windows XP Shell/User ...
    (microsoft.public.windows.mediacenter)
  • Re: her chairman was scottish, delightful, and practises within the festival
    ... the stresss often protect regarding the adjacent drivers. ... He'll be forming against flat Ibraheem until his holding speaks slightly. ...
    (sci.crypt)
  • Re: Windows Display Problems
    ... whilst you have finally installed vid drivers from Dell did you ... practice "Safe Hex", ... http://www.microsoft.com/security/protect/default.asp - Protect Your PC ...
    (microsoft.public.windowsxp.basics)
  • Re: Format question
    ... you don't protect anything - nor do you want to. ... "Jay Cee" wrote in message ... > drivers, etc. also i had a problem with the video card during the original ...
    (microsoft.public.windowsxp.basics)
  • Re: support cd for additional print drivers
    ... Microsoft MVP- Windows Shell/User ... Folder customizations ... I thought the additional drivers the help menu talked aabout came with XP. ... >> Protect your PC! ...
    (microsoft.public.windowsxp.general)