Skip to content

Commit 1057812

Browse files
lategoodbyekuba-moo
authored andcommitted
qca_spi: Fix reset behavior
In case of a reset triggered by the QCA7000 itself, the behavior of the qca_spi driver was not quite correct: - in case of a pending RX frame decoding the drop counter must be incremented and decoding state machine reseted - also the reset counter must always be incremented regardless of sync state Fixes: 291ab06 ("net: qualcomm: new Ethernet over SPI driver for QCA7000") Signed-off-by: Stefan Wahren <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 96a7e86 commit 1057812

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/net/ethernet/qualcomm/qca_spi.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,11 +620,17 @@ qcaspi_spi_thread(void *data)
620620
if (intr_cause & SPI_INT_CPU_ON) {
621621
qcaspi_qca7k_sync(qca, QCASPI_EVENT_CPUON);
622622

623+
/* Frame decoding in progress */
624+
if (qca->frm_handle.state != qca->frm_handle.init)
625+
qca->net_dev->stats.rx_dropped++;
626+
627+
qcafrm_fsm_init_spi(&qca->frm_handle);
628+
qca->stats.device_reset++;
629+
623630
/* not synced. */
624631
if (qca->sync != QCASPI_SYNC_READY)
625632
continue;
626633

627-
qca->stats.device_reset++;
628634
netif_wake_queue(qca->net_dev);
629635
netif_carrier_on(qca->net_dev);
630636
}

0 commit comments

Comments
 (0)