e1000e: fix accessing to suspended device
This patch fixes some annoying messages like 'Error reading PHY register' and 'Hardware Erorr' and saves several seconds on reboot. Cc: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Tested-by: Borislav Petkov <bp@suse.de> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:

committed by
Jeff Kirsher

parent
66148babe7
commit
e60b22c5b7
@@ -36,6 +36,7 @@
|
||||
#include <linux/delay.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/mdio.h>
|
||||
#include <linux/pm_runtime.h>
|
||||
|
||||
#include "e1000.h"
|
||||
|
||||
@@ -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,
|
||||
|
Reference in New Issue
Block a user