From: Marek Vasut Date: Sat, 7 May 2016 22:34:15 +0000 (+0200) Subject: can: ifi: Increment TX counters only on real transmission X-Git-Tag: v4.7-rc1~154^2~78^2~1 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=1acd80fb982728b8bf467184d5ec4c5a77a5601b;p=cascardo%2Flinux.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 Cc: Marc Kleine-Budde Cc: Mark Rutland Cc: Oliver Hartkopp Cc: Wolfgang Grandegger Signed-off-by: Marc Kleine-Budde --- diff --git a/drivers/net/can/ifi_canfd/ifi_canfd.c b/drivers/net/can/ifi_canfd/ifi_canfd.c index 5bd95dd5cb88..ba6cd43e1bc6 100644 --- a/drivers/net/can/ifi_canfd/ifi_canfd.c +++ b/drivers/net/can/ifi_canfd/ifi_canfd.c @@ -522,13 +522,15 @@ static irqreturn_t ifi_canfd_isr(int irq, void *dev_id) } /* 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_packets++; can_led_event(ndev, CAN_LED_EVENT_TX); - netif_wake_queue(ndev); } + if (isr & tx_irq_mask) + netif_wake_queue(ndev); + return IRQ_HANDLED; }