2021-05-08 12:38:48

by Stefan Wahren

[permalink] [raw]
Subject: [PATCH 0/3 net-next] net: qca_spi: Improve sync handling

This small patch series contains some improvements of the sync
handling. This was discovered while the QCA7000 was doing SLAC
(Signal Level Attenuation Characterization).

Stefan Wahren (3):
net: qca_spi: Avoid reading signature three times in a row
net: qca_spi: Avoid re-sync for single signature error
net: qca_spi: Introduce stat about bad signature

drivers/net/ethernet/qualcomm/qca_debug.c | 1 +
drivers/net/ethernet/qualcomm/qca_spi.c | 10 +++++++++-
drivers/net/ethernet/qualcomm/qca_spi.h | 1 +
3 files changed, 11 insertions(+), 1 deletion(-)

--
2.7.4


2021-05-08 12:38:52

by Stefan Wahren

[permalink] [raw]
Subject: [PATCH 2/3 net-next] net: qca_spi: Avoid re-sync for single signature error

Setting a new network key would cause a reset of the QCA7000. Usually
the driver only notice the SPI interrupt and a single signature error.
So avoid the whole re-sync process (possible packet loss, transmit queue
stop and no carrier for at least 1 second) in this case.

Signed-off-by: Stefan Wahren <[email protected]>
---
drivers/net/ethernet/qualcomm/qca_spi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c
index 3e2a54c..0937ceb 100644
--- a/drivers/net/ethernet/qualcomm/qca_spi.c
+++ b/drivers/net/ethernet/qualcomm/qca_spi.c
@@ -524,8 +524,11 @@ qcaspi_qca7k_sync(struct qcaspi *qca, int event)

switch (qca->sync) {
case QCASPI_SYNC_READY:
- /* Read signature, if not valid go to unknown state. */
+ /* Check signature twice, if not valid go to unknown state. */
qcaspi_read_register(qca, SPI_REG_SIGNATURE, &signature);
+ if (signature != QCASPI_GOOD_SIGNATURE)
+ qcaspi_read_register(qca, SPI_REG_SIGNATURE, &signature);
+
if (signature != QCASPI_GOOD_SIGNATURE) {
qca->sync = QCASPI_SYNC_UNKNOWN;
netdev_dbg(qca->net_dev, "sync: bad signature, restart\n");
--
2.7.4

2021-05-10 21:40:58

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH 0/3 net-next] net: qca_spi: Improve sync handling

Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Sat, 8 May 2021 14:36:32 +0200 you wrote:
> This small patch series contains some improvements of the sync
> handling. This was discovered while the QCA7000 was doing SLAC
> (Signal Level Attenuation Characterization).
>
> Stefan Wahren (3):
> net: qca_spi: Avoid reading signature three times in a row
> net: qca_spi: Avoid re-sync for single signature error
> net: qca_spi: Introduce stat about bad signature
>
> [...]

Here is the summary with links:
- [1/3,net-next] net: qca_spi: Avoid reading signature three times in a row
https://git.kernel.org/netdev/net-next/c/b76078df1593
- [2/3,net-next] net: qca_spi: Avoid re-sync for single signature error
https://git.kernel.org/netdev/net-next/c/6e03f3ff29c1
- [3/3,net-next] net: qca_spi: Introduce stat about bad signature
https://git.kernel.org/netdev/net-next/c/a53935674563

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html