summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2020-05-10 21:12:32 +0200
committerJakub Kicinski <kuba@kernel.org>2020-05-10 21:28:41 +0200
commit97c22438963a7484c05c59ab6654e30f0a3e9288 (patch)
tree1a3c5517a00a8f104f207d9eb7d13f534a83beb4 /drivers/net/phy/phy.c
parentnet: phy: Add cable test support to state machine (diff)
downloadlinux-97c22438963a7484c05c59ab6654e30f0a3e9288.tar.xz
linux-97c22438963a7484c05c59ab6654e30f0a3e9288.zip
net: phy: Add support for polling cable test
Some PHYs are not capable of generating interrupts when a cable test finished. They do however support interrupts for normal operations, like link up/down. As such, the PHY state machine would normally not poll the PHY. Add support for indicating the PHY state machine must poll the PHY when performing a cable test. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r--drivers/net/phy/phy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 0f4b27215429..9fa61019533f 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -523,6 +523,8 @@ int phy_start_cable_test(struct phy_device *phydev,
phydev->state = PHY_CABLETEST;
+ if (phy_polling_mode(phydev))
+ phy_trigger_machine(phydev);
out:
mutex_unlock(&phydev->lock);