]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpio: aspeed: Add the flush write to ensure the write complete.
authorBilly Tsai <billy_tsai@aspeedtech.com>
Tue, 8 Oct 2024 08:14:44 +0000 (16:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:11:55 +0000 (15:11 +0200)
commita82f6a31b1cbda29769b2bfbaf24fc48c3b26682
tree6f98e377483027924f19ad8e346c5a56590e8d81
parent043b681d76133e65546ae2ebbb3d9436208195ba
gpio: aspeed: Add the flush write to ensure the write complete.

[ Upstream commit 1bb5a99e1f3fd27accb804aa0443a789161f843c ]

Performing a dummy read ensures that the register write operation is fully
completed, mitigating any potential bus delays that could otherwise impact
the frequency of bitbang usage. E.g., if the JTAG application uses GPIO to
control the JTAG pins (TCK, TMS, TDI, TDO, and TRST), and the application
sets the TCK clock to 1 MHz, the GPIO's high/low transitions will rely on
a delay function to ensure the clock frequency does not exceed 1 MHz.
However, this can lead to rapid toggling of the GPIO because the write
operation is POSTed and does not wait for a bus acknowledgment.

Fixes: 361b79119a4b ("gpio: Add Aspeed driver")
Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Link: https://lore.kernel.org/r/20241008081450.1490955-2-billy_tsai@aspeedtech.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpio-aspeed.c