2019-11-20 17:41:44

by Stefan Wahren

[permalink] [raw]
Subject: [PATCH net 0/2] net: qca_spi: Fix receive and reset issues

This small patch series fixes two major issues in the SPI driver for the
QCA700x.

It has been tested on a Charge Control C 300 (NXP i.MX6ULL +
2x QCA7000).

Michael Heimpold (1):
net: qca_spi: fix receive buffer size check

Stefan Wahren (1):
net: qca_spi: Move reset_count to struct qcaspi

drivers/net/ethernet/qualcomm/qca_spi.c | 11 +++++------
drivers/net/ethernet/qualcomm/qca_spi.h | 1 +
2 files changed, 6 insertions(+), 6 deletions(-)

--
2.7.4



2019-11-20 17:42:55

by Stefan Wahren

[permalink] [raw]
Subject: [PATCH net 1/2] net: qca_spi: fix receive buffer size check

From: Michael Heimpold <[email protected]>

When receiving many or larger packets, e.g. when doing a file download,
it was observed that the read buffer size register reports up to 4 bytes
more than the current define allows in the check.
If this is the case, then no data transfer is initiated to receive the
packets (and thus to empty the buffer) which results in a stall of the
interface.

These 4 bytes are a hardware generated frame length which is prepended
to the actual frame, thus we have to respect it during our check.

Fixes: 026b907d58c4 ("net: qca_spi: Add available buffer space verification")
Signed-off-by: Michael Heimpold <[email protected]>
Signed-off-by: Stefan Wahren <[email protected]>
---
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 5ecf61d..351f24f 100644
--- a/drivers/net/ethernet/qualcomm/qca_spi.c
+++ b/drivers/net/ethernet/qualcomm/qca_spi.c
@@ -363,7 +363,7 @@ qcaspi_receive(struct qcaspi *qca)
netdev_dbg(net_dev, "qcaspi_receive: SPI_REG_RDBUF_BYTE_AVA: Value: %08x\n",
available);

- if (available > QCASPI_HW_BUF_LEN) {
+ if (available > QCASPI_HW_BUF_LEN + QCASPI_HW_PKT_LEN) {
/* This could only happen by interferences on the SPI line.
* So retry later ...
*/
--
2.7.4


2019-11-20 20:44:48

by David Miller

[permalink] [raw]
Subject: Re: [PATCH net 0/2] net: qca_spi: Fix receive and reset issues

From: Stefan Wahren <[email protected]>
Date: Wed, 20 Nov 2019 18:29:11 +0100

> This small patch series fixes two major issues in the SPI driver for the
> QCA700x.
>
> It has been tested on a Charge Control C 300 (NXP i.MX6ULL +
> 2x QCA7000).

Series applied, thanks.