From: "Matt Carlson" <mcarlson@broadcom.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: "Michael Chan" <mchan@broadcom.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"Jeff Garzik" <jeff@garzik.org>,
LKML <linux-kernel@vger.kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>
Subject: Re: [PATCH] net (tg3): Fix failure to enable WoL by default when possible (rev. 2)
Date: Mon, 8 Dec 2008 11:04:03 -0800 [thread overview]
Message-ID: <20081208190403.GA27341@xw6200.broadcom.net> (raw)
In-Reply-To: <200812081252.55715.rjw@sisk.pl>
This has mostly been fixed up already in Dave Miller's tree. In that
tree, the WOL capability advertisements happens at the end of the
tg3_get_eeprom_hw_cfg() function.
Your patch did uncover a bug though. The removal of device_may_wakeup()
in the first hunk of your patch still needs to be done.
On Mon, Dec 08, 2008 at 03:52:55AM -0800, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rjw@sisk.pl>
> Subject: net (tg3): Fix failure to enable WoL by default when possible (rev. 2)
>
> tg3 is supposed to enable WoL by default on adapters which support
> that, but it fails to do so unless the adapter's
> /sys/devices/.../power/wakeup file contains 'enabled' during the
> initialization of the adapter. Fix that by making tg3 update the
> device's 'should_wakeup' bit automatically whenever WoL should be
> enabled by default.
>
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> ---
> drivers/net/tg3.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> Index: linux-2.6/drivers/net/tg3.c
> ===================================================================
> --- linux-2.6.orig/drivers/net/tg3.c
> +++ linux-2.6/drivers/net/tg3.c
> @@ -11296,9 +11296,10 @@ static void __devinit tg3_get_eeprom_hw_
> if (val & VCPU_CFGSHDW_ASPM_DBNC)
> tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND;
> if ((val & VCPU_CFGSHDW_WOL_ENABLE) &&
> - (val & VCPU_CFGSHDW_WOL_MAGPKT) &&
> - device_may_wakeup(&tp->pdev->dev))
> + (val & VCPU_CFGSHDW_WOL_MAGPKT)) {
> tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
> + device_set_wakeup_enable(&tp->pdev->dev, true);
> + }
> return;
> }
>
> @@ -11428,9 +11429,10 @@ static void __devinit tg3_get_eeprom_hw_
> tp->tg3_flags &= ~TG3_FLAG_WOL_CAP;
>
> if ((tp->tg3_flags & TG3_FLAG_WOL_CAP) &&
> - (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE) &&
> - device_may_wakeup(&tp->pdev->dev))
> + (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE)) {
> tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
> + device_set_wakeup_enable(&tp->pdev->dev, true);
> + }
>
> if (cfg2 & (1 << 17))
> tp->tg3_flags2 |= TG3_FLG2_CAPACITIVE_COUPLING;
> --
> 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
>
next prev parent reply other threads:[~2008-12-08 19:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-07 23:46 net (tg3): Fix failure to enable WoL by default when possible Rafael J. Wysocki
2008-12-08 11:50 ` Rafael J. Wysocki
2008-12-08 11:52 ` [PATCH] net (tg3): Fix failure to enable WoL by default when possible (rev. 2) Rafael J. Wysocki
2008-12-08 19:04 ` Matt Carlson [this message]
2008-12-09 8:20 ` David Miller
2008-12-09 20:26 ` Rafael J. Wysocki
2008-12-09 20:39 ` Matt Carlson
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=20081208190403.GA27341@xw6200.broadcom.net \
--to=mcarlson@broadcom.com \
--cc=akpm@linux-foundation.org \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=rjw@sisk.pl \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.