mcffec_recv() returns its initial value of -1 when the receive ring is
empty at poll entry. net_lwip_rx() only treats -EAGAIN as a non-fatal
empty receive, so DHCP can abort on an idle poll now that it checks
net_lwip_poll().
Initialize the return value to -EAGAIN instead. Leave received-frame
processing, descriptor rearming and ring-index updates unchanged.
Fixes: 53a0ca3757fe ("net: lwip: finish DHCP before starting autoload")
Signed-off-by: James Hilliard <[email protected]>
---
drivers/net/mcffec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c
index 7e53492733e..b2b2a43c3de 100644
--- a/drivers/net/mcffec.c
+++ b/drivers/net/mcffec.c
@@ -430,7 +430,7 @@ static int mcffec_recv(struct udevice *dev, int flags,
uchar **packetp)
{
struct fec_info_s *info = dev_get_priv(dev);
volatile fec_t *fecp = (fec_t *)info->iobase;
- int length = -1;
+ int length = -EAGAIN;
for (;;) {
#ifdef CONFIG_SYS_UNIFY_CACHE
--
2.53.0