[PATCH 0/1] net and net-next merge conflict bug

STALE3818d

3 messages, 2 authors, 2016-02-25 · open the first message on its own page

[PATCH 0/1] net and net-next merge conflict bug

From: Clemens Gruber <hidden>
Date: 2016-02-23 19:17:20

Hi Dave,

in your merge commit b633353115e3 ("Merge
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net"), you merged
net into net-next and commit 930b37ee8d84 ("net: phy: Add SGMII support
for Marvell 88E1510/1512/1514/1518") overwrote a fix from
commit 79be1a1c9090 ("phy: marvell: Fix and unify reg-init behavior").
Now, for the 88E1510, marvell_of_reg_init is not called anymore.

Solution:
Instead of returning 0 at m88e1510_config_init it should call
marvell_config_init.

I am sending you a patch for net-next to avoid any issues in case the
SGMII commit is merged back into davem/net. (?)

davem/net is fine, the problem exists only in davem/net-next.

Thanks,
Clemens

Clemens Gruber (1):
  phy: marvell: Fix 88E1510 initialization

 drivers/net/phy/marvell.c | 70 +++++++++++++++++++++++------------------------
 1 file changed, 35 insertions(+), 35 deletions(-)

-- 
2.7.1

[PATCH 1/1] phy: marvell: Fix 88E1510 initialization

From: Clemens Gruber <hidden>
Date: 2016-02-23 19:17:21

A bug was introduced in the merge commit b633353115e3 ("Merge
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net")
The generic marvell_config_init (and therefore marvell_of_reg_init) is
not called anymore for the Marvell 88E1510 (in net-next).

This patch calls marvell_config_init and moves the specific init
function for the 88E1510 below the marvell_config_init function to avoid
adding a function predeclaration.

Signed-off-by: Clemens Gruber <redacted>
---
 drivers/net/phy/marvell.c | 70 +++++++++++++++++++++++------------------------
 1 file changed, 35 insertions(+), 35 deletions(-)
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 9fb9d80..280e879 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -443,41 +443,6 @@ static int m88e1318_config_aneg(struct phy_device *phydev)
 	return m88e1121_config_aneg(phydev);
 }
 
-static int m88e1510_config_init(struct phy_device *phydev)
-{
-	int err;
-	int temp;
-
-	/* SGMII-to-Copper mode initialization */
-	if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
-		/* Select page 18 */
-		err = phy_write(phydev, MII_MARVELL_PHY_PAGE, 18);
-		if (err < 0)
-			return err;
-
-		/* In reg 20, write MODE[2:0] = 0x1 (SGMII to Copper) */
-		temp = phy_read(phydev, MII_88E1510_GEN_CTRL_REG_1);
-		temp &= ~MII_88E1510_GEN_CTRL_REG_1_MODE_MASK;
-		temp |= MII_88E1510_GEN_CTRL_REG_1_MODE_SGMII;
-		err = phy_write(phydev, MII_88E1510_GEN_CTRL_REG_1, temp);
-		if (err < 0)
-			return err;
-
-		/* PHY reset is necessary after changing MODE[2:0] */
-		temp |= MII_88E1510_GEN_CTRL_REG_1_RESET;
-		err = phy_write(phydev, MII_88E1510_GEN_CTRL_REG_1, temp);
-		if (err < 0)
-			return err;
-
-		/* Reset page selection */
-		err = phy_write(phydev, MII_MARVELL_PHY_PAGE, 0);
-		if (err < 0)
-			return err;
-	}
-
-	return 0;
-}
-
 static int m88e1510_config_aneg(struct phy_device *phydev)
 {
 	int err;
@@ -671,6 +636,41 @@ static int m88e1111_config_init(struct phy_device *phydev)
 	return phy_write(phydev, MII_BMCR, BMCR_RESET);
 }
 
+static int m88e1510_config_init(struct phy_device *phydev)
+{
+	int err;
+	int temp;
+
+	/* SGMII-to-Copper mode initialization */
+	if (phydev->interface == PHY_INTERFACE_MODE_SGMII) {
+		/* Select page 18 */
+		err = phy_write(phydev, MII_MARVELL_PHY_PAGE, 18);
+		if (err < 0)
+			return err;
+
+		/* In reg 20, write MODE[2:0] = 0x1 (SGMII to Copper) */
+		temp = phy_read(phydev, MII_88E1510_GEN_CTRL_REG_1);
+		temp &= ~MII_88E1510_GEN_CTRL_REG_1_MODE_MASK;
+		temp |= MII_88E1510_GEN_CTRL_REG_1_MODE_SGMII;
+		err = phy_write(phydev, MII_88E1510_GEN_CTRL_REG_1, temp);
+		if (err < 0)
+			return err;
+
+		/* PHY reset is necessary after changing MODE[2:0] */
+		temp |= MII_88E1510_GEN_CTRL_REG_1_RESET;
+		err = phy_write(phydev, MII_88E1510_GEN_CTRL_REG_1, temp);
+		if (err < 0)
+			return err;
+
+		/* Reset page selection */
+		err = phy_write(phydev, MII_MARVELL_PHY_PAGE, 0);
+		if (err < 0)
+			return err;
+	}
+
+	return marvell_config_init(phydev);
+}
+
 static int m88e1118_config_aneg(struct phy_device *phydev)
 {
 	int err;
-- 
2.7.1

Re: [PATCH 1/1] phy: marvell: Fix 88E1510 initialization

From: David Miller <davem@davemloft.net>
Date: 2016-02-25 21:09:01

From: Clemens Gruber <redacted>
Date: Tue, 23 Feb 2016 20:16:58 +0100
A bug was introduced in the merge commit b633353115e3 ("Merge
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net")
The generic marvell_config_init (and therefore marvell_of_reg_init) is
not called anymore for the Marvell 88E1510 (in net-next).

This patch calls marvell_config_init and moves the specific init
function for the 88E1510 below the marvell_config_init function to avoid
adding a function predeclaration.

Signed-off-by: Clemens Gruber <redacted>
Applied, thanks for noticing and fixing this merge error!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help