]> git.baikalelectronics.ru Git - kernel.git/commit
net: qca_spi: fix receive buffer size check
authorMichael Heimpold <michael.heimpold@in-tech.com>
Wed, 20 Nov 2019 17:29:12 +0000 (18:29 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Nov 2019 20:42:23 +0000 (12:42 -0800)
commit0b218e4e07452a05b76cdcc940d7e8de0b441682
tree42efd0dcbab0e535f92452c5b08605b874071f6a
parent9b16575ca9f0e2d35fb390d01ff645f1522048fc
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: 2c5c6e7b30d8 ("net: qca_spi: Add available buffer space verification")
Signed-off-by: Michael Heimpold <michael.heimpold@in-tech.com>
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qualcomm/qca_spi.c