Message ID | 20210120134205.30488-2-patrice.chotard@foss.st.com |
---|---|
State | Accepted |
Delegated to: | Patrice Chotard |
Headers | show |
Series | Add WATCHDOG_RESET() in MTD framework and STM32 QSPI driver | expand |
Hi Patrice, On 1/20/21 2:42 PM, Patrice Chotard wrote: > In case of big area write/erase on spi nor, watchdog timeout may occurs. > Issue reproduced on stm32mp157c-ev1 with following commands: > > sf write 0xC0000000 0 0x3000000 > or > sf erase 0 0x1000000 > > Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> > --- > > drivers/mtd/spi/spi-nor-core.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c > index eb49a6c11c..51e0613d4c 100644 > --- a/drivers/mtd/spi/spi-nor-core.c > +++ b/drivers/mtd/spi/spi-nor-core.c > @@ -10,6 +10,7 @@ > */ > > #include <common.h> > +#include <watchdog.h> > #include <linux/err.h> > #include <linux/errno.h> > #include <linux/log2.h> > @@ -557,6 +558,7 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr) > len = instr->len; > > while (len) { > + WATCHDOG_RESET(); > #ifdef CONFIG_SPI_FLASH_BAR > ret = write_bar(nor, addr); > if (ret < 0) > @@ -1235,6 +1237,7 @@ static int spi_nor_write(struct mtd_info *mtd, loff_t to, size_t len, > for (i = 0; i < len; ) { > ssize_t written; > loff_t addr = to + i; > + WATCHDOG_RESET(); > > /* > * If page_size is a power of two, the offset can be quickly Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Thanks Patrick
Hi On 1/27/21 4:14 PM, Patrick DELAUNAY wrote: > Hi Patrice, > > On 1/20/21 2:42 PM, Patrice Chotard wrote: >> In case of big area write/erase on spi nor, watchdog timeout may occurs. >> Issue reproduced on stm32mp157c-ev1 with following commands: >> >> sf write 0xC0000000 0 0x3000000 >> or >> sf erase 0 0x1000000 >> >> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> >> --- >> >> drivers/mtd/spi/spi-nor-core.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c >> index eb49a6c11c..51e0613d4c 100644 >> --- a/drivers/mtd/spi/spi-nor-core.c >> +++ b/drivers/mtd/spi/spi-nor-core.c >> @@ -10,6 +10,7 @@ >> */ >> #include <common.h> >> +#include <watchdog.h> >> #include <linux/err.h> >> #include <linux/errno.h> >> #include <linux/log2.h> >> @@ -557,6 +558,7 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr) >> len = instr->len; >> while (len) { >> + WATCHDOG_RESET(); >> #ifdef CONFIG_SPI_FLASH_BAR >> ret = write_bar(nor, addr); >> if (ret < 0) >> @@ -1235,6 +1237,7 @@ static int spi_nor_write(struct mtd_info *mtd, loff_t to, size_t len, >> for (i = 0; i < len; ) { >> ssize_t written; >> loff_t addr = to + i; >> + WATCHDOG_RESET(); >> /* >> * If page_size is a power of two, the offset can be quickly > > > Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> > > Thanks > > Patrick > > Applied to u-boot-stm/next Thanks Patrice
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index eb49a6c11c..51e0613d4c 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -10,6 +10,7 @@ */ #include <common.h> +#include <watchdog.h> #include <linux/err.h> #include <linux/errno.h> #include <linux/log2.h> @@ -557,6 +558,7 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr) len = instr->len; while (len) { + WATCHDOG_RESET(); #ifdef CONFIG_SPI_FLASH_BAR ret = write_bar(nor, addr); if (ret < 0) @@ -1235,6 +1237,7 @@ static int spi_nor_write(struct mtd_info *mtd, loff_t to, size_t len, for (i = 0; i < len; ) { ssize_t written; loff_t addr = to + i; + WATCHDOG_RESET(); /* * If page_size is a power of two, the offset can be quickly
In case of big area write/erase on spi nor, watchdog timeout may occurs. Issue reproduced on stm32mp157c-ev1 with following commands: sf write 0xC0000000 0 0x3000000 or sf erase 0 0x1000000 Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> --- drivers/mtd/spi/spi-nor-core.c | 3 +++ 1 file changed, 3 insertions(+)