Skip to contentSkip to conversation

sky2: dont overwrite settings for PHY Quick link

PATCH In review Lino Sanfilippo 3 participants 4 messages Mar 30, 2012 – Apr 2, 2012

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

PATCH 1/1 sky2: dont overwrite settings for PHY Quick link

This patch corrects a bug in function sky2_open() of the Marvell Yukon 2 driver in which the settings for PHY quick link are overwritten.

---
This applies against 3.3

 drivers/net/ethernet/marvell/sky2.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/marvell/sky2.c +3 -2
index 760c2b1..d0132d8 100644
@@ -1756,13 +1756,14 @@ static int sky2_open(struct net_device *dev)
 
 	sky2_hw_up(sky2);
 
+	/* Enable interrupts from phy/mac for port */
+	imask = sky2_read32(hw, B0_IMSK);
+
 	if (hw->chip_id == CHIP_ID_YUKON_OPT ||
 	    hw->chip_id == CHIP_ID_YUKON_PRM ||
 	    hw->chip_id == CHIP_ID_YUKON_OP_2)
 		imask |= Y2_IS_PHY_QLNK;	/* enable PHY Quick Link */
 
-	/* Enable interrupts from phy/mac for port */
-	imask = sky2_read32(hw, B0_IMSK);
 	imask |= portirq_msk[port];
 	sky2_write32(hw, B0_IMSK, imask);
 	sky2_read32(hw, B0_IMSK);
Signature · 1 line
1.5.6.5
Acked-by on v1 1/1
#2 lore raw
In reply to Lino Sanfilippo
Quoted 21 lines · On Fri, 30 Mar 2012 19:28:59 +0200 Lino Sanfilippo <[email protected]>…

This patch corrects a bug in function sky2_open() of the Marvell Yukon 2 driver in which the settings for PHY quick link are overwritten.

---
This applies against 3.3

 drivers/net/ethernet/marvell/sky2.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/marvell/sky2.c +3 -0
index 760c2b1..d0132d8 100644
@@ -1756,13 +1756,14 @@ static int sky2_open(struct net_device *dev)
 
 	sky2_hw_up(sky2);
 
+	/* Enable interrupts from phy/mac for port */
+	imask = sky2_read32(hw, B0_IMSK);
+

drivers/net/ethernet/marvell/sky2.c static int sky2_open(struct net_device *dev) · line 1769

Quoted 10 lines
drivers/net/ethernet/marvell/sky2.c +0 -2
 	if (hw->chip_id == CHIP_ID_YUKON_OPT ||
 	    hw->chip_id == CHIP_ID_YUKON_PRM ||
 	    hw->chip_id == CHIP_ID_YUKON_OP_2)
 		imask |= Y2_IS_PHY_QLNK;	/* enable PHY Quick Link */
 
-	/* Enable interrupts from phy/mac for port */
-	imask = sky2_read32(hw, B0_IMSK);
 	imask |= portirq_msk[port];
 	sky2_write32(hw, B0_IMSK, imask);
 	sky2_read32(hw, B0_IMSK);

This should go to stable as well. Surprised that gcc did not detect the "or" of uninitialized value.

maintainer
#3 lore raw

From: Stephen Hemminger <[email protected]>
Date: Mon, 2 Apr 2012 15:38:18 -0700

Quoted 7 lines
Quoted 4 lines · On Fri, 30 Mar 2012 19:28:59 +0200 Lino Sanfilippo <[email protected]>…

This patch corrects a bug in function sky2_open() of the Marvell Yukon 2 driver in which the settings for PHY quick link are overwritten.

...

Quoted 1 line

Applied and queued up for -stable.

Quoted 1 line

Surprised that gcc did not detect the "or" of uninitialized value.

Especially since it warns for so much crap it shouldn't :-)