net: dsa: qca8k: dsa: qca8k: protect MASTER busy_wait with mdio mutex
authorAnsuel Smith <ansuelsmth@gmail.com>
Fri, 14 May 2021 21:00:08 +0000 (23:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 May 2021 22:30:22 +0000 (15:30 -0700)
commit60df02b6ea4581d72eb7a3ab7204504a54059b72
tree09ed4e74324c8fdbd042d90af25f631545f0424c
parent63c33bbfeb6842a956a0eb12901e28eb335bdb18
net: dsa: qca8k: dsa: qca8k: protect MASTER busy_wait with mdio mutex

MDIO_MASTER operation have a dedicated busy wait that is not protected
by the mdio mutex. This can cause situation where the MASTER operation
is done and a normal operation is executed between the MASTER read/write
and the MASTER busy_wait. Rework the qca8k_mdio_read/write function to
address this issue by binding the lock for the whole MASTER operation
and not only the mdio read/write common operation.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/qca8k.c