Skip to content

Commit

Permalink
net: phy: mscc: remove unnecessary phydev locking
Browse files Browse the repository at this point in the history
Holding the struct phy_device (phydev) lock is unnecessary when
accessing phydev->interface in the PHY driver .config_init method,
which is the only place that vsc85xx_rgmii_set_skews() is called from.

The phy_modify_paged() function implements required MDIO bus level
locking, which can not be achieved by a phydev lock.

Signed-off-by: David Epping <david.epping@missinglinkelectronics.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
David Epping authored and Jakub Kicinski committed May 25, 2023
1 parent fb055ce commit 7df0b33
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/net/phy/mscc/mscc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,6 @@ static int vsc85xx_rgmii_set_skews(struct phy_device *phydev, u32 rgmii_cntl,
u16 reg_val = 0;
int rc;

mutex_lock(&phydev->lock);

if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID ||
phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
reg_val |= RGMII_CLK_DELAY_2_0_NS << rgmii_rx_delay_pos;
Expand All @@ -542,8 +540,6 @@ static int vsc85xx_rgmii_set_skews(struct phy_device *phydev, u32 rgmii_cntl,
rgmii_rx_delay_mask | rgmii_tx_delay_mask,
reg_val);

mutex_unlock(&phydev->lock);

return rc;
}

Expand Down

0 comments on commit 7df0b33

Please sign in to comment.