Commit 54744510 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Jakub Kicinski

r8169: improve driver unload and system shutdown behavior on DASH-enabled systems

There's a number of systems supporting DASH remote management.
Driver unload and system shutdown can result in the PHY suspending,
thus making DASH unusable. Improve this by handling DASH being enabled
very similar to WoL being enabled.
Tested-by: default avatarYanko Kaneti <yaneti@declera.com>
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/1de3b176-c09c-1654-6f00-9785f7a4f954@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent fad6c1f1
...@@ -1397,8 +1397,11 @@ static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts) ...@@ -1397,8 +1397,11 @@ static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts)
rtl_lock_config_regs(tp); rtl_lock_config_regs(tp);
device_set_wakeup_enable(tp_to_dev(tp), wolopts); device_set_wakeup_enable(tp_to_dev(tp), wolopts);
rtl_set_d3_pll_down(tp, !wolopts);
tp->dev->wol_enabled = wolopts ? 1 : 0; if (tp->dash_type == RTL_DASH_NONE) {
rtl_set_d3_pll_down(tp, !wolopts);
tp->dev->wol_enabled = wolopts ? 1 : 0;
}
} }
static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
...@@ -4938,6 +4941,9 @@ static int rtl8169_runtime_idle(struct device *device) ...@@ -4938,6 +4941,9 @@ static int rtl8169_runtime_idle(struct device *device)
{ {
struct rtl8169_private *tp = dev_get_drvdata(device); struct rtl8169_private *tp = dev_get_drvdata(device);
if (tp->dash_type != RTL_DASH_NONE)
return -EBUSY;
if (!netif_running(tp->dev) || !netif_carrier_ok(tp->dev)) if (!netif_running(tp->dev) || !netif_carrier_ok(tp->dev))
pm_schedule_suspend(device, 10000); pm_schedule_suspend(device, 10000);
...@@ -4978,7 +4984,8 @@ static void rtl_shutdown(struct pci_dev *pdev) ...@@ -4978,7 +4984,8 @@ static void rtl_shutdown(struct pci_dev *pdev)
/* Restore original MAC address */ /* Restore original MAC address */
rtl_rar_set(tp, tp->dev->perm_addr); rtl_rar_set(tp, tp->dev->perm_addr);
if (system_state == SYSTEM_POWER_OFF) { if (system_state == SYSTEM_POWER_OFF &&
tp->dash_type == RTL_DASH_NONE) {
if (tp->saved_wolopts) if (tp->saved_wolopts)
rtl_wol_shutdown_quirk(tp); rtl_wol_shutdown_quirk(tp);
...@@ -5449,7 +5456,12 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -5449,7 +5456,12 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
/* configure chip for default features */ /* configure chip for default features */
rtl8169_set_features(dev, dev->features); rtl8169_set_features(dev, dev->features);
rtl_set_d3_pll_down(tp, true); if (tp->dash_type == RTL_DASH_NONE) {
rtl_set_d3_pll_down(tp, true);
} else {
rtl_set_d3_pll_down(tp, false);
dev->wol_enabled = 1;
}
jumbo_max = rtl_jumbo_max(tp); jumbo_max = rtl_jumbo_max(tp);
if (jumbo_max) if (jumbo_max)
......
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