linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: florian.vaussard@epfl.ch (Florian Vaussard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 0/3] leds-pwm: Defer PWM calls if PWM can sleep
Date: Fri, 25 Jan 2013 14:44:28 +0100	[thread overview]
Message-ID: <1359121471-21457-1-git-send-email-florian.vaussard@epfl.ch> (raw)

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 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_cansleep() 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

             reply	other threads:[~2013-01-25 13:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-25 13:44 Florian Vaussard [this message]
2013-01-25 13:44 ` [PATCH v2 1/3] pwm: Add pwm_cansleep() as exported API to users Florian Vaussard
2013-01-25 13:51   ` Peter Ujfalusi
2013-01-26  5:40   ` Thierry Reding
2013-01-28  8:45     ` Peter Ujfalusi
2013-01-28  9:36       ` Florian Vaussard
2013-01-28  9:57         ` Thierry Reding
2013-01-28 10:57           ` Florian Vaussard
2013-01-28 13:16             ` Thierry Reding
2013-01-28 15:01         ` Russell King - ARM Linux
2013-01-28 15:46           ` Florian Vaussard
2013-01-25 13:44 ` [PATCH v2 2/3] pwm: Add can_sleep property to drivers Florian Vaussard
2013-01-25 13:51   ` Peter Ujfalusi
2013-01-25 13:44 ` [PATCH v2 3/3] leds: leds-pwm: Defer led_pwm_set() if PWM can sleep Florian Vaussard
2013-01-25 13:52   ` Peter Ujfalusi

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=1359121471-21457-1-git-send-email-florian.vaussard@epfl.ch \
    --to=florian.vaussard@epfl.ch \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).