Skip to contentSkip to conversation

usb: reload watchdog during ums command

PATCH New Patrick Delaunay 2 participants 2 messages Apr 18, 2019 – Apr 19, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: reload watchdog during ums command

Reload the watchdog in the mass storage command ums to avoid reboot during the usb waiting loop when the host doesn't send any request.

---

 cmd/usb_mass_storage.c | 3 +++
 1 file changed, 3 insertions(+)
cmd/usb_mass_storage.c +3 -0
index 753ae4f..570cf3a 100644
@@ -14,6 +14,7 @@
 #include <part.h>
 #include <usb.h>
 #include <usb_mass_storage.h>
+#include <watchdog.h>
 
 static int ums_read_sector(struct ums *ums_dev,
 			   ulong start, lbaint_t blkcnt, void *buf)
@@ -226,6 +227,8 @@ static int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag,
 			rc = CMD_RET_SUCCESS;
 			goto cleanup_register;
 		}
+
+		WATCHDOG_RESET();
 	}
 
 cleanup_register:
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 usb: reload watchdog during ums command

Hi Patrick,

Quoted 23 lines

Reload the watchdog in the mass storage command ums to avoid reboot during the usb waiting loop when the host doesn't send any request.

---

 cmd/usb_mass_storage.c | 3 +++
 1 file changed, 3 insertions(+)
cmd/usb_mass_storage.c +1 -0
index 753ae4f..570cf3a 100644
@@ -14,6 +14,7 @@
 #include <part.h>
 #include <usb.h>
 #include <usb_mass_storage.h>
+#include <watchdog.h>
 
 static int ums_read_sector(struct ums *ums_dev,
 			   ulong start, lbaint_t blkcnt, void *buf)

cmd/usb_mass_storage.c static int do_usb_mass_storage(cmd_tbl_t *cmdtp, · line 234

Quoted 8 lines
cmd/usb_mass_storage.c +2 -0
@@ -226,6 +227,8 @@ static int do_usb_mass_storage(cmd_tbl_t *cmdtp,
 int flag, rc = CMD_RET_SUCCESS;
 			goto cleanup_register;
 		}
+
+		WATCHDOG_RESET();
 	}
 
 cleanup_register:

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190419/953af714/attachment.sig>