netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v3] net: mvpp2: disable force link UP during port init procedure
@ 2020-12-17 14:52 stefanc
  2020-12-18  3:36 ` Marcin Wojtas
  0 siblings, 1 reply; 3+ messages in thread
From: stefanc @ 2020-12-17 14:52 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.

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

Changes in v3:
- Added Fixes tag.
Changes in v2:
- No changes.

 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] 3+ messages in thread

* Re: [PATCH net v3] net: mvpp2: disable force link UP during port init procedure
  2020-12-17 14:52 [PATCH net v3] net: mvpp2: disable force link UP during port init procedure stefanc
@ 2020-12-18  3:36 ` Marcin Wojtas
  2020-12-19 18:02   ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Wojtas @ 2020-12-18  3:36 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 15:54 <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.
>
> Fixes: f84bf386f395 ("net: mvpp2: initialize the GoP")
> Signed-off-by: Stefan Chulski <stefanc@marvell.com>
> ---
>
> Changes in v3:
> - Added Fixes tag.
> Changes in v2:
> - No changes.
>
>  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),
> --

I confirm the patch fixes issue - tested on CN913x-DB and RGMII port.
Other boards there I see no regression.

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

Thanks,
Marcin

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

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

On Fri, 18 Dec 2020 04:36:18 +0100 Marcin Wojtas wrote:
> czw., 17 gru 2020 o 15:54 <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.
> >
> > Fixes: f84bf386f395 ("net: mvpp2: initialize the GoP")
> > Signed-off-by: Stefan Chulski <stefanc@marvell.com>
> 
> I confirm the patch fixes issue - tested on CN913x-DB and RGMII port.
> Other boards there I see no regression.
> 
> Acked-by: Marcin Wojtas <mw@semihalf.com>

Applied, thanks!

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

end of thread, other threads:[~2020-12-19 18:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 14:52 [PATCH net v3] net: mvpp2: disable force link UP during port init procedure stefanc
2020-12-18  3:36 ` Marcin Wojtas
2020-12-19 18:02   ` Jakub Kicinski

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).