Skip to content

Commit bc19c32

Browse files
Stefan Wahrendavem330
authored andcommitted
net: qca_spi: Move reset_count to struct qcaspi
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: 291ab06 (net: qualcomm: new Ethernet over SPI driver for QCA7000) Signed-off-by: Stefan Wahren <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3e7e676 commit bc19c32

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

drivers/net/ethernet/qualcomm/qca_spi.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,6 @@ qcaspi_qca7k_sync(struct qcaspi *qca, int event)
496496
u16 signature = 0;
497497
u16 spi_config;
498498
u16 wrbuf_space = 0;
499-
static u16 reset_count;
500499

501500
if (event == QCASPI_EVENT_CPUON) {
502501
/* Read signature twice, if not valid
@@ -549,13 +548,13 @@ qcaspi_qca7k_sync(struct qcaspi *qca, int event)
549548

550549
qca->sync = QCASPI_SYNC_RESET;
551550
qca->stats.trig_reset++;
552-
reset_count = 0;
551+
qca->reset_count = 0;
553552
break;
554553
case QCASPI_SYNC_RESET:
555-
reset_count++;
554+
qca->reset_count++;
556555
netdev_dbg(qca->net_dev, "sync: waiting for CPU on, count %u.\n",
557-
reset_count);
558-
if (reset_count >= QCASPI_RESET_TIMEOUT) {
556+
qca->reset_count);
557+
if (qca->reset_count >= QCASPI_RESET_TIMEOUT) {
559558
/* reset did not seem to take place, try again */
560559
qca->sync = QCASPI_SYNC_UNKNOWN;
561560
qca->stats.reset_timeout++;

drivers/net/ethernet/qualcomm/qca_spi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ struct qcaspi {
9494

9595
unsigned int intr_req;
9696
unsigned int intr_svc;
97+
u16 reset_count;
9798

9899
#ifdef CONFIG_DEBUG_FS
99100
struct dentry *device_root;

0 commit comments

Comments
 (0)