Subject: [patch 1/1] phy/marvell: fix 88e1121 support

From: Arnaud Patard (Rtp) <[email-masked]>
Date: Mon, 18 Oct 2010 23:44:02 +0200

Commit c477d0447db08068a497e7beb892b2b2a7bff64b added support for RGMII
rx/tx delays except that it ends up clearing rx/tx delays bit for modes
differents that RGMII*ID. Due to this, ethernet is not working anymore
on my guruplug server +. This patch is fixing that.

Signed-off-by: Arnaud Patard <[email-masked]>
Index: linux-2.6/drivers/net/phy/marvell.c
===================================================================
--- linux-2.6.orig/drivers/net/phy/marvell.c	2010-10-18 22:46:09.000000000 +0200
+++ linux-2.6/drivers/net/phy/marvell.c	2010-10-18 23:19:14.000000000 +0200
@@ -199,13 +199,13 @@
 	mscr = phy_read(phydev, MII_88E1121_PHY_MSCR_REG) &
 		MII_88E1121_PHY_MSCR_DELAY_MASK;
 
-	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
-		mscr |= (MII_88E1121_PHY_MSCR_RX_DELAY |
-			 MII_88E1121_PHY_MSCR_TX_DELAY);
-	else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
+	if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
 		mscr |= MII_88E1121_PHY_MSCR_RX_DELAY;
 	else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
 		mscr |= MII_88E1121_PHY_MSCR_TX_DELAY;
+	else
+		mscr |= (MII_88E1121_PHY_MSCR_RX_DELAY |
+			 MII_88E1121_PHY_MSCR_TX_DELAY);
 
 	err = phy_write(phydev, MII_88E1121_PHY_MSCR_REG, mscr);
 	if (err < 0)