e1000e: Do not wake up the system via WOL if device wakeup is disabled
authorChen Yu <yu.c.chen@intel.com>
Thu, 21 May 2020 17:59:00 +0000 (01:59 +0800)
committerSasha Levin <sashal@kernel.org>
Tue, 30 Jun 2020 19:38:33 +0000 (15:38 -0400)
commit97a17ed442c5d1ddf65588784c2a2ba7f33c26ca
treed9eabf63f1e5ff2c46ad7c7cfadc7f58d094d5fd
parented61e8c59be09d2c015bdf576f45425f1e6f41ac
e1000e: Do not wake up the system via WOL if device wakeup is disabled

[ Upstream commit 6bf6be1127f7e6d4bf39f84d56854e944d045d74 ]

Currently the system will be woken up via WOL(Wake On LAN) even if the
device wakeup ability has been disabled via sysfs:
 cat /sys/devices/pci0000:00/0000:00:1f.6/power/wakeup
 disabled

The system should not be woken up if the user has explicitly
disabled the wake up ability for this device.

This patch clears the WOL ability of this network device if the
user has disabled the wake up ability in sysfs.

Fixes: bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver")
Reported-by: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/e1000e/netdev.c