Message ID | 20230310074500.3472858-1-alexander.stein@ew.tq-group.com (mailing list archive) |
---|---|
State | Accepted |
Commit | c5a8027de26e1b7c0ba4f8e430165b6a4a29a869 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [v2,1/1] net: phy: dp83867: Disable IRQs on suspend | expand |
On Fri, Mar 10, 2023 at 08:45:00AM +0100, Alexander Stein wrote: > 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> Andrew
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Fri, 10 Mar 2023 08:45:00 +0100 you wrote: > 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> > --- > Changes in v2: > * Directly call dp83867_config_intr > * Call genphy_resume after enabling IRQs again > * Removed superfluous empty line > > [...] Here is the summary with links: - [v2,1/1] net: phy: dp83867: Disable IRQs on suspend https://git.kernel.org/netdev/net-next/c/c5a8027de26e You are awesome, thank you!
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index 89cd821f1f46..5821f04c69dc 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -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,
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> --- Changes in v2: * Directly call dp83867_config_intr * Call genphy_resume after enabling IRQs again * Removed superfluous empty line drivers/net/phy/dp83867.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-)