Skip to content

Commit 3e7e676

Browse files
mheidavem330
authored andcommitted
net: qca_spi: fix receive buffer size check
When receiving many or larger packets, e.g. when doing a file download, it was observed that the read buffer size register reports up to 4 bytes more than the current define allows in the check. If this is the case, then no data transfer is initiated to receive the packets (and thus to empty the buffer) which results in a stall of the interface. These 4 bytes are a hardware generated frame length which is prepended to the actual frame, thus we have to respect it during our check. Fixes: 026b907 ("net: qca_spi: Add available buffer space verification") Signed-off-by: Michael Heimpold <[email protected]> Signed-off-by: Stefan Wahren <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent aee024f commit 3e7e676

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/qualcomm/qca_spi.c

Lines changed: 1 addition & 1 deletion
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
*/

0 commit comments

Comments
 (0)