From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, linux-can@vger.kernel.org,
kernel@pengutronix.de,
Stephane Grosjean <s.grosjean@peak-system.com>,
linux-stable <stable@vger.kernel.org>,
Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH 5/6] can: peak/pcie_fd: remove useless code when interface starts
Date: Mon, 12 Mar 2018 11:04:09 +0100 [thread overview]
Message-ID: <20180312100410.10404-6-mkl@pengutronix.de> (raw)
In-Reply-To: <20180312100410.10404-1-mkl@pengutronix.de>
From: Stephane Grosjean <s.grosjean@peak-system.com>
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>
---
drivers/net/can/peak_canfd/peak_canfd.c | 13 ++-----------
1 file 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;
}
--
2.16.1
next prev parent reply other threads:[~2018-03-12 10:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-12 10:04 pull-request: can 2018-03-12 Marc Kleine-Budde
2018-03-12 10:04 ` [PATCH 1/6] can: m_can: change comparison to bitshift when dealing with a mask Marc Kleine-Budde
2018-03-12 10:04 ` [PATCH 2/6] can: ifi: Check core revision upon probe Marc Kleine-Budde
2018-03-12 10:04 ` [PATCH 3/6] can: ifi: Repair the error handling Marc Kleine-Budde
2018-03-12 10:04 ` [PATCH 4/6] can: peak/pcie_fd: fix echo_skb is occupied! bug Marc Kleine-Budde
2018-03-12 10:04 ` Marc Kleine-Budde [this message]
2018-03-12 10:04 ` [PATCH 6/6] can: m_can: select pinctrl state in each suspend/resume function Marc Kleine-Budde
2018-03-12 10:30 ` Bich HEMON
2018-03-12 15:17 ` pull-request: can 2018-03-12 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180312100410.10404-6-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=davem@davemloft.net \
--cc=kernel@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=s.grosjean@peak-system.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).