diff mbox

e100: Don't enable WoL by default on Toshiba devices

Message ID 1415832445-9524-1-git-send-email-linux@rainbow-software.org
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Ondrej Zary Nov. 12, 2014, 10:47 p.m. UTC
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(-)

Comments

David Miller Nov. 12, 2014, 11:18 p.m. UTC | #1
From: Ondrej Zary <linux@rainbow-software.org>
Date: Wed, 12 Nov 2014 23:47:25 +0100

> 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>

Jeff, are you gonna pick this up?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kirsher, Jeffrey T Nov. 13, 2014, 3:38 a.m. UTC | #2
On Wed, 2014-11-12 at 18:18 -0500, David Miller wrote:
> From: Ondrej Zary <linux@rainbow-software.org>
> Date: Wed, 12 Nov 2014 23:47:25 +0100
> 
> > 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>
> 
> Jeff, are you gonna pick this up?

Yes, sorry I did not catch it earlier.
Ondrej Zary Dec. 12, 2014, 9:11 p.m. UTC | #3
On Thursday 13 November 2014 04:38:47 Jeff Kirsher wrote:
> On Wed, 2014-11-12 at 18:18 -0500, David Miller wrote:
> > From: Ondrej Zary <linux@rainbow-software.org>
> > Date: Wed, 12 Nov 2014 23:47:25 +0100
> >
> > > 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>
> >
> > Jeff, are you gonna pick this up?
>
> Yes, sorry I did not catch it earlier.

Will this go in 3.19?
Ondrej Zary Jan. 15, 2015, 1:40 p.m. UTC | #4
On Thursday 13 November 2014, Jeff Kirsher wrote:
> On Wed, 2014-11-12 at 18:18 -0500, David Miller wrote:
> > From: Ondrej Zary <linux@rainbow-software.org>
> > Date: Wed, 12 Nov 2014 23:47:25 +0100
> >
> > > 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>
> >
> > Jeff, are you gonna pick this up?
>
> Yes, sorry I did not catch it earlier.

What happened to this patch? I don't see it in net.git or net-next.git 
(checked both davem's and jkirsher's)
Kirsher, Jeffrey T Jan. 15, 2015, 2:53 p.m. UTC | #5
On Thu, 2015-01-15 at 14:40 +0100, Ondrej Zary wrote:
> On Thursday 13 November 2014, Jeff Kirsher wrote:
> > On Wed, 2014-11-12 at 18:18 -0500, David Miller wrote:
> > > From: Ondrej Zary <linux@rainbow-software.org>
> > > Date: Wed, 12 Nov 2014 23:47:25 +0100
> > >
> > > > 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>
> > >
> > > Jeff, are you gonna pick this up?
> >
> > Yes, sorry I did not catch it earlier.
> 
> What happened to this patch? I don't see it in net.git or
> net-next.git 
> (checked both davem's and jkirsher's)

Sorry, I thought I had replied with a NAK on this patch after further
review of the changes.

We don't fix BIOS issues in the driver especially regarding feature
enablement like WoL.  We would end up with dozens of these kinds of fixes
if we to allow this.

You should go back to the OEM and ask for a BIOS update to resolve this or
configure udev so that ethtool disables WoL.
Ondrej Zary Jan. 15, 2015, 3:18 p.m. UTC | #6
On Thursday 15 January 2015, Jeff Kirsher wrote:
> On Thu, 2015-01-15 at 14:40 +0100, Ondrej Zary wrote:
> > On Thursday 13 November 2014, Jeff Kirsher wrote:
> > > On Wed, 2014-11-12 at 18:18 -0500, David Miller wrote:
> > > > From: Ondrej Zary <linux@rainbow-software.org>
> > > > Date: Wed, 12 Nov 2014 23:47:25 +0100
> > > >
> > > > > 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>
> > > >
> > > > Jeff, are you gonna pick this up?
> > >
> > > Yes, sorry I did not catch it earlier.
> >
> > What happened to this patch? I don't see it in net.git or
> > net-next.git
> > (checked both davem's and jkirsher's)
>
> Sorry, I thought I had replied with a NAK on this patch after further
> review of the changes.
>
> We don't fix BIOS issues in the driver especially regarding feature
> enablement like WoL.  We would end up with dozens of these kinds of fixes
> if we to allow this.
>
> You should go back to the OEM and ask for a BIOS update to resolve this or
> configure udev so that ethtool disables WoL.

This is not a BIOS bug. When the machine is powered off in BIOS (or GRUB), 
everything is OK.

The bug is that e100 driver enables WoL based on some bit in EEPROM that 
happens to be set on at least some Toshiba laptops and user has no way to 
change it. Windows driver does not do this. Other Linux ethernet drivers 
don't do this. When user wants WoL, (s)he enables it in BIOS and OS. Maybe 
this (mis)feature should be removed from the driver.
Kirsher, Jeffrey T Jan. 15, 2015, 3:31 p.m. UTC | #7
On Thu, 2015-01-15 at 16:18 +0100, Ondrej Zary wrote:
> On Thursday 15 January 2015, Jeff Kirsher wrote:
> > On Thu, 2015-01-15 at 14:40 +0100, Ondrej Zary wrote:
> > > On Thursday 13 November 2014, Jeff Kirsher wrote:
> > > > On Wed, 2014-11-12 at 18:18 -0500, David Miller wrote:
> > > > > From: Ondrej Zary <linux@rainbow-software.org>
> > > > > Date: Wed, 12 Nov 2014 23:47:25 +0100
> > > > >
> > > > > > 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>
> > > > >
> > > > > Jeff, are you gonna pick this up?
> > > >
> > > > Yes, sorry I did not catch it earlier.
> > >
> > > What happened to this patch? I don't see it in net.git or
> > > net-next.git
> > > (checked both davem's and jkirsher's)
> >
> > Sorry, I thought I had replied with a NAK on this patch after further
> > review of the changes.
> >
> > We don't fix BIOS issues in the driver especially regarding feature
> > enablement like WoL.  We would end up with dozens of these kinds of fixes
> > if we to allow this.
> >
> > You should go back to the OEM and ask for a BIOS update to resolve this or
> > configure udev so that ethtool disables WoL.
> 
> This is not a BIOS bug. When the machine is powered off in BIOS (or GRUB), 
> everything is OK.
> 
> The bug is that e100 driver enables WoL based on some bit in EEPROM that 
> happens to be set on at least some Toshiba laptops and user has no way to 
> change it.

Yes, the EEPROM can be modified/updated through the BIOS update I
suggested earlier.  So again, a BIOS issue.

OR you can configure udev so that ethtool disables WoL if you do not
want to pursue a EEPROM update through a BIOS update.

>  Windows driver does not do this. Other Linux ethernet drivers 
> don't do this. When user wants WoL, (s)he enables it in BIOS and OS. Maybe 
> this (mis)feature should be removed from the driver.
>
Ondrej Zary Jan. 15, 2015, 8:15 p.m. UTC | #8
On Thursday 15 January 2015 16:31:04 Jeff Kirsher wrote:
> On Thu, 2015-01-15 at 16:18 +0100, Ondrej Zary wrote:
> > On Thursday 15 January 2015, Jeff Kirsher wrote:
> > > On Thu, 2015-01-15 at 14:40 +0100, Ondrej Zary wrote:
> > > > On Thursday 13 November 2014, Jeff Kirsher wrote:
> > > > > On Wed, 2014-11-12 at 18:18 -0500, David Miller wrote:
> > > > > > From: Ondrej Zary <linux@rainbow-software.org>
> > > > > > Date: Wed, 12 Nov 2014 23:47:25 +0100
> > > > > >
> > > > > > > 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>
> > > > > >
> > > > > > Jeff, are you gonna pick this up?
> > > > >
> > > > > Yes, sorry I did not catch it earlier.
> > > >
> > > > What happened to this patch? I don't see it in net.git or
> > > > net-next.git
> > > > (checked both davem's and jkirsher's)
> > >
> > > Sorry, I thought I had replied with a NAK on this patch after further
> > > review of the changes.
> > >
> > > We don't fix BIOS issues in the driver especially regarding feature
> > > enablement like WoL.  We would end up with dozens of these kinds of
> > > fixes if we to allow this.
> > >
> > > You should go back to the OEM and ask for a BIOS update to resolve this
> > > or configure udev so that ethtool disables WoL.
> >
> > This is not a BIOS bug. When the machine is powered off in BIOS (or
> > GRUB), everything is OK.
> >
> > The bug is that e100 driver enables WoL based on some bit in EEPROM that
> > happens to be set on at least some Toshiba laptops and user has no way to
> > change it.
>
> Yes, the EEPROM can be modified/updated through the BIOS update I
> suggested earlier.  So again, a BIOS issue.

The machine has already the latest BIOS and it's unlikely that Toshiba will 
release a new version for old laptops.

> OR you can configure udev so that ethtool disables WoL if you do not
> want to pursue a EEPROM update through a BIOS update.

I can configure udev but what about other people that install Linux and expect 
it to work (not drain battery after shutdown)? Without needing to know what 
udev, ethtool or WoL is.

> >  Windows driver does not do this. Other Linux ethernet drivers
> > don't do this. When user wants WoL, (s)he enables it in BIOS and OS.
> > Maybe this (mis)feature should be removed from the driver.
diff mbox

Patch

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);
 	}