mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-27 23:20:26 +09:00
mtd: spinand: Add WATCHDOG_RESET() in spinand_mtd_read/write()
In case of big area read/write on spi nand, watchdog timeout may occurs. To fix that, add WATCHDOG_RESET() in spinand_mtd_read() and spinand_mtd_write() to ensure that watchdog is reset. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
This commit is contained in:
parent
3f6cfdaa23
commit
de6f70a632
@ -22,6 +22,7 @@
|
|||||||
#else
|
#else
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <watchdog.h>
|
||||||
#include <spi.h>
|
#include <spi.h>
|
||||||
#include <spi-mem.h>
|
#include <spi-mem.h>
|
||||||
#include <dm/device_compat.h>
|
#include <dm/device_compat.h>
|
||||||
@ -578,6 +579,7 @@ static int spinand_mtd_read(struct mtd_info *mtd, loff_t from,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
nanddev_io_for_each_page(nand, from, ops, &iter) {
|
nanddev_io_for_each_page(nand, from, ops, &iter) {
|
||||||
|
WATCHDOG_RESET();
|
||||||
ret = spinand_select_target(spinand, iter.req.pos.target);
|
ret = spinand_select_target(spinand, iter.req.pos.target);
|
||||||
if (ret)
|
if (ret)
|
||||||
break;
|
break;
|
||||||
@ -629,6 +631,7 @@ static int spinand_mtd_write(struct mtd_info *mtd, loff_t to,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
nanddev_io_for_each_page(nand, to, ops, &iter) {
|
nanddev_io_for_each_page(nand, to, ops, &iter) {
|
||||||
|
WATCHDOG_RESET();
|
||||||
ret = spinand_select_target(spinand, iter.req.pos.target);
|
ret = spinand_select_target(spinand, iter.req.pos.target);
|
||||||
if (ret)
|
if (ret)
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user