]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitbd9c7a7f4d6d5a34e24ed34cc3f199b101f820da
tree09ed4e74324c8fdbd042d90af25f631545f0424c
parent948d670aff06222c1e3154ec7e87924c00d6b920
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