mirror of https://gitee.com/openkylin/linux.git
can: ifi: Increment TX counters only on real transmission
Only increment the TX counters in the irq handler if a CAN message was sent. The current code incremented the counters also if the TX FIFO empty interrupt happened, which is incorrect. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Marc Kleine-Budde <mkl@pengutronix.de> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Oliver Hartkopp <socketcan@hartkopp.net> Cc: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
ca79408986
commit
1acd80fb98
|
@ -522,13 +522,15 @@ static irqreturn_t ifi_canfd_isr(int irq, void *dev_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TX IRQ */
|
/* TX IRQ */
|
||||||
if (isr & tx_irq_mask) {
|
if (isr & IFI_CANFD_INTERRUPT_TXFIFO_REMOVE) {
|
||||||
stats->tx_bytes += can_get_echo_skb(ndev, 0);
|
stats->tx_bytes += can_get_echo_skb(ndev, 0);
|
||||||
stats->tx_packets++;
|
stats->tx_packets++;
|
||||||
can_led_event(ndev, CAN_LED_EVENT_TX);
|
can_led_event(ndev, CAN_LED_EVENT_TX);
|
||||||
netif_wake_queue(ndev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isr & tx_irq_mask)
|
||||||
|
netif_wake_queue(ndev);
|
||||||
|
|
||||||
return IRQ_HANDLED;
|
return IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue