Commit 4d67d285 authored by Stefan Wahren's avatar Stefan Wahren Committed by Kleber Sacilotto de Souza

net: qca_spi: Move reset_count to struct qcaspi

BugLink: https://bugs.launchpad.net/bugs/1864773

[ Upstream commit bc19c329 ]

The reset counter is specific for every QCA700x chip. So move this
into the private driver struct. Otherwise we get unpredictable reset
behavior in setups with multiple QCA700x chips.

Fixes: 291ab06e (net: qualcomm: new Ethernet over SPI driver for QCA7000)
Signed-off-by: default avatarStefan Wahren <stefan.wahren@in-tech.com>
Signed-off-by: default avatarStefan Wahren <wahrenst@gmx.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent f917972f
...@@ -438,7 +438,6 @@ qcaspi_qca7k_sync(struct qcaspi *qca, int event) ...@@ -438,7 +438,6 @@ qcaspi_qca7k_sync(struct qcaspi *qca, int event)
u16 signature = 0; u16 signature = 0;
u16 spi_config; u16 spi_config;
u16 wrbuf_space = 0; u16 wrbuf_space = 0;
static u16 reset_count;
if (event == QCASPI_EVENT_CPUON) { if (event == QCASPI_EVENT_CPUON) {
/* Read signature twice, if not valid /* Read signature twice, if not valid
...@@ -491,13 +490,13 @@ qcaspi_qca7k_sync(struct qcaspi *qca, int event) ...@@ -491,13 +490,13 @@ qcaspi_qca7k_sync(struct qcaspi *qca, int event)
qca->sync = QCASPI_SYNC_RESET; qca->sync = QCASPI_SYNC_RESET;
qca->stats.trig_reset++; qca->stats.trig_reset++;
reset_count = 0; qca->reset_count = 0;
break; break;
case QCASPI_SYNC_RESET: case QCASPI_SYNC_RESET:
reset_count++; qca->reset_count++;
netdev_dbg(qca->net_dev, "sync: waiting for CPU on, count %u.\n", netdev_dbg(qca->net_dev, "sync: waiting for CPU on, count %u.\n",
reset_count); qca->reset_count);
if (reset_count >= QCASPI_RESET_TIMEOUT) { if (qca->reset_count >= QCASPI_RESET_TIMEOUT) {
/* reset did not seem to take place, try again */ /* reset did not seem to take place, try again */
qca->sync = QCASPI_SYNC_UNKNOWN; qca->sync = QCASPI_SYNC_UNKNOWN;
qca->stats.reset_timeout++; qca->stats.reset_timeout++;
......
...@@ -97,6 +97,7 @@ struct qcaspi { ...@@ -97,6 +97,7 @@ struct qcaspi {
unsigned int intr_req; unsigned int intr_req;
unsigned int intr_svc; unsigned int intr_svc;
u16 reset_count;
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
struct dentry *device_root; struct dentry *device_root;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment