r8169: use mac-managed PHY PM
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 7 Apr 2021 15:53:52 +0000 (17:53 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 9 Apr 2021 23:37:05 +0000 (16:37 -0700)
Use the new mac_managed_pm flag to indicate that the driver takes care
of PHY power management.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/realtek/r8169_main.c

index 1cd5c6f6d44f2ee65b87d18896cb338d31ada25c..85031b4721fa673260cdf0a7f45efc66a467b866 100644 (file)
@@ -4660,6 +4660,7 @@ static void rtl8169_down(struct rtl8169_private *tp)
 static void rtl8169_up(struct rtl8169_private *tp)
 {
        pci_set_master(tp->pci_dev);
+       phy_init_hw(tp->phydev);
        phy_resume(tp->phydev);
        rtl8169_init_phy(tp);
        napi_enable(&tp->napi);
@@ -5085,6 +5086,8 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
                return -EUNATCH;
        }
 
+       tp->phydev->mac_managed_pm = 1;
+
        /* PHY will be woken up in rtl_open() */
        phy_suspend(tp->phydev);