Skip to content

Commit

Permalink
net: phy: marvell: unlock after phy_select_page() failure
Browse files Browse the repository at this point in the history
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: a618e86 ("net : phy: marvell: Speedup TDR data retrieval by only changing page once")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed May 29, 2020
1 parent 2684bda commit 830f5ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/phy/marvell.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 830f5ce

Please sign in to comment.