Skip to content

Commit 1bb5a99

Browse files
billy-tsaiBartosz Golaszewski
authored andcommitted
gpio: aspeed: Add the flush write to ensure the write complete.
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: 361b791 ("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>
1 parent 8cf0b93 commit 1bb5a99

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/gpio/gpio-aspeed.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,8 @@ static void __aspeed_gpio_set(struct gpio_chip *gc, unsigned int offset,
406406
gpio->dcache[GPIO_BANK(offset)] = reg;
407407

408408
iowrite32(reg, addr);
409+
/* Flush write */
410+
ioread32(addr);
409411
}
410412

411413
static void aspeed_gpio_set(struct gpio_chip *gc, unsigned int offset,

0 commit comments

Comments
 (0)