Skip to contentSkip to conversation

net: mvpp2: Fix GoP port 3 Networking Complex Control configurations

PATCH Superseded [email protected] 3 participants 4 messages Dec 17, 2020 – Dec 20, 2020

Subsystems (4)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 net: mvpp2: Fix GoP port 3 Networking Complex Control configurations

From: Stefan Chulski <[email protected]>

During GoP port 2 Networking Complex Control mode of operation configurations, also GoP port 3 mode of operation was wrongly set.
Patch removes these configurations.
GENCONF_CTRL0_PORTX naming also fixed.

Fixes f84bf386f395 ("net: mvpp2: initialize the GoP")

---

Changes in v3:
- Added cc [email protected]
Changes in v2:
- Added Fixes tag.

 drivers/net/ethernet/marvell/mvpp2/mvpp2.h      | 6 +++---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/marvell/mvpp2/mvpp2.h +3 -3
index 6bd7e40..39c4e5c 100644
@@ -651,9 +651,9 @@
 #define     GENCONF_PORT_CTRL1_EN(p)			BIT(p)
 #define     GENCONF_PORT_CTRL1_RESET(p)			(BIT(p) << 28)
 #define GENCONF_CTRL0					0x1120
-#define     GENCONF_CTRL0_PORT0_RGMII			BIT(0)
-#define     GENCONF_CTRL0_PORT1_RGMII_MII		BIT(1)
-#define     GENCONF_CTRL0_PORT1_RGMII			BIT(2)
+#define     GENCONF_CTRL0_PORT2_RGMII			BIT(0)
+#define     GENCONF_CTRL0_PORT3_RGMII_MII		BIT(1)
+#define     GENCONF_CTRL0_PORT3_RGMII			BIT(2)
 
 /* Various constants */
 
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +4 -4
index d64dc12..d2b0506 100644
@@ -1231,9 +1231,9 @@ static void mvpp22_gop_init_rgmii(struct mvpp2_port *port)
 
 	regmap_read(priv->sysctrl_base, GENCONF_CTRL0, &val);
 	if (port->gop_id == 2)
-		val |= GENCONF_CTRL0_PORT0_RGMII | GENCONF_CTRL0_PORT1_RGMII;
+		val |= GENCONF_CTRL0_PORT2_RGMII;
 	else if (port->gop_id == 3)
-		val |= GENCONF_CTRL0_PORT1_RGMII_MII;
+		val |= GENCONF_CTRL0_PORT3_RGMII_MII;
 	regmap_write(priv->sysctrl_base, GENCONF_CTRL0, val);
 }
 
@@ -1250,9 +1250,9 @@ static void mvpp22_gop_init_sgmii(struct mvpp2_port *port)
 	if (port->gop_id > 1) {
 		regmap_read(priv->sysctrl_base, GENCONF_CTRL0, &val);
 		if (port->gop_id == 2)
-			val &= ~GENCONF_CTRL0_PORT0_RGMII;
+			val &= ~GENCONF_CTRL0_PORT2_RGMII;
 		else if (port->gop_id == 3)
-			val &= ~GENCONF_CTRL0_PORT1_RGMII_MII;
+			val &= ~GENCONF_CTRL0_PORT3_RGMII_MII;
 		regmap_write(priv->sysctrl_base, GENCONF_CTRL0, val);
 	}
 }
Signature · 1 line
1.9.1
Acked-by on v3 1/1
#1 lore raw

Hi Stefan,

czw., 17 gru 2020 o 13:40 <[email protected]> napisał(a):

Quoted 58 lines

From: Stefan Chulski <[email protected]>

During GoP port 2 Networking Complex Control mode of operation configurations, also GoP port 3 mode of operation was wrongly set.
Patch removes these configurations.
GENCONF_CTRL0_PORTX naming also fixed.

Fixes f84bf386f395 ("net: mvpp2: initialize the GoP")

---

Changes in v3:
- Added cc [email protected]
Changes in v2:
- Added Fixes tag.

 drivers/net/ethernet/marvell/mvpp2/mvpp2.h      | 6 +++---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/marvell/mvpp2/mvpp2.h +3 -3
index 6bd7e40..39c4e5c 100644
@@ -651,9 +651,9 @@
 #define     GENCONF_PORT_CTRL1_EN(p)                   BIT(p)
 #define     GENCONF_PORT_CTRL1_RESET(p)                        (BIT(p) << 28)
 #define GENCONF_CTRL0                                  0x1120
-#define     GENCONF_CTRL0_PORT0_RGMII                  BIT(0)
-#define     GENCONF_CTRL0_PORT1_RGMII_MII              BIT(1)
-#define     GENCONF_CTRL0_PORT1_RGMII                  BIT(2)
+#define     GENCONF_CTRL0_PORT2_RGMII                  BIT(0)
+#define     GENCONF_CTRL0_PORT3_RGMII_MII              BIT(1)
+#define     GENCONF_CTRL0_PORT3_RGMII                  BIT(2)
 
 /* Various constants */
 
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +2 -2
index d64dc12..d2b0506 100644
@@ -1231,9 +1231,9 @@ static void mvpp22_gop_init_rgmii(struct mvpp2_port *port)
 
        regmap_read(priv->sysctrl_base, GENCONF_CTRL0, &val);
        if (port->gop_id == 2)
-               val |= GENCONF_CTRL0_PORT0_RGMII | GENCONF_CTRL0_PORT1_RGMII;
+               val |= GENCONF_CTRL0_PORT2_RGMII;
        else if (port->gop_id == 3)
-               val |= GENCONF_CTRL0_PORT1_RGMII_MII;
+               val |= GENCONF_CTRL0_PORT3_RGMII_MII;
        regmap_write(priv->sysctrl_base, GENCONF_CTRL0, val);
 }
 
@@ -1250,9 +1250,9 @@ static void mvpp22_gop_init_sgmii(struct mvpp2_port *port)
        if (port->gop_id > 1) {
                regmap_read(priv->sysctrl_base, GENCONF_CTRL0, &val);

drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c static void mvpp22_gop_init_sgmii(struct mvpp2_port *port)

Quoted 10 lines
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +2 -3
                if (port->gop_id == 2)
-                       val &= ~GENCONF_CTRL0_PORT0_RGMII;
+                       val &= ~GENCONF_CTRL0_PORT2_RGMII;
                else if (port->gop_id == 3)
-                       val &= ~GENCONF_CTRL0_PORT1_RGMII_MII;
+                       val &= ~GENCONF_CTRL0_PORT3_RGMII_MII;
                regmap_write(priv->sysctrl_base, GENCONF_CTRL0, val);
        }
 }
--

I tested the patch and LGTM.

Thanks,
Marcin

maintainer
#2 lore raw
In reply to [email protected]
Quoted 6 lines · On Thu, 17 Dec 2020 14:37:28 +0200 [email protected] wrote:

From: Stefan Chulski <[email protected]>

During GoP port 2 Networking Complex Control mode of operation configurations, also GoP port 3 mode of operation was wrongly set.
Patch removes these configurations.
GENCONF_CTRL0_PORTX naming also fixed.

Testing the stable backport it looks like this addition change will be problematic. Not to mention it goes against the "fixes should be minimal" rule.

Could you please send just a one liner which removes the offending ORing in of the bad bit?

We can do the rename soon after in net-next, the trees are merged pretty much every week so it won't be a long wait.

Quoted 3 lines
Fixes f84bf386f395 ("net: mvpp2: initialize the GoP")
#3 lore raw
Quoted 11 lines

External Email

----------------------------------------------------------------------

Quoted 6 lines · On Thu, 17 Dec 2020 14:37:28 +0200 [email protected] wrote:

From: Stefan Chulski <[email protected]>

During GoP port 2 Networking Complex Control mode of operation configurations, also GoP port 3 mode of operation was wrongly set. Patch removes these configurations.
GENCONF_CTRL0_PORTX naming also fixed.

Quoted 8 lines

Testing the stable backport it looks like this addition change will be problematic. Not to mention it goes against the "fixes should be minimal" rule.

Could you please send just a one liner which removes the offending ORing in of the bad bit?

We can do the rename soon after in net-next, the trees are merged pretty much every week so it won't be a long wait.

I would repost with single line change.

Regards,
Stefan.