]> git.baikalelectronics.ru Git - kernel.git/commit
net: qca_spi: Fix race condition in spi transfers
authorStefan Wahren <stefan.wahren@i2se.com>
Wed, 5 Sep 2018 13:23:18 +0000 (15:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 5 Sep 2018 15:09:35 +0000 (08:09 -0700)
commit806fbb0cbbb6e8490f0050790a1865e0a77f5487
tree464f36ca6f998283272c185728708dd42e46851a
parentd50b992fade92ab412d9b990449d70cf672d3c11
net: qca_spi: Fix race condition in spi transfers

With performance optimization the spi transfer and messages of basic
register operations like qcaspi_read_register moved into the private
driver structure. But they weren't protected against mutual access
(e.g. between driver kthread and ethtool). So dumping the QCA7000
registers via ethtool during network traffic could make spi_sync
hang forever, because the completion in spi_message is overwritten.

So revert the optimization completely.

Fixes: a7a0fb77657e0 ("net: qualcomm: new Ethernet over SPI driver for QCA700")
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qualcomm/qca_7k.c
drivers/net/ethernet/qualcomm/qca_spi.c
drivers/net/ethernet/qualcomm/qca_spi.h