diff options
author | Uwe Kleine-König <[email protected]> | 2024-07-09 12:18:05 +0200 |
---|---|---|
committer | Uwe Kleine-König <[email protected]> | 2024-07-10 17:51:04 +0200 |
commit | 37f7707077f5ea2515bf4b1dc7fad43f8e12993e (patch) | |
tree | 90f97bd93a52b38895a567a991fe65a0df575117 /tools/perf/util/scripting-engines/trace-event-python.c | |
parent | 32207e9ddf7400a5676cb27559560cadee062577 (diff) |
pwm: atmel-tcb: Fix race condition and convert to guards
The hardware only supports a single period length for both PWM outputs. So
atmel_tcb_pwm_config() checks the configuration of the other output if it's
compatible with the currently requested setting. The register values are
then actually updated in atmel_tcb_pwm_enable(). To make this race free
the lock must be held during the whole process, so grab the lock in
.apply() instead of individually in atmel_tcb_pwm_disable() and
atmel_tcb_pwm_enable() which then also covers atmel_tcb_pwm_config().
To simplify handling, use the guard helper to let the compiler care for
unlocking. Otherwise unlocking would be more difficult as there is more
than one exit path in atmel_tcb_pwm_apply().
Fixes: 9421bade0765 ("pwm: atmel: add Timer Counter Block PWM driver")
Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Uwe Kleine-König <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions