linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [REGRESSION][PATCH] Fix an old sky2 WOL regression
@ 2012-03-21 11:40 Knut Petersen
  2012-03-21 15:08 ` Stephen Hemminger
  2012-03-21 15:32 ` [PATCH] sky2: override for PCI legacy power management Stephen Hemminger
  0 siblings, 2 replies; 10+ messages in thread
From: Knut Petersen @ 2012-03-21 11:40 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Andrew Morton, Stephen Hemminger, David S. Miller, arekm, Jared,
	dilieto, linux-kernel, netdev

[-- Attachment #1: Type: text/plain, Size: 1455 bytes --]

Sky2 Wake on LAN is broken since February 2010 on a number of systems.
Yes. More than two years.

We know about the problem and the cause since October 2010
(Bugzilla bug #19492). It´s commit 87b09f1f25cd1e01d7c50bf423c7fe33027d7511.

Stephen, David: You signed off that commit.

Andrew: You called it a regression in October 2010.

It has been proposed to revert the commit that caused the problem.
Nothing happened.

I proposed to re-establish the old code for dmi_match()ed systems.
Without success.

Now it is proposed to re-establish the old code as a configuration option.
If nothing happens again I will propose a module parameter ;-)

Stephen, I don´t want to be a pain in the neck, and it is not my intention
to offend you by my "attitude". But I simply cannot understand why this
know regression is not fixed. The bit we talk about is documented,
and in fact it was set for a number of kernel versions unconditionally.
Nobody complained about ruined hardware or minor problems.

The systems affected are old enough that no manufacturer cares about
them, but they are still quite usable for a lot of jobs (kernel 3.3 compile
time here is below 15 minutes).

If there is a problem in the kernel and if we do know an easy solution,
that solution should be commited to the kernel, no matter what is written
in some random documentation, no matter if we could blame some
BIOS authors. That´s the way Linux works - at least I thought so.

cu,
Knut

[-- Attachment #2: 0001-Fix-an-old-sky2-WOL-regression.patch --]
[-- Type: text/x-patch, Size: 2758 bytes --]

>From 7fae2839363277835a0ac1f3f75a788aa299e0a1 Mon Sep 17 00:00:00 2001
From: Knut Petersen <Knut_Petersen@t-online.de>
Date: Wed, 21 Mar 2012 07:42:20 +0100
Subject: [PATCH] Fix an old sky2 WOL regression

Commit 87b09f1f25cd1e01d7c50bf423c7fe33027d7511 removed
code to enable legacy power management mode during wake
on lan initialization. According to the documentation
this was the right thing to do, but it definitely broke
wake on lan on a number of systems.

The regression and the cause of the problem has been
reported more than _18_ months ago, see Bugzilla bug
19492. We should fix it now.

This patch introduces a kernel configuration option that
allows to select inclusion of code to set legacy PM mode
during wake on lan init.

Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
Signed-off-by: Knut Petersen <Knut_Petersen@t-online.de>
---
 drivers/net/ethernet/marvell/Kconfig |   10 ++++++++++
 drivers/net/ethernet/marvell/sky2.c  |   11 ++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/Kconfig b/drivers/net/ethernet/marvell/Kconfig
index 0029934..4f97020 100644
--- a/drivers/net/ethernet/marvell/Kconfig
+++ b/drivers/net/ethernet/marvell/Kconfig
@@ -98,6 +98,16 @@ config SKY2
 	  To compile this driver as a module, choose M here: the module
 	  will be called sky2.  This is recommended.
 
+config SKY2_PME_LEGACY
+	bool "WOL support for broken BIOSes"
+	depends on SKY2 && DEBUG_FS
+	---help---
+	  If this option is set, Yukon 2 legacy power management mode will
+	  be enabled during wake on lan setup. Some BIOS implementations
+	  need this for actual WOL support.
+
+	  If unsure, say N.
+
 config SKY2_DEBUG
 	bool "Debugging interface"
 	depends on SKY2 && DEBUG_FS
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 760c2b1..832589c 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -814,7 +814,9 @@ static void sky2_wol_init(struct sky2_port *sky2)
 	unsigned port = sky2->port;
 	enum flow_control save_mode;
 	u16 ctrl;
-
+#ifdef CONFIG_SKY2_PME_LEGACY
+	u32 reg1;
+#endif
 	/* Bring hardware out of reset */
 	sky2_write16(hw, B0_CTST, CS_RST_CLR);
 	sky2_write16(hw, SK_REG(port, GMAC_LINK_CTRL), GMLC_RST_CLR);
@@ -867,6 +869,13 @@ static void sky2_wol_init(struct sky2_port *sky2)
 	/* Disable PiG firmware */
 	sky2_write16(hw, B0_CTST, Y2_HW_WOL_OFF);
 
+#ifdef CONFIG_SKY2_PME_LEGACY
+	/* Needed by some broken BIOSes*/
+	reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
+	reg1 |= PCI_Y2_PME_LEGACY;
+	sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
+#endif
+
 	/* block receiver */
 	sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
 	sky2_read32(hw, B0_CTST);
-- 
1.7.9.2




^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [REGRESSION][PATCH] Fix an old sky2 WOL regression
  2012-03-21 11:40 [REGRESSION][PATCH] Fix an old sky2 WOL regression Knut Petersen
@ 2012-03-21 15:08 ` Stephen Hemminger
  2012-03-21 15:32 ` [PATCH] sky2: override for PCI legacy power management Stephen Hemminger
  1 sibling, 0 replies; 10+ messages in thread
From: Stephen Hemminger @ 2012-03-21 15:08 UTC (permalink / raw)
  To: Knut Petersen
  Cc: Linus Torvalds, Andrew Morton, David S. Miller, arekm, Jared,
	dilieto, linux-kernel, netdev

On Wed, 21 Mar 2012 12:40:30 +0100
Knut Petersen <Knut_Petersen@t-online.de> wrote:

> Sky2 Wake on LAN is broken since February 2010 on a number of systems.
> Yes. More than two years.
> 
> We know about the problem and the cause since October 2010
> (Bugzilla bug #19492). It´s commit 87b09f1f25cd1e01d7c50bf423c7fe33027d7511.
> 
> Stephen, David: You signed off that commit.
> 
> Andrew: You called it a regression in October 2010.
> 
> It has been proposed to revert the commit that caused the problem.
> Nothing happened.
> 
> I proposed to re-establish the old code for dmi_match()ed systems.
> Without success.
> 
> Now it is proposed to re-establish the old code as a configuration option.
> If nothing happens again I will propose a module parameter ;-)
> 
> Stephen, I don´t want to be a pain in the neck, and it is not my intention
> to offend you by my "attitude". But I simply cannot understand why this
> know regression is not fixed. The bit we talk about is documented,
> and in fact it was set for a number of kernel versions unconditionally.
> Nobody complained about ruined hardware or minor problems.
> 
> The systems affected are old enough that no manufacturer cares about
> them, but they are still quite usable for a lot of jobs (kernel 3.3 compile
> time here is below 15 minutes).
> 
> If there is a problem in the kernel and if we do know an easy solution,
> that solution should be commited to the kernel, no matter what is written
> in some random documentation, no matter if we could blame some
> BIOS authors. That´s the way Linux works - at least I thought so.
> 
> cu,
> Knut

Config options don't work for distro's.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH] sky2: override for PCI legacy power management
  2012-03-21 11:40 [REGRESSION][PATCH] Fix an old sky2 WOL regression Knut Petersen
  2012-03-21 15:08 ` Stephen Hemminger
@ 2012-03-21 15:32 ` Stephen Hemminger
  2012-03-21 15:56   ` Knut Petersen
                     ` (2 more replies)
  1 sibling, 3 replies; 10+ messages in thread
From: Stephen Hemminger @ 2012-03-21 15:32 UTC (permalink / raw)
  To: Knut Petersen, David S. Miller
  Cc: Linus Torvalds, arekm, Jared, dilieto, linux-kernel, netdev

Some BIOS's don't setup power management correctly (what else is
new) and don't allow use of PCI Express power control. Add a special
exception module parameter to allow working around this issue.
Based on slightly different patch by Knut Petersen.

Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
---
Patch against -net (ie. 3.3.0)

--- a/drivers/net/ethernet/marvell/sky2.c	2012-01-10 10:56:56.855156017 -0800
+++ b/drivers/net/ethernet/marvell/sky2.c	2012-03-21 08:25:52.400929532 -0700
@@ -95,6 +95,10 @@ static int disable_msi = 0;
 module_param(disable_msi, int, 0);
 MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
 
+static int legacy_pme = 0;
+module_param(legacy_pme, int, 0);
+MODULE_PARM_DESC(legacy_pme, "Legacy power management");
+
 static DEFINE_PCI_DEVICE_TABLE(sky2_id_table) = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, /* SK-9Sxx */
 	{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, /* SK-9Exx */
@@ -867,6 +871,13 @@ static void sky2_wol_init(struct sky2_po
 	/* Disable PiG firmware */
 	sky2_write16(hw, B0_CTST, Y2_HW_WOL_OFF);
 
+	/* Needed by some broken BIOSes, use PCI rather than PCI-e for WOL */
+	if (legacy_pme) {
+		u32 reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
+		reg1 |= PCI_Y2_PME_LEGACY;
+		sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
+	}
+
 	/* block receiver */
 	sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
 	sky2_read32(hw, B0_CTST);

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] sky2: override for PCI legacy power management
  2012-03-21 15:32 ` [PATCH] sky2: override for PCI legacy power management Stephen Hemminger
@ 2012-03-21 15:56   ` Knut Petersen
  2012-03-21 20:22   ` Bjorn Helgaas
  2012-03-21 20:56   ` David Miller
  2 siblings, 0 replies; 10+ messages in thread
From: Knut Petersen @ 2012-03-21 15:56 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: David S. Miller, Linus Torvalds, arekm, Jared, dilieto,
	linux-kernel, netdev

Thanks a lot!

> Some BIOS's don't setup power management correctly (what else is
> new) and don't allow use of PCI Express power control. Add a special
> exception module parameter to allow working around this issue.
> Based on slightly different patch by Knut Petersen.
>
> Reported-by: Arkadiusz Miskiewicz<arekm@maven.pl>
> Signed-off-by: Stephen Hemminger<shemminger@vyatta.com>
>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] sky2: override for PCI legacy power management
  2012-03-21 15:32 ` [PATCH] sky2: override for PCI legacy power management Stephen Hemminger
  2012-03-21 15:56   ` Knut Petersen
@ 2012-03-21 20:22   ` Bjorn Helgaas
  2012-03-21 20:47     ` Stephen Hemminger
  2012-03-22 22:36     ` Knut Petersen
  2012-03-21 20:56   ` David Miller
  2 siblings, 2 replies; 10+ messages in thread
From: Bjorn Helgaas @ 2012-03-21 20:22 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Knut Petersen, David S. Miller, Linus Torvalds, arekm, Jared,
	dilieto, linux-kernel, netdev

On Wed, Mar 21, 2012 at 9:32 AM, Stephen Hemminger
<shemminger@vyatta.com> wrote:
> Some BIOS's don't setup power management correctly (what else is
> new) and don't allow use of PCI Express power control. Add a special
> exception module parameter to allow working around this issue.
> Based on slightly different patch by Knut Petersen.
>
> Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Is there a problem report URL you can include here?

It looks like this requires a user to figure out that he might be
suffering from this problem, then use this module parameter to work
around it.  How would a user figure that out?  Can we do it
automatically to save him the trouble?

> ---
> Patch against -net (ie. 3.3.0)
>
> --- a/drivers/net/ethernet/marvell/sky2.c       2012-01-10 10:56:56.855156017 -0800
> +++ b/drivers/net/ethernet/marvell/sky2.c       2012-03-21 08:25:52.400929532 -0700
> @@ -95,6 +95,10 @@ static int disable_msi = 0;
>  module_param(disable_msi, int, 0);
>  MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
>
> +static int legacy_pme = 0;
> +module_param(legacy_pme, int, 0);
> +MODULE_PARM_DESC(legacy_pme, "Legacy power management");
> +
>  static DEFINE_PCI_DEVICE_TABLE(sky2_id_table) = {
>        { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, /* SK-9Sxx */
>        { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, /* SK-9Exx */
> @@ -867,6 +871,13 @@ static void sky2_wol_init(struct sky2_po
>        /* Disable PiG firmware */
>        sky2_write16(hw, B0_CTST, Y2_HW_WOL_OFF);
>
> +       /* Needed by some broken BIOSes, use PCI rather than PCI-e for WOL */
> +       if (legacy_pme) {
> +               u32 reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
> +               reg1 |= PCI_Y2_PME_LEGACY;
> +               sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
> +       }
> +
>        /* block receiver */
>        sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
>        sky2_read32(hw, B0_CTST);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] sky2: override for PCI legacy power management
  2012-03-21 20:22   ` Bjorn Helgaas
@ 2012-03-21 20:47     ` Stephen Hemminger
  2012-03-21 20:54       ` Bjorn Helgaas
  2012-03-22 22:36     ` Knut Petersen
  1 sibling, 1 reply; 10+ messages in thread
From: Stephen Hemminger @ 2012-03-21 20:47 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Knut Petersen, David S. Miller, Linus Torvalds, arekm, Jared,
	dilieto, linux-kernel, netdev

On Wed, 21 Mar 2012 14:22:01 -0600
Bjorn Helgaas <bhelgaas@google.com> wrote:

> On Wed, Mar 21, 2012 at 9:32 AM, Stephen Hemminger
> <shemminger@vyatta.com> wrote:
> > Some BIOS's don't setup power management correctly (what else is
> > new) and don't allow use of PCI Express power control. Add a special
> > exception module parameter to allow working around this issue.
> > Based on slightly different patch by Knut Petersen.
> >
> > Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> Is there a problem report URL you can include here?
> 
> It looks like this requires a user to figure out that he might be
> suffering from this problem, then use this module parameter to work
> around it.  How would a user figure that out?  Can we do it
> automatically to save him the trouble?

I am not a power management expert. Looks like a BIOS issue where the
BIOS has configured the device to disable power management but the
user wants to override that value. There is no method to determine
when the BIOS is broken versus when the BIOS setting is correct and
we should follow what it says.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] sky2: override for PCI legacy power management
  2012-03-21 20:47     ` Stephen Hemminger
@ 2012-03-21 20:54       ` Bjorn Helgaas
  0 siblings, 0 replies; 10+ messages in thread
From: Bjorn Helgaas @ 2012-03-21 20:54 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Knut Petersen, David S. Miller, Linus Torvalds, arekm, Jared,
	dilieto, linux-kernel, netdev

On Wed, Mar 21, 2012 at 2:47 PM, Stephen Hemminger
<shemminger@vyatta.com> wrote:
> On Wed, 21 Mar 2012 14:22:01 -0600
> Bjorn Helgaas <bhelgaas@google.com> wrote:
>
>> On Wed, Mar 21, 2012 at 9:32 AM, Stephen Hemminger
>> <shemminger@vyatta.com> wrote:
>> > Some BIOS's don't setup power management correctly (what else is
>> > new) and don't allow use of PCI Express power control. Add a special
>> > exception module parameter to allow working around this issue.
>> > Based on slightly different patch by Knut Petersen.
>> >
>> > Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
>> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>>
>> Is there a problem report URL you can include here?
>>
>> It looks like this requires a user to figure out that he might be
>> suffering from this problem, then use this module parameter to work
>> around it.  How would a user figure that out?  Can we do it
>> automatically to save him the trouble?
>
> I am not a power management expert. Looks like a BIOS issue where the
> BIOS has configured the device to disable power management but the
> user wants to override that value. There is no method to determine
> when the BIOS is broken versus when the BIOS setting is correct and
> we should follow what it says.

I'm not a power management expert either.  I was just wondering
whether the known broken BIOSes could be encoded in a blacklist or
something, because it looks like a case where a user might have to
request help or debug the problem again before discovering this flag.

Bjorn

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] sky2: override for PCI legacy power management
  2012-03-21 15:32 ` [PATCH] sky2: override for PCI legacy power management Stephen Hemminger
  2012-03-21 15:56   ` Knut Petersen
  2012-03-21 20:22   ` Bjorn Helgaas
@ 2012-03-21 20:56   ` David Miller
  2 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2012-03-21 20:56 UTC (permalink / raw)
  To: shemminger
  Cc: Knut_Petersen, torvalds, arekm, nitro, dilieto, linux-kernel, netdev

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Wed, 21 Mar 2012 08:32:05 -0700

> Some BIOS's don't setup power management correctly (what else is
> new) and don't allow use of PCI Express power control. Add a special
> exception module parameter to allow working around this issue.
> Based on slightly different patch by Knut Petersen.
> 
> Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Applied and queued up for -stable.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] sky2: override for PCI legacy power management
  2012-03-21 20:22   ` Bjorn Helgaas
  2012-03-21 20:47     ` Stephen Hemminger
@ 2012-03-22 22:36     ` Knut Petersen
  2012-05-06 22:26       ` Jonathan Nieder
  1 sibling, 1 reply; 10+ messages in thread
From: Knut Petersen @ 2012-03-22 22:36 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Stephen Hemminger, David S. Miller, Linus Torvalds, arekm, Jared,
	dilieto, linux-kernel, netdev

Am 21.03.2012 21:22, schrieb Bjorn Helgaas:
> It looks like this requires a user to figure out that he might be suffering from this problem, then use this module parameter to work around it. How would a user figure that out? Can we do it automatically to save him the trouble?

It´s easy to dmi_match() known broken systems - I have dmidecode outputs of four systems that definitely need the patch.
Two ASUSTek P5* mainboards with AMI BIOSes, two AOpen i915G* mainboards with Award/Phoenix BIOSes.

cu,
  Knut

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] sky2: override for PCI legacy power management
  2012-03-22 22:36     ` Knut Petersen
@ 2012-05-06 22:26       ` Jonathan Nieder
  0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Nieder @ 2012-05-06 22:26 UTC (permalink / raw)
  To: Knut Petersen
  Cc: Bjorn Helgaas, Stephen Hemminger, David S. Miller,
	Linus Torvalds, arekm, Jared, dilieto, linux-kernel, netdev

Knut Petersen wrote, a few months ago:

> It´s easy to dmi_match() known broken systems - I have dmidecode
> outputs of four systems that definitely need the patch.
>
> Two ASUSTek P5* mainboards with AMI BIOSes, two AOpen i915G*
> mainboards with Award/Phoenix BIOSes.

Yes, please.  Could you attach those to [1]?

Thanks,
Jonathan

[1] https://bugzilla.kernel.org/show_bug.cgi?id=19492

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-05-06 22:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-21 11:40 [REGRESSION][PATCH] Fix an old sky2 WOL regression Knut Petersen
2012-03-21 15:08 ` Stephen Hemminger
2012-03-21 15:32 ` [PATCH] sky2: override for PCI legacy power management Stephen Hemminger
2012-03-21 15:56   ` Knut Petersen
2012-03-21 20:22   ` Bjorn Helgaas
2012-03-21 20:47     ` Stephen Hemminger
2012-03-21 20:54       ` Bjorn Helgaas
2012-03-22 22:36     ` Knut Petersen
2012-05-06 22:26       ` Jonathan Nieder
2012-03-21 20:56   ` David Miller

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