Re: [RFC PATCH 00/15] pwm: add support for atomic update

From
Thierry Reding <hidden>
Date
2015-07-20 07:43:41
Also in
linux-arm-kernel, linux-leds, linux-pwm, linux-tegra
Reply to
Boris Brezillon, 2015-07-01
On Wed, Jul 01, 2015 at 10:21:46AM +0200, Boris Brezillon wrote:
Hello Thierry,

This series adds support for atomic PWM update, or ITO, the capability
to update all the parameters of a PWM device (enabled/disabled, period,
duty and polarity) in one go.

This implementation is still experimental, and I may have missed some key
aspect, so any feedback are welcome.

Also note that I haven't protected the state update with any locking.
That's because the existing config does not protect against concurrent
access to a requested PWM device (see the pwm_config implementation).
I guess the PWM framework assume the user will implement the proper locking
scheme if it has to concurrently access the device.
Actually the reason why no protection is needed is because there can
ever only be a single user of a PWM channel. pwm_request() will only
hand out a handle to the PWM channel if it hasn't been requested
before.

And in the unlikely case where a single user wants to use the same PWM
channel from different threads, then it will have to use locking for
other reasons already, so accesses to the PWM can be serialized using
the same mechanism.

Thierry

Attachments

Thread (68 messages) 68 messages, 6 authors, 2015-07-20
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help