Skip to contentSkip to conversation

net: phy: marvell: unlock after phy_select_page() failure

PATCH Applied Dan Carpenter 3 participants 3 messages May 29, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: marvell: unlock after phy_select_page() failure

We need to call phy_restore_page() even if phy_select_page() fails. Otherwise we are holding the phy_lock_mdio_bus() lock. This requirement is documented at the start of the phy_select_page() function.

Fixes a618e86da91d ("net : phy: marvell: Speedup TDR data retrieval by only changing page once")
---
 drivers/net/phy/marvell.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/marvell.c +1 -1
index 2c04e3b2b285f..4ea226566cec9 100644
@@ -1867,7 +1867,7 @@ static int marvell_vct5_amplitude_graph(struct phy_device *phydev)
 	 */
 	page = phy_select_page(phydev, MII_MARVELL_VCT5_PAGE);
 	if (page < 0)
-		return page;
+		goto restore_page;
 
 	for (distance = priv->first;
 	     distance <= priv->last;
Signature · 1 line
2.26.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dan Carpenter

We need to call phy_restore_page() even if phy_select_page() fails. Otherwise we are holding the phy_lock_mdio_bus() lock. This requirement is documented at the start of the phy_select_page() function.

Fixes a618e86da91d ("net : phy: marvell: Speedup TDR data retrieval by only changing page once")

Andrew

maintainer Applied
#2 lore raw
In reply to Dan Carpenter

From: Dan Carpenter <[email protected]>
Date: Fri, 29 May 2020 13:02:07 +0300

Quoted 6 lines

We need to call phy_restore_page() even if phy_select_page() fails. Otherwise we are holding the phy_lock_mdio_bus() lock. This requirement is documented at the start of the phy_select_page() function.

Fixes a618e86da91d ("net : phy: marvell: Speedup TDR data retrieval by only changing page once")

Applied, thanks.