summaryrefslogtreecommitdiff
path: root/rust/helpers/helpers.c
diff options
context:
space:
mode:
authorJohan Korsnes <johan.korsnes@remarkable.no>2025-02-17 10:16:43 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-03-13 13:01:39 +0100
commitc13e4b0321ed8d91bf43d8d8396f7ee5c06c9bcc (patch)
treec1831d501ac36727cc5a5c1dc6fb6775d876d336 /rust/helpers/helpers.c
parent5d473aefbcd3c772d085e2124b91174c87bf8d3b (diff)
gpio: vf610: add locking to gpio direction functions
[ Upstream commit 4e667a1968099c6deadee2313ecd648f8f0a8956 ] Add locking to `vf610_gpio_direction_input|output()` functions. Without this locking, a race condition exists between concurrent calls to these functions, potentially leading to incorrect GPIO direction settings. To verify the correctness of this fix, a `trylock` patch was applied, where after a couple of reboots the race was confirmed. I.e., one user had to wait before acquiring the lock. With this patch the race has not been encountered. It's worth mentioning that any type of debugging (printing, tracing, etc.) would "resolve"/hide the issue. Fixes: 659d8a62311f ("gpio: vf610: add imx7ulp support") Signed-off-by: Johan Korsnes <johan.korsnes@remarkable.no> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Haibo Chen <haibo.chen@nxp.com> Cc: Bartosz Golaszewski <brgl@bgdev.pl> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20250217091643.679644-1-johan.korsnes@remarkable.no Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions