Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361086
b: refs/heads/master
c: e60b22c
h: refs/heads/master
v: v3
  • Loading branch information
Konstantin Khlebnikov authored and Jeff Kirsher committed Mar 7, 2013
1 parent 3f13c0a commit 94db773
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 66148babe728f3e00e13c56f6b0ecf325abd80da
refs/heads/master: e60b22c5b7e59db09a7c9490b1e132c7e49ae904
13 changes: 13 additions & 0 deletions trunk/drivers/net/ethernet/intel/e1000e/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <linux/delay.h>
#include <linux/vmalloc.h>
#include <linux/mdio.h>
#include <linux/pm_runtime.h>

#include "e1000.h"

Expand Down Expand Up @@ -2229,7 +2230,19 @@ static int e1000e_get_ts_info(struct net_device *netdev,
return 0;
}

static int e1000e_ethtool_begin(struct net_device *netdev)
{
return pm_runtime_get_sync(netdev->dev.parent);
}

static void e1000e_ethtool_complete(struct net_device *netdev)
{
pm_runtime_put_sync(netdev->dev.parent);
}

static const struct ethtool_ops e1000_ethtool_ops = {
.begin = e1000e_ethtool_begin,
.complete = e1000e_ethtool_complete,
.get_settings = e1000_get_settings,
.set_settings = e1000_set_settings,
.get_drvinfo = e1000_get_drvinfo,
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/ethernet/intel/e1000e/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -4663,6 +4663,7 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter)
(adapter->hw.phy.media_type == e1000_media_type_copper)) {
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_BMSR, &phy->bmsr);
ret_val |= e1e_rphy(hw, MII_ADVERTISE, &phy->advertise);
Expand All @@ -4673,6 +4674,7 @@ static void e1000_phy_read_status(struct e1000_adapter *adapter)
ret_val |= e1e_rphy(hw, MII_ESTATUS, &phy->estatus);
if (ret_val)
e_warn("Error reading PHY register\n");
pm_runtime_put_sync(&adapter->pdev->dev);
} else {
/* Do not read PHY registers if link is not up
* Set values to typical power-on defaults
Expand Down

0 comments on commit 94db773

Please sign in to comment.