[U-Boot] [PATCH v4 1/6] mtd: spi-nor: add watchdog reset to flash operation loops

Jagan Teki jagan at amarulasolutions.com
Mon Jul 15 07:28:57 UTC 2019


+ Vignesh

On Wed, Jul 10, 2019 at 8:49 AM Weijie Gao <weijie.gao at mediatek.com> wrote:
>
> This patch adds WATCHDOG_RESET() to loops for read/write/erase to avoid
> watchdog not being feeded in a long period.
>
> Cc: Vignesh Raghavendra <vigneshr at ti.com>
> Signed-off-by: Weijie Gao <weijie.gao at mediatek.com>
> ---
>  drivers/mtd/spi/spi-nor-core.c | 13 +++++++++++++
>  drivers/mtd/spi/spi-nor-tiny.c |  3 +++
>  2 files changed, 16 insertions(+)
>
> diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
> index 1acff745d1a..2049661f3ad 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>
> @@ -103,6 +104,8 @@ static ssize_t spi_nor_read_data(struct spi_nor *nor, loff_t from, size_t len,
>                 op.addr.val += op.data.nbytes;
>                 remaining -= op.data.nbytes;
>                 op.data.buf.in += op.data.nbytes;
> +
> +               WATCHDOG_RESET();
>         }

Not sure, but it would require better testing.


More information about the U-Boot mailing list