diff options
author | Uwe Kleine-König <u.kleine-koenig@baylibre.com> | 2024-09-20 10:57:57 +0200 |
---|---|---|
committer | Uwe Kleine-König <ukleinek@kernel.org> | 2024-09-27 17:03:15 +0200 |
commit | 1cc2e1faafb3b5a2be25112559bdb495736b5af7 (patch) | |
tree | 61897cfec378c08e04fd8a5c9bd84a3d037ddb0b /include/rdma/ib_cm.h | |
parent | d242feaf81d63b25d8c1fb1a68738dc33966a376 (diff) |
pwm: Add more locking
This ensures that a pwm_chip that has no corresponding driver isn't used
and that a driver doesn't go away while a callback is still running.
In the presence of device links this isn't necessary yet (so this is no
fix) but for pwm character device support this is needed.
To not serialize all pwm_apply_state() calls, this introduces a per chip
lock. An additional complication is that for atomic chips a mutex cannot
be used (as pwm_apply_atomic() must not sleep) and a spinlock cannot be
held while calling an operation for a sleeping chip. So depending on the
chip being atomic or not a spinlock or a mutex is used.
An additional change implemented here is that on driver remove the
.free() callback is called for each requested pwm_device. This is the
right time because later (e.g. when the consumer calls pwm_put()) the
free function is (maybe) not available any more.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/026aa891c8270a11723a1ba7e4256f456f7e1e86.1726819463.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
Diffstat (limited to 'include/rdma/ib_cm.h')
0 files changed, 0 insertions, 0 deletions