Commit c5a8027d authored by Alexander Stein's avatar Alexander Stein Committed by Jakub Kicinski

net: phy: dp83867: Disable IRQs on suspend

Before putting the PHY into IEEE power down mode, disable IRQs to
prevent accessing the PHY once MDIO has already been shutdown.
Signed-off-by: default avatarAlexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20230310074500.3472858-1-alexander.stein@ew.tq-group.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e4ed8ba0
...@@ -693,6 +693,30 @@ static int dp83867_of_init(struct phy_device *phydev) ...@@ -693,6 +693,30 @@ static int dp83867_of_init(struct phy_device *phydev)
} }
#endif /* CONFIG_OF_MDIO */ #endif /* CONFIG_OF_MDIO */
static int dp83867_suspend(struct phy_device *phydev)
{
/* Disable PHY Interrupts */
if (phy_interrupt_is_valid(phydev)) {
phydev->interrupts = PHY_INTERRUPT_DISABLED;
dp83867_config_intr(phydev);
}
return genphy_suspend(phydev);
}
static int dp83867_resume(struct phy_device *phydev)
{
/* Enable PHY Interrupts */
if (phy_interrupt_is_valid(phydev)) {
phydev->interrupts = PHY_INTERRUPT_ENABLED;
dp83867_config_intr(phydev);
}
genphy_resume(phydev);
return 0;
}
static int dp83867_probe(struct phy_device *phydev) static int dp83867_probe(struct phy_device *phydev)
{ {
struct dp83867_private *dp83867; struct dp83867_private *dp83867;
...@@ -968,8 +992,8 @@ static struct phy_driver dp83867_driver[] = { ...@@ -968,8 +992,8 @@ static struct phy_driver dp83867_driver[] = {
.config_intr = dp83867_config_intr, .config_intr = dp83867_config_intr,
.handle_interrupt = dp83867_handle_interrupt, .handle_interrupt = dp83867_handle_interrupt,
.suspend = genphy_suspend, .suspend = dp83867_suspend,
.resume = genphy_resume, .resume = dp83867_resume,
.link_change_notify = dp83867_link_change_notify, .link_change_notify = dp83867_link_change_notify,
.set_loopback = dp83867_loopback, .set_loopback = dp83867_loopback,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment