DHCP exits without acquiring an address on BeagleBone Black with lwIP
enabled after DHCP started checking the return value of net_lwip_poll().
cpdma_process() returns -EBUSY while the receive descriptor is still owned
by DMA. _cpsw_recv() passes that value through, but net_lwip_rx() only
converts -EAGAIN to a non-fatal empty receive. DHCP therefore aborts on a
normal poll with no packet ready.
Translate -EBUSY to -EAGAIN in _cpsw_recv(), following the Ethernet receive
interface's no-packet convention. Leave other errors and the shared CPDMA
helper's transmit behavior unchanged.
Fixes: 53a0ca3757fe ("net: lwip: finish DHCP before starting autoload")
Reported-by: Tom Rini <[email protected]>
Closes: https://lore.kernel.org/r/20261012200814.GA3799261@bill-the-cat
Signed-off-by: James Hilliard <[email protected]>
Tested-by: Tom Rini <[email protected]>
---
drivers/net/ti/cpsw.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ti/cpsw.c b/drivers/net/ti/cpsw.c
index 6b1f7764e0d..4d7869f405c 100644
--- a/drivers/net/ti/cpsw.c
+++ b/drivers/net/ti/cpsw.c
@@ -808,6 +808,8 @@ static int _cpsw_recv(struct cpsw_priv *priv, uchar **pkt)
int ret;
ret = cpdma_process(priv, &priv->rx_chan, &buffer, &len);
+ if (ret == -EBUSY)
+ return -EAGAIN;
if (ret < 0)
return ret;
--
2.53.0