]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: ipa: heed napi_complete() return value
authorAlex Elder <elder@linaro.org>
Thu, 21 Jan 2021 11:48:18 +0000 (05:48 -0600)
committerJakub Kicinski <kuba@kernel.org>
Sat, 23 Jan 2021 21:16:00 +0000 (13:16 -0800)
Pay attention to the return value of napi_complete(), completing
polling only if it returns true.

Just use napi rather than &channel->napi as the argument passed to
napi_complete().

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ipa/gsi.c

index 56a5eb61b20c4b1bd976baeda65cf12d51a1bea8..634f514e861e79151f7e35c3ee424484d8086201 100644 (file)
@@ -1555,10 +1555,8 @@ static int gsi_channel_poll(struct napi_struct *napi, int budget)
                gsi_trans_complete(trans);
        }
 
-       if (count < budget) {
-               napi_complete(&channel->napi);
+       if (count < budget && napi_complete(napi))
                gsi_irq_ieob_enable(channel->gsi, channel->evt_ring_id);
-       }
 
        return count;
 }