diff options
author | Stefan Wahren <stefan.wahren@i2se.com> | 2021-05-08 14:36:35 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-05-10 14:29:18 -0700 |
commit | a53935674563f60d8e22ca88ab607dac89fb353d (patch) | |
tree | c9864c109332a00bff1d966780d65931a2b73c3a /drivers | |
parent | 6e03f3ff29c1b479cd10cab0d1c4530bafad601c (diff) | |
download | linux-stable-a53935674563f60d8e22ca88ab607dac89fb353d.tar.gz linux-stable-a53935674563f60d8e22ca88ab607dac89fb353d.tar.bz2 linux-stable-a53935674563f60d8e22ca88ab607dac89fb353d.zip |
net: qca_spi: Introduce stat about bad signature
In order to identify significant signature issues add a new stat counter,
which increases on bad signature values that causes a sync loss.
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/qualcomm/qca_debug.c | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/qualcomm/qca_spi.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/qualcomm/qca_spi.h | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qualcomm/qca_debug.c b/drivers/net/ethernet/qualcomm/qca_debug.c index 702aa217a27a..d59fff2fbcc6 100644 --- a/drivers/net/ethernet/qualcomm/qca_debug.c +++ b/drivers/net/ethernet/qualcomm/qca_debug.c @@ -62,6 +62,7 @@ static const char qcaspi_gstrings_stats[][ETH_GSTRING_LEN] = { "SPI errors", "Write verify errors", "Buffer available errors", + "Bad signature", }; #ifdef CONFIG_DEBUG_FS diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c index 0937ceb08296..79fe3ec4e581 100644 --- a/drivers/net/ethernet/qualcomm/qca_spi.c +++ b/drivers/net/ethernet/qualcomm/qca_spi.c @@ -504,6 +504,9 @@ qcaspi_qca7k_sync(struct qcaspi *qca, int event) qcaspi_read_register(qca, SPI_REG_SIGNATURE, &signature); qcaspi_read_register(qca, SPI_REG_SIGNATURE, &signature); if (signature != QCASPI_GOOD_SIGNATURE) { + if (qca->sync == QCASPI_SYNC_READY) + qca->stats.bad_signature++; + qca->sync = QCASPI_SYNC_UNKNOWN; netdev_dbg(qca->net_dev, "sync: got CPU on, but signature was invalid, restart\n"); return; @@ -531,6 +534,7 @@ qcaspi_qca7k_sync(struct qcaspi *qca, int event) if (signature != QCASPI_GOOD_SIGNATURE) { qca->sync = QCASPI_SYNC_UNKNOWN; + qca->stats.bad_signature++; netdev_dbg(qca->net_dev, "sync: bad signature, restart\n"); /* don't reset right away */ return; diff --git a/drivers/net/ethernet/qualcomm/qca_spi.h b/drivers/net/ethernet/qualcomm/qca_spi.h index d13a67e20d65..3067356106f0 100644 --- a/drivers/net/ethernet/qualcomm/qca_spi.h +++ b/drivers/net/ethernet/qualcomm/qca_spi.h @@ -75,6 +75,7 @@ struct qcaspi_stats { u64 spi_err; u64 write_verify_failed; u64 buf_avail_err; + u64 bad_signature; }; struct qcaspi { |