summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Grosjean <s.grosjean@peak-system.com>2018-03-08 09:30:29 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-28 18:24:44 +0200
commite7dc75584302003a2cd50ea8146f6ee60d0af11f (patch)
treeecb13d093ea8fd1d10f052a1a35bbfe06f812fdd
parent74f08b1e0de81d8ee15c04177dbe15840e865cea (diff)
downloadlinux-exynos-e7dc75584302003a2cd50ea8146f6ee60d0af11f.tar.gz
linux-exynos-e7dc75584302003a2cd50ea8146f6ee60d0af11f.tar.bz2
linux-exynos-e7dc75584302003a2cd50ea8146f6ee60d0af11f.zip
can: peak/pcie_fd: remove useless code when interface starts
commit ffd137f7043cb30067e1bff6fe62a073ae190b23 upstream. When an interface starts, the echo_skb array is empty and the network queue should be started only. This patch replaces useless code and locks when the internal RX_BARRIER message is received from the IP core, telling the driver that tx may start. Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com> Cc: linux-stable <stable@vger.kernel.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/can/peak_canfd/peak_canfd.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/net/can/peak_canfd/peak_canfd.c b/drivers/net/can/peak_canfd/peak_canfd.c
index 6fa66231ed8e..ed8561d4a90f 100644
--- a/drivers/net/can/peak_canfd/peak_canfd.c
+++ b/drivers/net/can/peak_canfd/peak_canfd.c
@@ -333,7 +333,6 @@ static int pucan_handle_status(struct peak_canfd_priv *priv,
/* this STATUS is the CNF of the RX_BARRIER: Tx path can be setup */
if (pucan_status_is_rx_barrier(msg)) {
- unsigned long flags;
if (priv->enable_tx_path) {
int err = priv->enable_tx_path(priv);
@@ -342,16 +341,8 @@ static int pucan_handle_status(struct peak_canfd_priv *priv,
return err;
}
- /* restart network queue only if echo skb array is free */
- spin_lock_irqsave(&priv->echo_lock, flags);
-
- if (!priv->can.echo_skb[priv->echo_idx]) {
- spin_unlock_irqrestore(&priv->echo_lock, flags);
-
- netif_wake_queue(ndev);
- } else {
- spin_unlock_irqrestore(&priv->echo_lock, flags);
- }
+ /* start network queue (echo_skb array is empty) */
+ netif_start_queue(ndev);
return 0;
}