netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen.hemminger@vyatta.com>
To: unlisted-recipients:; (no To-header on input)
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jeff Garzik <jeff@garzik.org>,
	pm list <linux-pm@lists.linux-foundation.org>,
	netdev@vger.kernel.org
Subject: Re: [PATCH 4/4] sky2: Adapt sky2 to use reworked PCI PM
Date: Thu, 24 Jul 2008 16:50:16 -0700	[thread overview]
Message-ID: <20080724165016.7be588e9@speedy> (raw)
In-Reply-To: <200807241352.18947.jbarnes@virtuousgeek.org>

On Thu, 24 Jul 2008 13:52:18 -0700
Jesse Barnes <jbarnes@virtuousgeek.org> wrote:

> On Thursday, July 24, 2008 1:50 pm Rafael J. Wysocki wrote:
> > [Sorry for the delayed response, I'm at OLS.]
> >
> > On Monday, 21 of July 2008, Andrew Morton wrote:
> > > On Sat, 19 Jul 2008 14:42:51 +0200 "Rafael J. Wysocki" <rjw@sisk.pl> 
> wrote:
> > > > Adapt the sky2 driver to use the reworked PCI PM.
> > >
> > > I fixed the rejects in "[PATCH 3/4] tg3: Adapt tg3 to use reworked PCI
> > > PM code" but this patch has too many for me to want to fix them.
> > >
> > > As usual, please at least take a look at what's in linux-next before
> > > going and bypassing all that queued work.
> >
> > Sorry for that.
> >
> > Appended is a version of the patch applying to the current mainline on top
> > of patches 1/4 - 3/4 without rejects.
> >
> > BTW, the sky2's WOL is broken on my test box because of commit
> > db99b98885e717454feef1c6868b27d3f23c2e7c ("sky2: put PHY in sleep when
> > down") that causes the box to hang solid in sky2_suspend() and
> > sky2_shutdown() after WOL has been enabled with 'ethtool -s eth0 wol g'.
> >
> > This has already been reported to Stephen and Jeff.
> 
> Btw, I just asked Linus to pull the 2/4 part of this patchset, so the rest 
> should be able to go upstream soon.
> 
> Thanks,
> Jesse


Does this fix your WOL issue?

When doing wake on lan and resume, the PHY may need to get more
power up bits tweaked.

--- a/drivers/net/sky2.c	2008-07-24 15:35:33.000000000 -0700
+++ b/drivers/net/sky2.c	2008-07-24 15:43:44.000000000 -0700
@@ -698,6 +698,7 @@ static const u32 coma_mode[] = { PCI_Y2_
 static void sky2_phy_power_up(struct sky2_hw *hw, unsigned port)
 {
 	u32 reg1;
+	u16 ctrl;
 
 	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
 	reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
@@ -709,6 +710,33 @@ static void sky2_phy_power_up(struct sky
 	sky2_pci_write32(hw, PCI_DEV_REG1, reg1);
 	sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF);
 	sky2_pci_read32(hw, PCI_DEV_REG1);
+
+	if (hw->chip_id != CHIP_ID_YUKON_EC) {
+		if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
+			gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 0);
+			ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL);
+
+			/* turn on GII power */
+			ctrl &= ~PHY_M_PC_POW_D_ENA;
+			gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, ctrl);
+		}
+	}
+
+	if (hw->flags & SKY2_HW_NEWER_PHY) {
+		/* select page 2 to access MAC control register */
+		gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 2);
+
+		ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL);
+		/* allow GMII Power Down */
+		ctrl |= PHY_M_MAC_GMIF_PUP;
+		gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, ctrl);
+
+		/* set page register back to 0 */
+		gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 0);
+	}
+
+	/* force phy reset and clear power down */
+	gm_phy_write(hw, port, PHY_MARV_CTRL, PHY_CT_RESET);
 }
 
 static void sky2_phy_power_down(struct sky2_hw *hw, unsigned port)
@@ -731,6 +759,9 @@ static void sky2_phy_power_down(struct s
 		ctrl &= ~PHY_M_MAC_GMIF_PUP;
 		gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, ctrl);
 
+		/* this register change must be followed by a software reset */
+		gm_phy_write(hw, port, PHY_MARV_CTRL, PHY_CT_RESET);
+
 		/* set page register back to 0 */
 		gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 0);
 	}

  reply	other threads:[~2008-07-24 23:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-19 12:36 [PATCH 0/4] Use new PCI PM code for Wake-on-LAN in some drivers Rafael J. Wysocki
2008-07-19 12:38 ` [PATCH 1/4] skge: Adapt skge to use reworked PCI PM Rafael J. Wysocki
2008-07-19 12:39 ` [PATCH 2/4] PCI PM: Make more PCI PM core functionality available to drivers Rafael J. Wysocki
2008-07-22 21:26   ` Jesse Barnes
2008-07-19 12:40 ` [PATCH 3/4] tg3: Adapt tg3 to use reworked PCI PM code Rafael J. Wysocki
2008-07-19 12:42 ` [PATCH 4/4] sky2: Adapt sky2 to use reworked PCI PM Rafael J. Wysocki
2008-07-21  2:07   ` Andrew Morton
2008-07-24 20:50     ` Rafael J. Wysocki
2008-07-24 20:52       ` Jesse Barnes
2008-07-24 23:50         ` Stephen Hemminger [this message]
2008-07-25 15:18           ` Rafael J. Wysocki
2008-07-29 22:31           ` Rafael J. Wysocki
2008-07-24 20:59       ` Stephen Hemminger

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=20080724165016.7be588e9@speedy \
    --to=stephen.hemminger@vyatta.com \
    --cc=akpm@linux-foundation.org \
    --cc=jeff@garzik.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --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 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).