diff mbox

sky2: override for PCI legacy power management

Message ID 20120321083205.360a7a3b@nehalam.linuxnetplumber.net
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

stephen hemminger March 21, 2012, 3:32 p.m. UTC
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)

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

Comments

Knut Petersen March 21, 2012, 3:56 p.m. UTC | #1
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>
>

--
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
Bjorn Helgaas March 21, 2012, 8:22 p.m. UTC | #2
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/
--
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
stephen hemminger March 21, 2012, 8:47 p.m. UTC | #3
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.
--
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
Bjorn Helgaas March 21, 2012, 8:54 p.m. UTC | #4
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
--
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
David Miller March 21, 2012, 8:56 p.m. UTC | #5
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.
--
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
Knut Petersen March 22, 2012, 10:36 p.m. UTC | #6
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
--
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
Jonathan Nieder May 6, 2012, 10:26 p.m. UTC | #7
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
--
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
diff mbox

Patch

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