[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220208162053.39896-1-srinivas.neeli@xilinx.com>
Date: Tue, 8 Feb 2022 21:50:53 +0530
From: Srinivas Neeli <srinivas.neeli@...inx.com>
To: <wg@...ndegger.com>, <mkl@...gutronix.de>, <davem@...emloft.net>,
<kuba@...nel.org>
CC: <michal.simek@...inx.com>, <linux-can@...r.kernel.org>,
<netdev@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <appana.durga.rao@...inx.com>,
<sgoud@...inx.com>, <git@...inx.com>,
Srinivas Neeli <srinivas.neeli@...inx.com>
Subject: [PATCH] can: xilinx_can: Add check for NAPI Poll function
Add check for NAPI poll function to avoid enabling interrupts
with out completing the NAPI call.
Signed-off-by: Srinivas Neeli <srinivas.neeli@...inx.com>
---
drivers/net/can/xilinx_can.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
index 1674b561c9a2..e562c5ab1149 100644
--- a/drivers/net/can/xilinx_can.c
+++ b/drivers/net/can/xilinx_can.c
@@ -1215,10 +1215,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;
}
--
2.17.1
Powered by blists - more mailing lists