From: Patrice Chotard Date: Wed, 20 Jan 2021 13:42:02 +0000 (+0100) Subject: spi: stm32_qspi: Add WATCHDOG_RESET in _stm32_qspi_read_fifo() X-Git-Url: http://git.dujemihanovic.xyz/%22http:/www.sics.se/static/git-logo.png?a=commitdiff_plain;h=e48ec51b43ed0c9a4eb767addb829cef418041c7;p=u-boot.git spi: stm32_qspi: Add WATCHDOG_RESET in _stm32_qspi_read_fifo() In case of reading large area and memory-map mode is misconfigured (memory-map size declared lower than the real size of the memory chip) watchdog can be triggered. Add WATCHDOG_RESET() in _stm32_qspi_read_fifo to fix it. Issue reproduced with stm32mp157c-ev1 board and memory map size set to 1, with following command: sf read 0xC0000000 0 0x4000000 Signed-off-by: Patrice Chotard Reviewed-by: Patrick Delaunay --- diff --git a/drivers/spi/stm32_qspi.c b/drivers/spi/stm32_qspi.c index 75e5e840ed..4acc9047b9 100644 --- a/drivers/spi/stm32_qspi.c +++ b/drivers/spi/stm32_qspi.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -171,6 +172,7 @@ static int _stm32_qspi_wait_cmd(struct stm32_qspi_priv *priv, static void _stm32_qspi_read_fifo(u8 *val, void __iomem *addr) { *val = readb(addr); + WATCHDOG_RESET(); } static void _stm32_qspi_write_fifo(u8 *val, void __iomem *addr)