netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@sig21.net>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 8/8] alx: remove WoL support
Date: Sun, 30 Jun 2013 17:03:04 +0200	[thread overview]
Message-ID: <20130630150304.GA24189@sig21.net> (raw)
In-Reply-To: <1372534845.17242.0.camel@jlt4.sipsolutions.net>

Hi Johannes,

I applied patches 1-7 of your series and the patch below
on top of it.  I had added some debug prints and found
that today alx_select_powersaving_speed() always found
a valid link after __alx_stop(), even though in
previous testing I had apparently unintialized data
in my logs from the "wol: ctrl=%X, speed=%d\n" message, no idea why.

The patch below seems to fix the wakeup issue, but WOL is
still mostly broken (immediately wakes up with
"ethtool -s eth0 wol g", but "wol p" can be used
to wake up when the cable is plugged in,
i.e. unplug -> suspend -> plug -> wake-up).
I just had one spurious wake-up after "wol p" ->
wake-up -> "wol d" -> spurious wake-up -> try again -> works.

So, if you still want to rip out WOL handling, go ahead.
My patch is just the minimal change to make the driver
behave well for my needs.

BTW, one issue that bugs me is that the link is still
up after "ifconfig eth0 down" (and it is up after loading
the driver before configuring the interface).  It seems
the ALX_PHY_CTRL_POWER_DOWN in alx_pre_suspend would
do the job, but I'm not sure and now out of time to do
more experiments.  I'm not sure how much power is wasted
by an unused PHY link.


Thanks,
Johannes


>From 1e2abe93f8b05deaeea485637f100d347a308aba Mon Sep 17 00:00:00 2001
From: Johannes Stezenbach <js@sig21.net>
Date: Sun, 30 Jun 2013 16:23:53 +0200
Subject: [PATCH] alx: disable WOL by default and fix immediate wakeups

WOL is still broken, but at least the driver doesn't
cause immediate wakeups anymore when it is disabled,
and the link is down when the system is suspended.

Signed-off-by: Johannes Stezenbach <js@sig21.net>

diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
index 148b4b9..6311acc 100644
--- a/drivers/net/ethernet/atheros/alx/main.c
+++ b/drivers/net/ethernet/atheros/alx/main.c
@@ -706,7 +706,7 @@ static int alx_init_sw(struct alx_priv *alx)
 	alx->rxbuf_size = ALIGN(ALX_RAW_MTU(hw->mtu), 8);
 	alx->tx_ringsz = 256;
 	alx->rx_ringsz = 512;
-	hw->sleep_ctrl = ALX_SLEEP_WOL_MAGIC | ALX_SLEEP_WOL_PHY;
+	hw->sleep_ctrl = 0;
 	hw->imt = 200;
 	alx->int_mask = ALX_ISR_MISC;
 	hw->dma_chnl = hw->max_dma_chnl;
@@ -983,20 +983,20 @@ static int __alx_shutdown(struct pci_dev *pdev, bool *wol_en)
 	err = alx_select_powersaving_speed(hw, &speed, &duplex);
 	if (err)
 		return err;
-	err = alx_clear_phy_intr(hw);
+	err = alx_config_wol(hw);
 	if (err)
 		return err;
 	err = alx_pre_suspend(hw, speed, duplex);
 	if (err)
 		return err;
-	err = alx_config_wol(hw);
+	err = alx_clear_phy_intr(hw);
 	if (err)
 		return err;
 
 	*wol_en = false;
 	if (hw->sleep_ctrl & ALX_SLEEP_ACTIVE) {
 		netif_info(alx, wol, netdev,
-			   "wol: ctrl=%X, speed=%X\n",
+			   "wol: ctrl=%X, speed=%d\n",
 			   hw->sleep_ctrl, speed);
 		device_set_wakeup_enable(&pdev->dev, true);
 		*wol_en = true;

  reply	other threads:[~2013-06-30 15:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-29 17:23 [PATCH 0/8] alx fixes/improvements Johannes Berg
2013-06-29 17:23 ` [PATCH 1/8] alx: treat flow control correctly in alx_set_pauseparam() Johannes Berg
2013-06-29 17:23 ` [PATCH 2/8] alx: fix 100mbit/half duplex speed translation Johannes Berg
2013-06-29 17:23 ` [PATCH 3/8] alx: remove NET_CORE Kconfig select Johannes Berg
2013-06-29 17:23 ` [PATCH 4/8] alx: make sizes unsigned Johannes Berg
2013-06-29 17:23 ` [PATCH 5/8] alx: separate link speed/duplex fields Johannes Berg
2013-06-29 17:23 ` [PATCH 6/8] alx: fix MAC address alignment problem Johannes Berg
2013-06-29 17:23 ` [PATCH 7/8] alx: fix ethtool support code Johannes Berg
2013-06-29 17:23 ` [PATCH 8/8] alx: remove WoL support Johannes Berg
2013-06-29 19:12   ` Johannes Stezenbach
2013-06-29 19:40     ` Johannes Berg
2013-06-30 15:03       ` Johannes Stezenbach [this message]
2013-07-01 20:18 ` [PATCH 0/8] alx fixes/improvements David Miller

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=20130630150304.GA24189@sig21.net \
    --to=js@sig21.net \
    --cc=johannes@sipsolutions.net \
    --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).