diff options
| author | Shawn Guo <shengchao.guo@oss.qualcomm.com> | 2026-10-28 20:34:48 +0800 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-11-02 10:44:38 +0100 |
| commit | 925409db963dbae4628d522bc6b14985e749c08b (patch) | |
| tree | 94a2d5662136cf3ebd9c6c8cbd6035a43cc27229 /rust/kernel/alloc/kvec/errors.rs | |
| parent | 0bc45604403176722e634e670f5e38de0aa42a9b (diff) | |
gpio: shared-proxy: Drop the vote when switching to input
A proxy that is the only one to have configured a shared line may
reinitialize it. When it sets the direction to output, the proxy
resets the vote tally, but when it sets the direction to input, it
leaves any vote it cast in place, although an input line carries no
value.
That vote outlives its meaning. When the consumer releases the line,
gpio_shared_proxy_free() tries to withdraw it by writing the default
value, which gpiolib refuses on an input line:
Failed to unset the shared GPIO value on release: -1
This happens, for instance, when a consumer votes for a change with
gpiod_set_value() after setting the line to output and then switches
it to input.
Clear the vote when the proxy reinitializes the line as input, as
the output path already does. No other proxy can hold a vote at that
point: voting marks a proxy configured, and a proxy that frees the
line drops its vote.
Fixes: e992d54c6f97 ("gpio: shared-proxy: implement the shared GPIO proxy driver")
Signed-off-by: Shawn Guo <shengchao.guo@oss.qualcomm.com>
Link: https://patch.msgid.link/20261028123448.510401-5-shengchao.guo@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Diffstat (limited to 'rust/kernel/alloc/kvec/errors.rs')
0 files changed, 0 insertions, 0 deletions
