__mvgbe_recv() returns -1 when its receive descriptor remains owned by
DMA throughout the polling loop. 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().

Return -EAGAIN when no packet becomes available. Preserve the existing
polling limit, received-frame checks and descriptor handling.

Fixes: 53a0ca3757fe ("net: lwip: finish DHCP before starting autoload")
Signed-off-by: James Hilliard <[email protected]>
---
 drivers/net/mvgbe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c
index 4dc738980cb..c37f67a4334 100644
--- a/drivers/net/mvgbe.c
+++ b/drivers/net/mvgbe.c
@@ -569,7 +569,7 @@ static int __mvgbe_recv(struct mvgbe_device *dmvgbe, uchar 
**packetp)
                        timeout++;
                else {
                        debug("%s time out...\n", __func__);
-                       return -1;
+                       return -EAGAIN;
                }
        } while (readl(&p_rxdesc_curr->cmd_sts) & MVGBE_BUFFER_OWNED_BY_DMA);
 

-- 
2.53.0

Reply via email to