Skip to content

Commit

Permalink
can: xilinx_can: Add check for NAPI Poll function
Browse files Browse the repository at this point in the history
Add check for NAPI poll function to avoid enabling interrupts
with out completing the NAPI call.

Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
  • Loading branch information
Srinivas Neeli authored and Michal Simek committed Sep 22, 2021
1 parent bbb327d commit 1e9116a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/net/can/xilinx_can.c
Expand Up @@ -1219,10 +1219,11 @@ static int xcan_rx_poll(struct napi_struct *napi, int quota)
}

if (work_done < quota) {
napi_complete_done(napi, work_done);
ier = priv->read_reg(priv, XCAN_IER_OFFSET);
ier |= xcan_rx_int_mask(priv);
priv->write_reg(priv, XCAN_IER_OFFSET, ier);
if (napi_complete_done(napi, work_done)) {
ier = priv->read_reg(priv, XCAN_IER_OFFSET);
ier |= xcan_rx_int_mask(priv);
priv->write_reg(priv, XCAN_IER_OFFSET, ier);
}
}
return work_done;
}
Expand Down

0 comments on commit 1e9116a

Please sign in to comment.