summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc/kvec/errors.rs
diff options
context:
space:
mode:
authorShawn Guo <shengchao.guo@oss.qualcomm.com>2026-10-28 20:34:47 +0800
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>2026-11-02 10:44:38 +0100
commit0bc45604403176722e634e670f5e38de0aa42a9b (patch)
treee35502b69dc1d911c6e81b30fdfbedcbf05db33f /rust/kernel/alloc/kvec/errors.rs
parent53b7b1201964f6f147fa0fa2f61194403a65cdf0 (diff)
gpio: shared-proxy: Drive the default value when no votes are cast
A consumer that requests a shared line with GPIOD_ASIS never calls direction_output(), so def_val keeps its initial value of 0. If the line was left high, for instance by the bootloader, a later gpiod_set_value(0) from that consumer matches def_val and the proxy treats it as withdrawing a vote it never cast. It returns success without writing the hardware, and the line stays high. The consumer has no way to tell. Its request to drive the line low is silently ignored until it first votes for high and then withdraws that vote. When the requested value is the default and no votes are outstanding, write it to the hardware instead of returning early. With votes outstanding the request remains a no-op, as the line must stay at the voted value. Do this for all lines, not only GPIOD_ASIS ones. A line configured via direction_output() can be left at the non-default value as well: when a proxy releases the line and restoring the default fails, its vote is dropped regardless, leaving votecnt at 0 with the line at the voted value. The write lets any remaining user bring it back to the default. In the common case it is a redundant write of the value the line already has, and it only happens when a proxy that has not voted sets the default. 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-4-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