2008-11-24 09:51:56

by Guennadi Liakhovetski

[permalink] [raw]
Subject: leds/leds-pca9532.c: sleeping function called in .brightness_set()

Hi,

this seems to explicitly violate the API as documented in
include/linux/leds.h:

/* Set LED brightness level */
/* Must not sleep, use a workqueue if needed */
void (*brightness_set)(struct led_classdev *led_cdev,
enum led_brightness brightness);

and also contradicts some other drivers, e.g., pca955x, which do use a
workqueue as suggested: leds-pca9532.c::pca9532_set_brightness uses a
mutex for locking and calls i2c_smbus functions directly. Needs to be
fixed (if it hasn't been fixed yet), probably, also vor 2.6.27-stable.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.

DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: [email protected]


2008-12-03 10:04:22

by Richard Purdie

[permalink] [raw]
Subject: Re: leds/leds-pca9532.c: sleeping function called in .brightness_set()

On Mon, 2008-11-24 at 10:51 +0100, Guennadi Liakhovetski wrote:
> this seems to explicitly violate the API as documented in
> include/linux/leds.h:
>
> /* Set LED brightness level */
> /* Must not sleep, use a workqueue if needed */
> void (*brightness_set)(struct led_classdev *led_cdev,
> enum led_brightness brightness);
>
> and also contradicts some other drivers, e.g., pca955x, which do use a
> workqueue as suggested: leds-pca9532.c::pca9532_set_brightness uses a
> mutex for locking and calls i2c_smbus functions directly. Needs to be
> fixed (if it hasn't been fixed yet), probably, also vor 2.6.27-stable.

There is a patch queued to fix this now. I'll submit some fixes to
2.6.28-rcX shortly and then we can consider it for -stable.

Cheers,

Richard

--
Richard Purdie
Intel Open Source Technology Centre