]> git.itanic.dy.fi Git - linux-stable/commit
net: phy: aquantia: wait for the suspend/resume operations to finish
authorIoana Ciornei <ioana.ciornei@nxp.com>
Tue, 6 Sep 2022 13:04:51 +0000 (16:04 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 13 Sep 2022 07:55:34 +0000 (09:55 +0200)
commitca2dccdeeb49a7e408112d681bf447984c845292
tree676781898701c11d6f02167b7ca50cc288092852
parent64ae13ed478428135cddc2f1113dff162d8112d4
net: phy: aquantia: wait for the suspend/resume operations to finish

The Aquantia datasheet notes that after issuing a Processor-Intensive
MDIO operation, like changing the low-power state of the device, the
driver should wait for the operation to finish before issuing a new MDIO
command.

The new aqr107_wait_processor_intensive_op() function is added which can
be used after these kind of MDIO operations. At the moment, we are only
adding it at the end of the suspend/resume calls.

The issue was identified on a board featuring the AQR113C PHY, on
which commands like 'ip link (..) up / down' issued without any delays
between them would render the link on the PHY to remain down.
The issue was easy to reproduce with a one-liner:
 $ ip link set dev ethX down; ip link set dev ethX up; \
 ip link set dev ethX down; ip link set dev ethX up;

Fixes: ac9e81c230eb ("net: phy: aquantia: add suspend / resume callbacks for AQR107 family")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20220906130451.1483448-1-ioana.ciornei@nxp.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/phy/aquantia_main.c