1 From c4b6e9341f930e4dd089231c0414758f5f1f9dbd Mon Sep 17 00:00:00 2001
2 From: Aleksander Jan Bajkowski <olek2@wp.pl>
3 Date: Wed, 24 Aug 2022 23:54:07 +0200
4 Subject: [PATCH] net: lantiq_xrx200: fix lock under memory pressure
6 When the xrx200_hw_receive() function returns -ENOMEM, the NAPI poll
7 function immediately returns an error.
8 This is incorrect for two reasons:
9 * the function terminates without enabling interrupts or scheduling NAPI,
10 * the error code (-ENOMEM) is returned instead of the number of received
13 After the first memory allocation failure occurs, packet reception is
14 locked due to disabled interrupts from DMA..
16 Fixes: fe1a56420cf2 ("net: lantiq: Add Lantiq / Intel VRX200 Ethernet driver")
17 Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
18 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
20 drivers/net/ethernet/lantiq_xrx200.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
23 --- a/drivers/net/ethernet/lantiq_xrx200.c
24 +++ b/drivers/net/ethernet/lantiq_xrx200.c
25 @@ -294,7 +294,7 @@ static int xrx200_poll_rx(struct napi_st
26 if (ret == XRX200_DMA_PACKET_IN_PROGRESS)
28 if (ret != XRX200_DMA_PACKET_COMPLETE)