summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorTim Harvey <[email protected]>2025-05-30 08:38:22 -0700
committerJerome Forissier <[email protected]>2025-07-08 09:53:59 +0200
commit08a8d1455a0f5f3ac7c2692a0b9ae6e98aea0291 (patch)
tree40838ea5c451388cd1e9d75ff92be204f8bbf556 /net
parentb379335f141e3ddca0cdbb5d9d39af0444530542 (diff)
net: lwip: call sys_check_timeouts and schedule on rx
Call schedule() in net_lwip_rx() to service U-Boot tasks and actions during packet rx. As a cleanup also move sys_check_timeouts() here and remove it from the functions that call net_lwip_rx(). This resolves the issue of an active watchdog resetting the board on long network activities. Suggested-by: Jerome Forissier <[email protected]> Signed-off-by: Tim Harvey <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
Diffstat (limited to 'net')
-rw-r--r--net/lwip/dhcp.c1
-rw-r--r--net/lwip/dns.c1
-rw-r--r--net/lwip/net-lwip.c7
-rw-r--r--net/lwip/ping.c1
-rw-r--r--net/lwip/tftp.c1
-rw-r--r--net/lwip/wget.c1
6 files changed, 7 insertions, 5 deletions
diff --git a/net/lwip/dhcp.c b/net/lwip/dhcp.c
index 043d2ab6e94..4c9cb0ecaa0 100644
--- a/net/lwip/dhcp.c
+++ b/net/lwip/dhcp.c
@@ -58,7 +58,6 @@ static int dhcp_loop(struct udevice *udev)
/* Wait for DHCP to complete */
do {
net_lwip_rx(udev, netif);
- sys_check_timeouts();
bound = dhcp_supplied_address(netif);
if (bound)
break;
diff --git a/net/lwip/dns.c b/net/lwip/dns.c
index 6862869d9e3..3c9867902db 100644
--- a/net/lwip/dns.c
+++ b/net/lwip/dns.c
@@ -92,7 +92,6 @@ static int dns_loop(struct udevice *udev, const char *name, const char *var)
net_lwip_rx(udev, netif);
if (dns_cb_arg.done)
break;
- sys_check_timeouts();
if (ctrlc()) {
printf("\nAbort\n");
break;
diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c
index abc52b32049..ff4d634d1d1 100644
--- a/net/lwip/net-lwip.c
+++ b/net/lwip/net-lwip.c
@@ -14,8 +14,10 @@
#include <lwip/etharp.h>
#include <lwip/init.h>
#include <lwip/prot/etharp.h>
+#include <lwip/timeouts.h>
#include <net.h>
#include <timer.h>
+#include <u-boot/schedule.h>
/* xx:xx:xx:xx:xx:xx\0 */
#define MAC_ADDR_STRLEN 18
@@ -285,6 +287,11 @@ int net_lwip_rx(struct udevice *udev, struct netif *netif)
int len;
int i;
+ /* lwIP timers */
+ sys_check_timeouts();
+ /* Other tasks and actions */
+ schedule();
+
if (!eth_is_active(udev))
return -EINVAL;
diff --git a/net/lwip/ping.c b/net/lwip/ping.c
index d8042ceecf9..1390b914f7d 100644
--- a/net/lwip/ping.c
+++ b/net/lwip/ping.c
@@ -136,7 +136,6 @@ static int ping_loop(struct udevice *udev, const ip_addr_t *addr)
ping_send(&ctx);
do {
- sys_check_timeouts();
net_lwip_rx(udev, netif);
if (ctx.alive)
break;
diff --git a/net/lwip/tftp.c b/net/lwip/tftp.c
index b7eb486ef77..27914522722 100644
--- a/net/lwip/tftp.c
+++ b/net/lwip/tftp.c
@@ -201,7 +201,6 @@ static int tftp_loop(struct udevice *udev, ulong addr, char *fname,
sys_timeout(NO_RSP_TIMEOUT_MS, no_response, &ctx);
while (!ctx.done) {
net_lwip_rx(udev, netif);
- sys_check_timeouts();
if (ctrlc()) {
printf("\nAbort\n");
ctx.done = ABORTED;
diff --git a/net/lwip/wget.c b/net/lwip/wget.c
index f4fd9718285..3c39a1b59a6 100644
--- a/net/lwip/wget.c
+++ b/net/lwip/wget.c
@@ -526,7 +526,6 @@ int wget_do_request(ulong dst_addr, char *uri)
while (!ctx.done) {
net_lwip_rx(udev, netif);
- sys_check_timeouts();
if (ctrlc())
break;
}