staging: fsl-dpaa2/eth: Refactor interrupt arming in NAPI poll
authorIoana Radulescu <ruxandra.radulescu@nxp.com>
Wed, 11 Oct 2017 13:29:47 +0000 (08:29 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Oct 2017 14:45:18 +0000 (16:45 +0200)
Take into consideration the return value of napi_complete_done(),
since there might be an indication that it's not suitable to
enable driver interrupts yet.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c

index f390de642222829d20b554e15ad2fa6ea0bb2d61..a0be9ab9d326b27e5af5476c1950f0e99a6dc6b4 100644 (file)
@@ -948,8 +948,7 @@ static int dpaa2_eth_poll(struct napi_struct *napi, int budget)
                        break;
        }
 
-       if (cleaned < budget) {
-               napi_complete_done(napi, cleaned);
+       if (cleaned < budget && napi_complete_done(napi, cleaned)) {
                /* Re-enable data available notifications */
                do {
                        err = dpaa2_io_service_rearm(NULL, &ch->nctx);