Skip to contentSkip to conversation

sky2: Fix suspend/hibernation/shutdown regression with WOL enabled

PATCH In review Rafael J. Wysocki 3 participants 6 messages Aug 9, 2008 – Aug 14, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sky2: Fix suspend/hibernation/shutdown regression with WOL enabled

sky2: Fix suspend/hibernation/shutdown regression with WOL enabled

On my test box with the Asus M3A32-MVP main board there is a regression from 2.6.26 related to suspend, hibernation and shutdown. Namely, if Wake-on-LAN is enabled with 'ethtool -s eth0 wol g', the box hangs solid during all of these operations, while executing either sky2_suspend(), or sky2_shutdown(). This patch fixes it for me.

---
 drivers/net/sky2.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/sky2.c +2 -1
Index: linux-2.6/drivers/net/sky2.c
===================================================================
@@ -665,7 +665,8 @@ static void sky2_phy_power_down(struct s
 		    GM_GPCR_FL_PASS | GM_GPCR_SPEED_100 | GM_GPCR_AU_ALL_DIS);
 
 	if (hw->chip_id != CHIP_ID_YUKON_EC) {
-		if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
+		if (hw->chip_id == CHIP_ID_YUKON_EC_U
+		    && hw->chip_rev != CHIP_REV_YU_EC_U_B0) {
 			ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL);
 
 			/* enable Power Down */
#1 lore raw
Quoted 19 lines · On Sat, 9 Aug 2008 23:32:28 +0200 "Rafael J. Wysocki" <[email protected]> wrote:

sky2: Fix suspend/hibernation/shutdown regression with WOL enabled

On my test box with the Asus M3A32-MVP main board there is a regression from 2.6.26 related to suspend, hibernation and shutdown. Namely, if Wake-on-LAN is enabled with 'ethtool -s eth0 wol g', the box hangs solid during all of these operations, while executing either sky2_suspend(), or sky2_shutdown(). This patch fixes it for me.

---
 drivers/net/sky2.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/net/sky2.c
===================================================================

drivers/net/sky2.c static void sky2_phy_power_down(struct s · line 672

Quoted 9 lines
drivers/net/sky2.c +2 -1
@@ -665,7 +665,8 @@ static void sky2_phy_power_down(struct s
 		    GM_GPCR_FL_PASS | GM_GPCR_SPEED_100 | GM_GPCR_AU_ALL_DIS);
 
 	if (hw->chip_id != CHIP_ID_YUKON_EC) {
-		if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
+		if (hw->chip_id == CHIP_ID_YUKON_EC_U
+		    && hw->chip_rev != CHIP_REV_YU_EC_U_B0) {
 			ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL);
 
 			/* enable Power Down */

The problem is not unique to your chip version, so patching out the power down is not the correct solution.

#2 lore raw
Quoted 30 lines · Stephen Hemminger
Quoted 27 lines · On Sat, 9 Aug 2008 23:32:28 +0200 "Rafael J. Wysocki" <[email protected]> wrote:

sky2: Fix suspend/hibernation/shutdown regression with WOL enabled

On my test box with the Asus M3A32-MVP main board there is a regression from 2.6.26 related to suspend, hibernation and shutdown. Namely, if Wake-on-LAN is enabled with 'ethtool -s eth0 wol g', the box hangs solid during all of these operations, while executing either sky2_suspend(), or sky2_shutdown(). This patch fixes it for me.

---
 drivers/net/sky2.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/net/sky2.c
===================================================================

drivers/net/sky2.c +2 -1
@@ -665,7 +665,8 @@ static void sky2_phy_power_down(struct s
 		    GM_GPCR_FL_PASS | GM_GPCR_SPEED_100 | GM_GPCR_AU_ALL_DIS);
 
 	if (hw->chip_id != CHIP_ID_YUKON_EC) {
-		if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
+		if (hw->chip_id == CHIP_ID_YUKON_EC_U
+		    && hw->chip_rev != CHIP_REV_YU_EC_U_B0) {
 			ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL);
 
Quoted 3 lines

drivers/net/sky2.c static void sky2_phy_power_down(struct s · line 672

Quoted 1 line
drivers/net/sky2.c +0 -0
 			/* enable Power Down */

The problem is not unique to your chip version,

Well, that's the part I wasn't sure of.

Quoted 1 line

so patching out the power down is not the correct solution.

Sure.

#3 lore raw

PATCH 1/1 sky2: Fix suspend/hibernation/shutdown regression with WOL enabled (rev. 2)

Quoted 4 lines · Rafael J. Wysocki
Quoted 3 lines · Stephen Hemminger

On Sat, 9 Aug 2008 23:32:28 +0200
"Rafael J. Wysocki" <[email protected]> wrote:

[--snip--]

Quoted 8 lines
Quoted 2 lines

The problem is not unique to your chip version,

Well, that's the part I wasn't sure of.

Quoted 1 line

so patching out the power down is not the correct solution.

Sure.

But, shouldn't we switch to page 2 before selecting PHY_MARV_PHY_CTRL? Things work correctly if this is done (patch below).

Thanks,
Rafael

---
On my test box with the Asus M3A32-MVP main board there is a regression from 2.6.26 related to suspend, hibernation and shutdown. Namely, if Wake-on-LAN is enabled with 'ethtool -s eth0 wol g', the box hangs solid during all of these operations, while executing either sky2_suspend(), or sky2_shutdown(). This patch fixes it for me.

---
 drivers/net/sky2.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/sky2.c +6 -1
Index: linux-2.6/drivers/net/sky2.c
===================================================================
@@ -666,11 +666,16 @@ static void sky2_phy_power_down(struct s
 
 	if (hw->chip_id != CHIP_ID_YUKON_EC) {
 		if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
-			ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL);
+			/* 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);
 			/* enable Power Down */
 			ctrl |= PHY_M_PC_POW_D_ENA;
 			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);
 		}
 
 		/* set IEEE compatible Power Down Mode (dev. #4.99) */
Acked-by on v1 1/1
#4 lore raw

Re: [PATCH] sky2: Fix suspend/hibernation/shutdown regression with WOL enabled (rev. 2)

Quoted 47 lines · On Sun, 10 Aug 2008 19:30:28 +0200 "Rafael J. Wysocki" <[email protected]> wrote:
Quoted 4 lines · Rafael J. Wysocki
Quoted 3 lines · Stephen Hemminger

On Sat, 9 Aug 2008 23:32:28 +0200
"Rafael J. Wysocki" <[email protected]> wrote:

[--snip--]

Quoted 8 lines
Quoted 2 lines

The problem is not unique to your chip version,

Well, that's the part I wasn't sure of.

Quoted 1 line

so patching out the power down is not the correct solution.

Sure.

But, shouldn't we switch to page 2 before selecting PHY_MARV_PHY_CTRL? Things work correctly if this is done (patch below).

Thanks,
Rafael

---
On my test box with the Asus M3A32-MVP main board there is a regression from 2.6.26 related to suspend, hibernation and shutdown. Namely, if Wake-on-LAN is enabled with 'ethtool -s eth0 wol g', the box hangs solid during all of these operations, while executing either sky2_suspend(), or sky2_shutdown(). This patch fixes it for me.

---
 drivers/net/sky2.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/net/sky2.c
===================================================================

drivers/net/sky2.c +2 -1
@@ -666,11 +666,16 @@ static void sky2_phy_power_down(struct s
 
 	if (hw->chip_id != CHIP_ID_YUKON_EC) {
 		if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
-			ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL);
+			/* select page 2 to access MAC control register */
+			gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 2);
 

drivers/net/sky2.c static void sky2_phy_power_down(struct s · line 681

Quoted 10 lines
drivers/net/sky2.c +4 -0
+			ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL);
 			/* enable Power Down */
 			ctrl |= PHY_M_PC_POW_D_ENA;
 			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);
 		}
 
 		/* set IEEE compatible Power Down Mode (dev. #4.99) */

Yes, that's better.

Applied
#5 lore raw

Re: [PATCH] sky2: Fix suspend/hibernation/shutdown regression with WOL enabled (rev. 2)

In reply to Rafael J. Wysocki
Quoted 42 lines · Rafael J. Wysocki
Quoted 4 lines · Rafael J. Wysocki
Quoted 3 lines · Stephen Hemminger

On Sat, 9 Aug 2008 23:32:28 +0200
"Rafael J. Wysocki" <[email protected]> wrote:

[--snip--]

Quoted 5 lines
Quoted 1 line

The problem is not unique to your chip version,

Well, that's the part I wasn't sure of.

Quoted 1 line

so patching out the power down is not the correct solution.

Sure.

But, shouldn't we switch to page 2 before selecting PHY_MARV_PHY_CTRL? Things work correctly if this is done (patch below).

Thanks,
Rafael

---
On my test box with the Asus M3A32-MVP main board there is a regression from 2.6.26 related to suspend, hibernation and shutdown. Namely, if Wake-on-LAN is enabled with 'ethtool -s eth0 wol g', the box hangs solid during all of these operations, while executing either sky2_suspend(), or sky2_shutdown(). This patch fixes it for me.

---
 drivers/net/sky2.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/net/sky2.c
===================================================================

drivers/net/sky2.c +1 -1
@@ -666,11 +666,16 @@ static void sky2_phy_power_down(struct s
 
 	if (hw->chip_id != CHIP_ID_YUKON_EC) {
 		if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
-			ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL);
+			/* select page 2 to access MAC control register */

drivers/net/sky2.c static void sky2_phy_power_down(struct s · line 679

Quoted 10 lines
drivers/net/sky2.c +5 -0
+			gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 2);
 
+			ctrl = gm_phy_read(hw, port, PHY_MARV_PHY_CTRL);
 			/* enable Power Down */
 			ctrl |= PHY_M_PC_POW_D_ENA;
 			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);
 		}

applied