All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] leds-pwm: Defer PWM calls if PWM can sleep
@ 2013-01-28 14:00 ` Florian Vaussard
  0 siblings, 0 replies; 38+ messages in thread
From: Florian Vaussard @ 2013-01-28 14:00 UTC (permalink / raw)
  To: Bryan Wu, Richard Purdie, Thierry Reding
  Cc: Peter Ujfalusi, linux-leds, linux-arm-kernel, linux-kernel,
	Florian Vaussard

Hello,

When using the leds-pwm module with external PWM chips connected through
I2C, the kernel will panic when settings a trigger. In this case, PWM
calls can sleep, and should be deferred.

Patch 1 and 2 add the necessary API to the PWM subsystem, and update
matching drivers. Patch 3 updates leds-pwm to use a worker if the PWM
chip can sleep, or performs direct calls otherwise.

This patchset is based on the for-next branch of the led subsystem [1],
as patch 3 depends on the recent work of Peter for DT bindings in leds-pwm.
The pwm patches should probably follow the same path.

Tested on Overo (OMAP3 + TWL4030) with device tree.

Best regards,

Florian

[1] git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds.git

Changes from v2:
* pwm_cansleep -> pwm_can_sleep
* use bool for can_sleep member
* minor fixes

Changes from v1:
* pwm_can_sleep -> pwm_cansleep
* avoid duplicated code between the worker and the direct call
* cache the value of pwm_cansleep inside leds-pwm to avoid API calls

Florian Vaussard (3):
  pwm: Add pwm_can_sleep() as exported API to users
  pwm: Add can_sleep property to drivers
  leds: leds-pwm: Defer led_pwm_set() if PWM can sleep

 drivers/leds/leds-pwm.c   |   50 +++++++++++++++++++++++++++++++++++++-------
 drivers/pwm/core.c        |   12 ++++++++++
 drivers/pwm/pwm-twl-led.c |    1 +
 drivers/pwm/pwm-twl.c     |    1 +
 include/linux/pwm.h       |   10 +++++++++
 5 files changed, 66 insertions(+), 8 deletions(-)

-- 
1.7.5.4


^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2013-03-15 21:02 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-28 14:00 [PATCH v3 0/3] leds-pwm: Defer PWM calls if PWM can sleep Florian Vaussard
2013-01-28 14:00 ` Florian Vaussard
2013-01-28 14:00 ` [PATCH v3 1/3] pwm: Add pwm_can_sleep() as exported API to users Florian Vaussard
2013-01-28 14:00   ` Florian Vaussard
2013-01-29  8:20   ` Peter Ujfalusi
2013-01-29  8:20     ` Peter Ujfalusi
2013-01-30  8:14   ` Thierry Reding
2013-01-30  8:14     ` Thierry Reding
2013-01-28 14:00 ` [PATCH v3 2/3] pwm: Add can_sleep property to drivers Florian Vaussard
2013-01-28 14:00   ` Florian Vaussard
2013-01-30  8:15   ` Thierry Reding
2013-01-30  8:15     ` Thierry Reding
2013-01-28 14:00 ` [PATCH v3 3/3] leds: leds-pwm: Defer led_pwm_set() if PWM can sleep Florian Vaussard
2013-01-28 14:00   ` Florian Vaussard
2013-01-29  8:20   ` Peter Ujfalusi
2013-01-29  8:20     ` Peter Ujfalusi
2013-01-30  8:17   ` Thierry Reding
2013-01-30  8:17     ` Thierry Reding
2013-02-04  8:53     ` Florian Vaussard
2013-02-04  8:53       ` Florian Vaussard
2013-02-27 16:08     ` Florian Vaussard
2013-02-27 16:08       ` Florian Vaussard
2013-03-04 10:44       ` Florian Vaussard
2013-03-04 10:44         ` Florian Vaussard
2013-03-04 10:58         ` Thierry Reding
2013-03-04 10:58           ` Thierry Reding
2013-03-05 15:39           ` Florian Vaussard
2013-03-05 15:39             ` Florian Vaussard
2013-03-12 10:06           ` Florian Vaussard
2013-03-12 10:06             ` Florian Vaussard
2013-03-15 17:08             ` Bryan Wu
2013-03-15 17:08               ` Bryan Wu
2013-03-15 18:59               ` Thierry Reding
2013-03-15 18:59                 ` Thierry Reding
2013-03-15 20:09                 ` Florian Vaussard
2013-03-15 20:09                   ` Florian Vaussard
2013-03-15 21:02                   ` Bryan Wu
2013-03-15 21:02                     ` Bryan Wu

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.