linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] net: qca_spi: Minor bugfixes
@ 2018-07-18  6:31 Stefan Wahren
  2018-07-18  6:31 ` [PATCH 1/3] net: qca_spi: Avoid packet drop during initial sync Stefan Wahren
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Stefan Wahren @ 2018-07-18  6:31 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, linux-kernel, Stefan Wahren

This patch series contains some minor bugfixes for
the qca_spi driver.

Stefan Wahren (3):
  net: qca_spi: Avoid packet drop during initial sync
  net: qca_spi: Make sure the QCA7000 reset is triggered
  net: qca_spi: Fix log level if probe fails

 drivers/net/ethernet/qualcomm/qca_spi.c | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] net: qca_spi: Avoid packet drop during initial sync
  2018-07-18  6:31 [PATCH 0/3] net: qca_spi: Minor bugfixes Stefan Wahren
@ 2018-07-18  6:31 ` Stefan Wahren
  2018-07-18  6:31 ` [PATCH 2/3] net: qca_spi: Make sure the QCA7000 reset is triggered Stefan Wahren
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Wahren @ 2018-07-18  6:31 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, linux-kernel, Stefan Wahren

As long as the synchronization with the QCA7000 isn't finished, we
cannot accept packets from the upper layers. So let the SPI thread
enable the TX queue after sync and avoid unwanted packet drop.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000")
---
 drivers/net/ethernet/qualcomm/qca_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c
index 5803cd6..7db149f 100644
--- a/drivers/net/ethernet/qualcomm/qca_spi.c
+++ b/drivers/net/ethernet/qualcomm/qca_spi.c
@@ -658,7 +658,7 @@ qcaspi_netdev_open(struct net_device *dev)
 		return ret;
 	}
 
-	netif_start_queue(qca->net_dev);
+	/* SPI thread takes care of TX queue */
 
 	return 0;
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] net: qca_spi: Make sure the QCA7000 reset is triggered
  2018-07-18  6:31 [PATCH 0/3] net: qca_spi: Minor bugfixes Stefan Wahren
  2018-07-18  6:31 ` [PATCH 1/3] net: qca_spi: Avoid packet drop during initial sync Stefan Wahren
@ 2018-07-18  6:31 ` Stefan Wahren
  2018-07-18  6:31 ` [PATCH 3/3] net: qca_spi: Fix log level if probe fails Stefan Wahren
  2018-07-18 22:19 ` [PATCH 0/3] net: qca_spi: Minor bugfixes David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Wahren @ 2018-07-18  6:31 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, linux-kernel, Stefan Wahren

In case the SPI thread is not running, a simple reset of sync
state won't fix the transmit timeout. We also need to wake up the kernel
thread.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Fixes: ed7d42e24eff ("net: qca_spi: fix transmit queue timeout handling")
---
 drivers/net/ethernet/qualcomm/qca_spi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c
index 7db149f..7fa815d 100644
--- a/drivers/net/ethernet/qualcomm/qca_spi.c
+++ b/drivers/net/ethernet/qualcomm/qca_spi.c
@@ -760,6 +760,9 @@ qcaspi_netdev_tx_timeout(struct net_device *dev)
 	qca->net_dev->stats.tx_errors++;
 	/* Trigger tx queue flush and QCA7000 reset */
 	qca->sync = QCASPI_SYNC_UNKNOWN;
+
+	if (qca->spi_thread)
+		wake_up_process(qca->spi_thread);
 }
 
 static int
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] net: qca_spi: Fix log level if probe fails
  2018-07-18  6:31 [PATCH 0/3] net: qca_spi: Minor bugfixes Stefan Wahren
  2018-07-18  6:31 ` [PATCH 1/3] net: qca_spi: Avoid packet drop during initial sync Stefan Wahren
  2018-07-18  6:31 ` [PATCH 2/3] net: qca_spi: Make sure the QCA7000 reset is triggered Stefan Wahren
@ 2018-07-18  6:31 ` Stefan Wahren
  2018-07-18 22:19 ` [PATCH 0/3] net: qca_spi: Minor bugfixes David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Wahren @ 2018-07-18  6:31 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, linux-kernel, Stefan Wahren

In cases the probing fails the log level of the messages should
be an error.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 drivers/net/ethernet/qualcomm/qca_spi.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c
index 7fa815d..206f026 100644
--- a/drivers/net/ethernet/qualcomm/qca_spi.c
+++ b/drivers/net/ethernet/qualcomm/qca_spi.c
@@ -881,22 +881,22 @@ qca_spi_probe(struct spi_device *spi)
 
 	if ((qcaspi_clkspeed < QCASPI_CLK_SPEED_MIN) ||
 	    (qcaspi_clkspeed > QCASPI_CLK_SPEED_MAX)) {
-		dev_info(&spi->dev, "Invalid clkspeed: %d\n",
-			 qcaspi_clkspeed);
+		dev_err(&spi->dev, "Invalid clkspeed: %d\n",
+			qcaspi_clkspeed);
 		return -EINVAL;
 	}
 
 	if ((qcaspi_burst_len < QCASPI_BURST_LEN_MIN) ||
 	    (qcaspi_burst_len > QCASPI_BURST_LEN_MAX)) {
-		dev_info(&spi->dev, "Invalid burst len: %d\n",
-			 qcaspi_burst_len);
+		dev_err(&spi->dev, "Invalid burst len: %d\n",
+			qcaspi_burst_len);
 		return -EINVAL;
 	}
 
 	if ((qcaspi_pluggable < QCASPI_PLUGGABLE_MIN) ||
 	    (qcaspi_pluggable > QCASPI_PLUGGABLE_MAX)) {
-		dev_info(&spi->dev, "Invalid pluggable: %d\n",
-			 qcaspi_pluggable);
+		dev_err(&spi->dev, "Invalid pluggable: %d\n",
+			qcaspi_pluggable);
 		return -EINVAL;
 	}
 
@@ -958,8 +958,8 @@ qca_spi_probe(struct spi_device *spi)
 	}
 
 	if (register_netdev(qcaspi_devs)) {
-		dev_info(&spi->dev, "Unable to register net device %s\n",
-			 qcaspi_devs->name);
+		dev_err(&spi->dev, "Unable to register net device %s\n",
+			qcaspi_devs->name);
 		free_netdev(qcaspi_devs);
 		return -EFAULT;
 	}
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] net: qca_spi: Minor bugfixes
  2018-07-18  6:31 [PATCH 0/3] net: qca_spi: Minor bugfixes Stefan Wahren
                   ` (2 preceding siblings ...)
  2018-07-18  6:31 ` [PATCH 3/3] net: qca_spi: Fix log level if probe fails Stefan Wahren
@ 2018-07-18 22:19 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2018-07-18 22:19 UTC (permalink / raw)
  To: stefan.wahren; +Cc: netdev, linux-kernel

From: Stefan Wahren <stefan.wahren@i2se.com>
Date: Wed, 18 Jul 2018 08:31:42 +0200

> This patch series contains some minor bugfixes for
> the qca_spi driver.

Series applied, thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-07-18 22:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-18  6:31 [PATCH 0/3] net: qca_spi: Minor bugfixes Stefan Wahren
2018-07-18  6:31 ` [PATCH 1/3] net: qca_spi: Avoid packet drop during initial sync Stefan Wahren
2018-07-18  6:31 ` [PATCH 2/3] net: qca_spi: Make sure the QCA7000 reset is triggered Stefan Wahren
2018-07-18  6:31 ` [PATCH 3/3] net: qca_spi: Fix log level if probe fails Stefan Wahren
2018-07-18 22:19 ` [PATCH 0/3] net: qca_spi: Minor bugfixes David Miller

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).