All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v3] net: mvpp2: Fix GoP port 3 Networking Complex Control configurations
@ 2020-12-17 12:37 stefanc
  2020-12-18  3:34 ` Marcin Wojtas
  2020-12-19 17:59 ` Jakub Kicinski
  0 siblings, 2 replies; 6+ messages in thread
From: stefanc @ 2020-12-17 12:37 UTC (permalink / raw)
  To: netdev
  Cc: thomas.petazzoni, davem, nadavh, ymarkman, linux-kernel, stefanc,
	kuba, linux, mw, andrew, rmk+kernel, stable

From: Stefan Chulski <stefanc@marvell.com>

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.

Cc: stable@vger.kernel.org
Fixes: f84bf386f395 ("net: mvpp2: initialize the GoP")
Signed-off-by: Stefan Chulski <stefanc@marvell.com>
---

Changes in v3:
- Added cc stable@vger.kernel.org
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(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
index 6bd7e40..39c4e5c 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
@@ -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 */
 
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index d64dc12..d2b0506 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -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);
 	}
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net v3] net: mvpp2: Fix GoP port 3 Networking Complex Control configurations
  2020-12-17 12:37 [PATCH net v3] net: mvpp2: Fix GoP port 3 Networking Complex Control configurations stefanc
@ 2020-12-18  3:34 ` Marcin Wojtas
  2020-12-19 17:59 ` Jakub Kicinski
  1 sibling, 0 replies; 6+ messages in thread
From: Marcin Wojtas @ 2020-12-18  3:34 UTC (permalink / raw)
  To: Stefan Chulski
  Cc: netdev, Thomas Petazzoni, David S. Miller, nadavh, Yan Markman,
	Linux Kernel Mailing List, Jakub Kicinski,
	Russell King - ARM Linux, Andrew Lunn, Russell King, stable

Hi Stefan,

czw., 17 gru 2020 o 13:40 <stefanc@marvell.com> napisał(a):
>
> From: Stefan Chulski <stefanc@marvell.com>
>
> 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.
>
> Cc: stable@vger.kernel.org
> Fixes: f84bf386f395 ("net: mvpp2: initialize the GoP")
> Signed-off-by: Stefan Chulski <stefanc@marvell.com>
> ---
>
> Changes in v3:
> - Added cc stable@vger.kernel.org
> 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(-)
>
> diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
> index 6bd7e40..39c4e5c 100644
> --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
> +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
> @@ -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 */
>
> diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> index d64dc12..d2b0506 100644
> --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> @@ -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);
>         }
>  }
> --

I tested the patch and LGTM.

Acked-by: Marcin Wojtas <mw@semihalf.com>

Thanks,
Marcin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net v3] net: mvpp2: Fix GoP port 3 Networking Complex Control configurations
  2020-12-17 12:37 [PATCH net v3] net: mvpp2: Fix GoP port 3 Networking Complex Control configurations stefanc
  2020-12-18  3:34 ` Marcin Wojtas
@ 2020-12-19 17:59 ` Jakub Kicinski
  2020-12-20 10:49   ` [EXT] " Stefan Chulski
  1 sibling, 1 reply; 6+ messages in thread
From: Jakub Kicinski @ 2020-12-19 17:59 UTC (permalink / raw)
  To: stefanc
  Cc: netdev, thomas.petazzoni, davem, nadavh, ymarkman, linux-kernel,
	linux, mw, andrew, rmk+kernel, stable

On Thu, 17 Dec 2020 14:37:28 +0200 stefanc@marvell.com wrote:
> From: Stefan Chulski <stefanc@marvell.com>
> 
> 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.

> Cc: stable@vger.kernel.org
> Fixes: f84bf386f395 ("net: mvpp2: initialize the GoP")
> Signed-off-by: Stefan Chulski <stefanc@marvell.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [EXT] Re: [PATCH net v3] net: mvpp2: Fix GoP port 3 Networking Complex Control configurations
  2020-12-19 17:59 ` Jakub Kicinski
@ 2020-12-20 10:49   ` Stefan Chulski
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Chulski @ 2020-12-20 10:49 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: netdev, thomas.petazzoni, davem, Nadav Haklai, Yan Markman,
	linux-kernel, linux, mw, andrew, rmk+kernel, stable

> External Email
> 
> ----------------------------------------------------------------------
> On Thu, 17 Dec 2020 14:37:28 +0200 stefanc@marvell.com wrote:
> > From: Stefan Chulski <stefanc@marvell.com>
> >
> > 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.

I would repost with single line change.

Regards,
Stefan.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net v3] net: mvpp2: Fix GoP port 3 Networking Complex Control configurations
@ 2020-12-17 12:34 stefanc
  0 siblings, 0 replies; 6+ messages in thread
From: stefanc @ 2020-12-17 12:34 UTC (permalink / raw)
  To: stefanc; +Cc: stable

From: Stefan Chulski <stefanc@marvell.com>

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.

Cc: stable@vger.kernel.org
Fixes: f84bf386f395 ("net: mvpp2: initialize the GoP")
Signed-off-by: Stefan Chulski <stefanc@marvell.com>
---

Changes in v3:
- Added cc stable@vger.kernel.org
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(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
index 6bd7e40..39c4e5c 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
@@ -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 */
 
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index d64dc12..d2b0506 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -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);
 	}
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net v3] net: mvpp2: Fix GoP port 3 Networking Complex Control configurations
@ 2020-12-17 12:32 stefanc
  0 siblings, 0 replies; 6+ messages in thread
From: stefanc @ 2020-12-17 12:32 UTC (permalink / raw)
  To: stefanc; +Cc: stable

From: Stefan Chulski <stefanc@marvell.com>

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.

Cc: stable@vger.kernel.org
Fixes: f84bf386f395 ("net: mvpp2: initialize the GoP")
Signed-off-by: Stefan Chulski <stefanc@marvell.com>
---

Changes in v3:
- No changes
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(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
index 6bd7e40..39c4e5c 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
@@ -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 */
 
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index d64dc12..d2b0506 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -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);
 	}
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-12-20 10:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 12:37 [PATCH net v3] net: mvpp2: Fix GoP port 3 Networking Complex Control configurations stefanc
2020-12-18  3:34 ` Marcin Wojtas
2020-12-19 17:59 ` Jakub Kicinski
2020-12-20 10:49   ` [EXT] " Stefan Chulski
  -- strict thread matches above, loose matches on Subject: below --
2020-12-17 12:34 stefanc
2020-12-17 12:32 stefanc

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.