linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2 1/2] net: mvpp2: Fix GoP port 3 Networking Complex Control configurations
@ 2020-12-17  9:40 stefanc
  2020-12-17  9:40 ` [PATCH net v2 2/2] net: mvpp2: disable force link UP during port init procedure stefanc
  0 siblings, 1 reply; 7+ messages in thread
From: stefanc @ 2020-12-17  9:40 UTC (permalink / raw)
  To: netdev
  Cc: thomas.petazzoni, davem, nadavh, ymarkman, linux-kernel, stefanc,
	kuba, linux, mw, andrew, rmk+kernel

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.

Fixes: f84bf386f395 ("net: mvpp2: initialize the GoP")
Signed-off-by: Stefan Chulski <stefanc@marvell.com>
---
 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] 7+ messages in thread

* [PATCH net v2 2/2] net: mvpp2: disable force link UP during port init procedure
  2020-12-17  9:40 [PATCH net v2 1/2] net: mvpp2: Fix GoP port 3 Networking Complex Control configurations stefanc
@ 2020-12-17  9:40 ` stefanc
  2020-12-17 11:00   ` Marcin Wojtas
  0 siblings, 1 reply; 7+ messages in thread
From: stefanc @ 2020-12-17  9:40 UTC (permalink / raw)
  To: netdev
  Cc: thomas.petazzoni, davem, nadavh, ymarkman, linux-kernel, stefanc,
	kuba, linux, mw, andrew, rmk+kernel

From: Stefan Chulski <stefanc@marvell.com>

Force link UP can be enabled by bootloader during tftpboot
and breaks NFS support.
Force link UP disabled during port init procedure.

Signed-off-by: Stefan Chulski <stefanc@marvell.com>
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index d2b0506..0ad3177 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -5479,7 +5479,7 @@ static int mvpp2_port_init(struct mvpp2_port *port)
 	struct mvpp2 *priv = port->priv;
 	struct mvpp2_txq_pcpu *txq_pcpu;
 	unsigned int thread;
-	int queue, err;
+	int queue, err, val;
 
 	/* Checks for hardware constraints */
 	if (port->first_rxq + port->nrxqs >
@@ -5493,6 +5493,18 @@ static int mvpp2_port_init(struct mvpp2_port *port)
 	mvpp2_egress_disable(port);
 	mvpp2_port_disable(port);
 
+	if (mvpp2_is_xlg(port->phy_interface)) {
+		val = readl(port->base + MVPP22_XLG_CTRL0_REG);
+		val &= ~MVPP22_XLG_CTRL0_FORCE_LINK_PASS;
+		val |= MVPP22_XLG_CTRL0_FORCE_LINK_DOWN;
+		writel(val, port->base + MVPP22_XLG_CTRL0_REG);
+	} else {
+		val = readl(port->base + MVPP2_GMAC_AUTONEG_CONFIG);
+		val &= ~MVPP2_GMAC_FORCE_LINK_PASS;
+		val |= MVPP2_GMAC_FORCE_LINK_DOWN;
+		writel(val, port->base + MVPP2_GMAC_AUTONEG_CONFIG);
+	}
+
 	port->tx_time_coal = MVPP2_TXDONE_COAL_USEC;
 
 	port->txqs = devm_kcalloc(dev, port->ntxqs, sizeof(*port->txqs),
-- 
1.9.1


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

* Re: [PATCH net v2 2/2] net: mvpp2: disable force link UP during port init procedure
  2020-12-17  9:40 ` [PATCH net v2 2/2] net: mvpp2: disable force link UP during port init procedure stefanc
@ 2020-12-17 11:00   ` Marcin Wojtas
  2020-12-17 11:22     ` Russell King - ARM Linux admin
  2020-12-17 14:09     ` Andrew Lunn
  0 siblings, 2 replies; 7+ messages in thread
From: Marcin Wojtas @ 2020-12-17 11:00 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

Hi Stefan,

czw., 17 gru 2020 o 10:42 <stefanc@marvell.com> napisał(a):
>
> From: Stefan Chulski <stefanc@marvell.com>
>
> Force link UP can be enabled by bootloader during tftpboot
> and breaks NFS support.
> Force link UP disabled during port init procedure.
>
> Signed-off-by: Stefan Chulski <stefanc@marvell.com>
> ---

What are the updates against v1? Please note them in this place for
individual patches and list all in the cover letter (in case sending a
group of patches).

Do you think it's a fix that should be backported to stable branches?
If yes, please add 'Fixes: <commit ID> ("commit title")' and it may be
good to add 'Cc: stable@vger.kernel.org' adjacent to the Signed-off-by
tag.

Thanks,
Marcin

>  drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> index d2b0506..0ad3177 100644
> --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
> @@ -5479,7 +5479,7 @@ static int mvpp2_port_init(struct mvpp2_port *port)
>         struct mvpp2 *priv = port->priv;
>         struct mvpp2_txq_pcpu *txq_pcpu;
>         unsigned int thread;
> -       int queue, err;
> +       int queue, err, val;
>
>         /* Checks for hardware constraints */
>         if (port->first_rxq + port->nrxqs >
> @@ -5493,6 +5493,18 @@ static int mvpp2_port_init(struct mvpp2_port *port)
>         mvpp2_egress_disable(port);
>         mvpp2_port_disable(port);
>
> +       if (mvpp2_is_xlg(port->phy_interface)) {
> +               val = readl(port->base + MVPP22_XLG_CTRL0_REG);
> +               val &= ~MVPP22_XLG_CTRL0_FORCE_LINK_PASS;
> +               val |= MVPP22_XLG_CTRL0_FORCE_LINK_DOWN;
> +               writel(val, port->base + MVPP22_XLG_CTRL0_REG);
> +       } else {
> +               val = readl(port->base + MVPP2_GMAC_AUTONEG_CONFIG);
> +               val &= ~MVPP2_GMAC_FORCE_LINK_PASS;
> +               val |= MVPP2_GMAC_FORCE_LINK_DOWN;
> +               writel(val, port->base + MVPP2_GMAC_AUTONEG_CONFIG);
> +       }
> +
>         port->tx_time_coal = MVPP2_TXDONE_COAL_USEC;
>
>         port->txqs = devm_kcalloc(dev, port->ntxqs, sizeof(*port->txqs),
> --
> 1.9.1
>

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

* Re: [PATCH net v2 2/2] net: mvpp2: disable force link UP during port init procedure
  2020-12-17 11:00   ` Marcin Wojtas
@ 2020-12-17 11:22     ` Russell King - ARM Linux admin
  2020-12-17 11:26       ` [EXT] " Stefan Chulski
  2020-12-17 14:09     ` Andrew Lunn
  1 sibling, 1 reply; 7+ messages in thread
From: Russell King - ARM Linux admin @ 2020-12-17 11:22 UTC (permalink / raw)
  To: Marcin Wojtas
  Cc: Stefan Chulski, netdev, Thomas Petazzoni, David S. Miller,
	nadavh, Yan Markman, Linux Kernel Mailing List, Jakub Kicinski,
	Andrew Lunn

On Thu, Dec 17, 2020 at 12:00:49PM +0100, Marcin Wojtas wrote:
> Hi Stefan,
> 
> czw., 17 gru 2020 o 10:42 <stefanc@marvell.com> napisał(a):
> >
> > From: Stefan Chulski <stefanc@marvell.com>
> >
> > Force link UP can be enabled by bootloader during tftpboot
> > and breaks NFS support.
> > Force link UP disabled during port init procedure.
> >
> > Signed-off-by: Stefan Chulski <stefanc@marvell.com>
> > ---
> 
> What are the updates against v1? Please note them in this place for
> individual patches and list all in the cover letter (in case sending a
> group of patches).

It seems the only reason this has been resent is because it's
(incorrectly) part of a series that involved a change to patch 1
(adding the Fixes: tag).

As this is a stand-alone fix, it shouldn't be part of a series unless
there really is some kind of dependency with the other patch(es) of
that series.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

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

* RE: [EXT] Re: [PATCH net v2 2/2] net: mvpp2: disable force link UP during port init procedure
  2020-12-17 11:22     ` Russell King - ARM Linux admin
@ 2020-12-17 11:26       ` Stefan Chulski
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Chulski @ 2020-12-17 11:26 UTC (permalink / raw)
  To: Russell King - ARM Linux admin, Marcin Wojtas
  Cc: netdev, Thomas Petazzoni, David S. Miller, Nadav Haklai,
	Yan Markman, Linux Kernel Mailing List, Jakub Kicinski,
	Andrew Lunn

> On Thu, Dec 17, 2020 at 12:00:49PM +0100, Marcin Wojtas wrote:
> > Hi Stefan,
> >
> > czw., 17 gru 2020 o 10:42 <stefanc@marvell.com> napisał(a):
> > >
> > > From: Stefan Chulski <stefanc@marvell.com>
> > >
> > > Force link UP can be enabled by bootloader during tftpboot and
> > > breaks NFS support.
> > > Force link UP disabled during port init procedure.
> > >
> > > Signed-off-by: Stefan Chulski <stefanc@marvell.com>
> > > ---
> >
> > What are the updates against v1? Please note them in this place for
> > individual patches and list all in the cover letter (in case sending a
> > group of patches).
> 
> It seems the only reason this has been resent is because it's
> (incorrectly) part of a series that involved a change to patch 1 (adding the
> Fixes: tag).
> 
> As this is a stand-alone fix, it shouldn't be part of a series unless there really is
> some kind of dependency with the other patch(es) of that series.

I would repost this two patches separately.

Regards,
Stefan.

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

* Re: [PATCH net v2 2/2] net: mvpp2: disable force link UP during port init procedure
  2020-12-17 11:00   ` Marcin Wojtas
  2020-12-17 11:22     ` Russell King - ARM Linux admin
@ 2020-12-17 14:09     ` Andrew Lunn
  2020-12-17 14:13       ` Marcin Wojtas
  1 sibling, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2020-12-17 14:09 UTC (permalink / raw)
  To: Marcin Wojtas
  Cc: Stefan Chulski, netdev, Thomas Petazzoni, David S. Miller,
	nadavh, Yan Markman, Linux Kernel Mailing List, Jakub Kicinski,
	Russell King - ARM Linux, Russell King

> Do you think it's a fix that should be backported to stable branches?
> If yes, please add 'Fixes: <commit ID> ("commit title")' and it may be
> good to add 'Cc: stable@vger.kernel.org' adjacent to the Signed-off-by
> tag.

netdev patches should not be Cc: stable@vger.kernel.org. David and
Jakub handle stable patches directly.

      Andrew

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

* Re: [PATCH net v2 2/2] net: mvpp2: disable force link UP during port init procedure
  2020-12-17 14:09     ` Andrew Lunn
@ 2020-12-17 14:13       ` Marcin Wojtas
  0 siblings, 0 replies; 7+ messages in thread
From: Marcin Wojtas @ 2020-12-17 14:13 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Stefan Chulski, netdev, Thomas Petazzoni, David S. Miller,
	nadavh, Yan Markman, Linux Kernel Mailing List, Jakub Kicinski,
	Russell King - ARM Linux, Russell King

czw., 17 gru 2020 o 15:09 Andrew Lunn <andrew@lunn.ch> napisał(a):
>
> > Do you think it's a fix that should be backported to stable branches?
> > If yes, please add 'Fixes: <commit ID> ("commit title")' and it may be
> > good to add 'Cc: stable@vger.kernel.org' adjacent to the Signed-off-by
> > tag.
>
> netdev patches should not be Cc: stable@vger.kernel.org. David and
> Jakub handle stable patches directly.
>

Thanks for clarification.

Marcin

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

end of thread, other threads:[~2020-12-17 14:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17  9:40 [PATCH net v2 1/2] net: mvpp2: Fix GoP port 3 Networking Complex Control configurations stefanc
2020-12-17  9:40 ` [PATCH net v2 2/2] net: mvpp2: disable force link UP during port init procedure stefanc
2020-12-17 11:00   ` Marcin Wojtas
2020-12-17 11:22     ` Russell King - ARM Linux admin
2020-12-17 11:26       ` [EXT] " Stefan Chulski
2020-12-17 14:09     ` Andrew Lunn
2020-12-17 14:13       ` Marcin Wojtas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).