net: qca_spi: Add available buffer space verification
authorStefan Wahren <stefan.wahren@i2se.com>
Thu, 8 Nov 2018 13:38:21 +0000 (14:38 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Nov 2018 03:41:01 +0000 (19:41 -0800)
commit026b907d58c48b2ff2a4c04a67bb5f71ebda1f2d
tree80acab764c725b1c4141bfadb838a3ac9cc8934a
parent50254256f382c56bde87d970f3d0d02fdb76ec70
net: qca_spi: Add available buffer space verification

Interferences on the SPI line could distort the response of
available buffer space. So at least we should check that the
response doesn't exceed the maximum available buffer space.
In error case increase a new error counter and retry it later.
This behavior avoids buffer errors in the QCA7000, which
results in an unnecessary chip reset including packet loss.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qualcomm/qca_debug.c
drivers/net/ethernet/qualcomm/qca_spi.c
drivers/net/ethernet/qualcomm/qca_spi.h