Commit d43206fb authored by Martin Jeřábek's avatar Martin Jeřábek

driver: use napi_complete_done, with opportunistic interrupt avoiding

1) When ctucan_rx_poll is about to finish but another NAPI poll is,
   scheduled, avoid re-enabling the interrupts.
2) The usage of napi_complete_done instead of napi_complete may enable
   to set up poll timer via sysfs. Probably not really interesting for CAN.
parent 2be9ef13
......@@ -534,9 +534,10 @@ static int ctucan_rx_poll(struct napi_struct *napi, int quota)
can_led_event(ndev, CAN_LED_EVENT_RX);
if (work_done < quota) {
napi_complete(napi);
iec.s.doi = 1; /* Also re-enable DOI */
priv->p.write_reg(&priv->p, CTU_CAN_FD_INT_ENA_SET, iec.u32);
if (napi_complete_done(napi, work_done)) {
iec.s.doi = 1; /* Also re-enable DOI */
priv->p.write_reg(&priv->p, CTU_CAN_FD_INT_ENA_SET, iec.u32);
}
}
return work_done;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment