Re: [PATCH V2] net: qca_spi: Fix race condition in spi transfers

From: David Miller
Date: Tue Sep 04 2018 - 15:16:38 EST


From: Stefan Wahren <stefan.wahren@xxxxxxxx>
Date: Mon, 3 Sep 2018 14:44:17 +0200

> With performance optimization the spi transfer and messages from 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
> register via ethtool during network traffic could make spi_sync
> hang forever, because the completion in spi_message is overwritten.
>
> So revert the optimization completely.
>
> Signed-off-by: Stefan Wahren <stefan.wahren@xxxxxxxx>
> ---
> drivers/net/ethernet/qualcomm/qca_7k.c | 84 ++++++++++++------------
> drivers/net/ethernet/qualcomm/qca_spi.c | 110 +++++++++++++++++---------------
> drivers/net/ethernet/qualcomm/qca_spi.h | 5 --
> 3 files changed, 97 insertions(+), 102 deletions(-)
>
> Changes in V2:
> - explain race in commit log more in detail

Ok, I want one more change.

Please repost this with an appropriate Fixes: tag added.

Thank you.