[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221116205308.2996556-3-msp@baylibre.com>
Date: Wed, 16 Nov 2022 21:52:55 +0100
From: Markus Schneider-Pargmann <msp@...libre.com>
To: Chandrasekar Ramakrishnan <rcsekar@...sung.com>,
Marc Kleine-Budde <mkl@...gutronix.de>,
Wolfgang Grandegger <wg@...ndegger.com>
Cc: linux-can@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Markus Schneider-Pargmann <msp@...libre.com>
Subject: [PATCH 02/15] can: m_can: Wakeup net queue once tx was issued
Currently the driver waits to wakeup the queue until the interrupt for
the transmit event is received and acknowledged. If we want to use the
hardware FIFO, this is too late.
Instead release the queue as soon as the transmit was transferred into
the hardware FIFO. We are then ready for the next transmit to be
transferred.
Signed-off-by: Markus Schneider-Pargmann <msp@...libre.com>
---
drivers/net/can/m_can/m_can.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 2c01e3f7b23f..4adf03111782 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -1097,10 +1097,9 @@ static irqreturn_t m_can_isr(int irq, void *dev_id)
/* New TX FIFO Element arrived */
if (m_can_echo_tx_event(dev) != 0)
goto out_fail;
-
- if (netif_queue_stopped(dev) &&
- !m_can_tx_fifo_full(cdev))
+ if (!cdev->tx_skb && netif_queue_stopped(dev))
netif_wake_queue(dev);
+
}
}
@@ -1705,6 +1704,8 @@ static netdev_tx_t m_can_tx_handler(struct m_can_classdev *cdev)
if (m_can_tx_fifo_full(cdev) ||
m_can_next_echo_skb_occupied(dev, putidx))
netif_stop_queue(dev);
+ else if (cdev->is_peripheral && !cdev->tx_skb && netif_queue_stopped(dev))
+ netif_wake_queue(dev);
}
return NETDEV_TX_OK;
--
2.38.1
Powered by blists - more mailing lists