Skip to content

Commit

Permalink
can: peak/pcie_fd: remove useless code when interface starts
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephane Grosjean authored and Marc Kleine-Budde committed Mar 12, 2018
1 parent e6048a0 commit ffd137f
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions drivers/net/can/peak_canfd/peak_canfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down

0 comments on commit ffd137f

Please sign in to comment.