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: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20230310074500.3472858-1-alexander.stein@ew.tq-group.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Alexander Stein 2023-03-10 08:45:00 +01:00 committed by Jakub Kicinski
parent e4ed8ba08e
commit c5a8027de2
1 changed files with 26 additions and 2 deletions

View File

@ -693,6 +693,30 @@ static int dp83867_of_init(struct phy_device *phydev)
}
#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)
{
struct dp83867_private *dp83867;
@ -968,8 +992,8 @@ static struct phy_driver dp83867_driver[] = {
.config_intr = dp83867_config_intr,
.handle_interrupt = dp83867_handle_interrupt,
.suspend = genphy_suspend,
.resume = genphy_resume,
.suspend = dp83867_suspend,
.resume = dp83867_resume,
.link_change_notify = dp83867_link_change_notify,
.set_loopback = dp83867_loopback,