Skip to content

Commit b172845

Browse files
committed
Merge branch 'qca_spi-fixes'
Stefan Wahren says: ==================== net: qca_spi: Fix receive and reset issues This small patch series fixes two major issues in the SPI driver for the QCA700x. It has been tested on a Charge Control C 300 (NXP i.MX6ULL + 2x QCA7000). ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents aee024f + bc19c32 commit b172845

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

drivers/net/ethernet/qualcomm/qca_spi.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ qcaspi_receive(struct qcaspi *qca)
363363
netdev_dbg(net_dev, "qcaspi_receive: SPI_REG_RDBUF_BYTE_AVA: Value: %08x\n",
364364
available);
365365

366-
if (available > QCASPI_HW_BUF_LEN) {
366+
if (available > QCASPI_HW_BUF_LEN + QCASPI_HW_PKT_LEN) {
367367
/* This could only happen by interferences on the SPI line.
368368
* So retry later ...
369369
*/
@@ -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)