netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ondrej Zary <linux@rainbow-software.org>
To: e1000-devel@lists.sourceforge.net
Cc: netdev@vger.kernel.org,
	Kernel development list <linux-kernel@vger.kernel.org>
Subject: [PATCH] e100: Don't enable WoL by default on Toshiba devices
Date: Wed, 12 Nov 2014 23:47:25 +0100	[thread overview]
Message-ID: <1415832445-9524-1-git-send-email-linux@rainbow-software.org> (raw)

Enabling WoL on some Toshiba laptops (such as Portege R100) causes battery
drain after shutdown (WoL is active even on battery). These laptops have the
WoL bit set in EEPROM ID, causing e100 driver to enable WoL by default.

Check subsystem vendor ID and if it's Toshiba, don't enable WoL by default
from EEPROM settings.

Fixes https://bugs.launchpad.net/ubuntu/+source/linux/+bug/110784

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
---
 drivers/net/ethernet/intel/e100.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index 781065e..daf8fcc 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -2949,9 +2949,12 @@ static int e100_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		}
 	}
 
-	/* Wol magic packet can be enabled from eeprom */
-	if ((nic->mac >= mac_82558_D101_A4) &&
-	   (nic->eeprom[eeprom_id] & eeprom_id_wol)) {
+	/* Wol magic packet can be enabled from eeprom
+	 * Don't enable WoL by default on Toshiba laptops as it causes battery
+	 * drain after shutdown */
+	if ((pdev->subsystem_vendor != PCI_VENDOR_ID_TOSHIBA) &&
+	    (nic->mac >= mac_82558_D101_A4) &&
+	    (nic->eeprom[eeprom_id] & eeprom_id_wol)) {
 		nic->flags |= wol_magic;
 		device_set_wakeup_enable(&pdev->dev, true);
 	}
-- 
Ondrej Zary

             reply	other threads:[~2014-11-12 22:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12 22:47 Ondrej Zary [this message]
2014-11-12 23:18 ` [PATCH] e100: Don't enable WoL by default on Toshiba devices David Miller
2014-11-13  3:38   ` Jeff Kirsher
2014-12-12 21:11     ` Ondrej Zary
2015-01-15 13:40     ` Ondrej Zary
2015-01-15 14:53       ` Jeff Kirsher
2015-01-15 15:18         ` Ondrej Zary
2015-01-15 15:31           ` Jeff Kirsher
2015-01-15 20:15             ` Ondrej Zary

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1415832445-9524-1-git-send-email-linux@rainbow-software.org \
    --to=linux@rainbow-software.org \
    --cc=e1000-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).