Commit 97390ab8 authored by Bruce Allan's avatar Bruce Allan Committed by Jeff Kirsher

e1000e: do not resume device from RPM suspend to read PHY status registers

When the device is runtime suspended (e.g. when there is no link), do not
wake it from D3 to read the PHY status; just set the values to typical
power-on defaults as is done when runtime PM is not enabled and there is no
link.
Signed-off-by: default avatarBruce Allan <bruce.w.allan@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 91a3d82f
...@@ -4684,11 +4684,11 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter) ...@@ -4684,11 +4684,11 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter)
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
struct e1000_phy_regs *phy = &adapter->phy_regs; struct e1000_phy_regs *phy = &adapter->phy_regs;
if ((er32(STATUS) & E1000_STATUS_LU) && if (!pm_runtime_suspended((&adapter->pdev->dev)->parent) &&
(er32(STATUS) & E1000_STATUS_LU) &&
(adapter->hw.phy.media_type == e1000_media_type_copper)) { (adapter->hw.phy.media_type == e1000_media_type_copper)) {
int ret_val; int ret_val;
pm_runtime_get_sync(&adapter->pdev->dev);
ret_val = e1e_rphy(hw, MII_BMCR, &phy->bmcr); ret_val = e1e_rphy(hw, MII_BMCR, &phy->bmcr);
ret_val |= e1e_rphy(hw, MII_BMSR, &phy->bmsr); ret_val |= e1e_rphy(hw, MII_BMSR, &phy->bmsr);
ret_val |= e1e_rphy(hw, MII_ADVERTISE, &phy->advertise); ret_val |= e1e_rphy(hw, MII_ADVERTISE, &phy->advertise);
...@@ -4699,7 +4699,6 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter) ...@@ -4699,7 +4699,6 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter)
ret_val |= e1e_rphy(hw, MII_ESTATUS, &phy->estatus); ret_val |= e1e_rphy(hw, MII_ESTATUS, &phy->estatus);
if (ret_val) if (ret_val)
e_warn("Error reading PHY register\n"); e_warn("Error reading PHY register\n");
pm_runtime_put_sync(&adapter->pdev->dev);
} else { } else {
/* Do not read PHY registers if link is not up /* Do not read PHY registers if link is not up
* Set values to typical power-on defaults * Set values to typical power-on defaults
......
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