Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

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 <[email protected]> Signed-off-by: Billy Tsai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 8cf0b93 commit 1bb5a99

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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)