Commit d8dd3bc1 authored by Martin Jeřábek's avatar Martin Jeřábek Committed by Ille, Ondrej, Ing.
Browse files

driver: print values of error countres in ERR isr, safely handle improbable state

parent 1ae01d75
......@@ -369,11 +369,14 @@ static void ctucan_err_interrupt(struct net_device *ndev, union ctu_can_fd_int_s
struct can_frame *cf;
struct sk_buff *skb;
struct can_berr_counter berr;
netdev_info(ndev, "ctucan_err_interrupt: ISR = 0x%08x", isr.u32);
ctu_can_fd_read_err_ctrs(&priv->p, &berr);
netdev_info(ndev, "ctucan_err_interrupt: ISR = 0x%08x, rxerr %d, txerr %d",
isr.u32, berr.rxerr, berr.txerr);
skb = alloc_can_err_skb(ndev, &cf);
ctu_can_fd_read_err_ctrs(&priv->p, &berr);
* EWI: error warning
* DOI: RX overrun
......@@ -403,10 +406,14 @@ static void ctucan_err_interrupt(struct net_device *ndev, union ctu_can_fd_int_s
cf->data[6] = berr.txerr;
cf->data[7] = berr.rxerr;
} else if (state == CAN_STATE_ERROR_WARNING) {
netdev_warn(ndev, " error_warning, but ISR[EPI] was set! (HW bug?)");
goto err_warning;
} else {
netdev_warn(ndev, " unhandled error state!");
} else if (isr.s.ei) {
/* error warning */
priv->can.state = CAN_STATE_ERROR_WARNING;
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