linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antoine Tenart <antoine.tenart@bootlin.com>
To: davem@davemloft.net, linux@armlinux.org.uk
Cc: Antoine Tenart <antoine.tenart@bootlin.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	thomas.petazzoni@bootlin.com, maxime.chevallier@bootlin.com,
	gregory.clement@bootlin.com, miquel.raynal@bootlin.com,
	nadavh@marvell.com, stefanc@marvell.com, ymarkman@marvell.com,
	mw@semihalf.com
Subject: [PATCH net-next 13/13] net: mvpp2: some AN fields require the link to be down when updated
Date: Fri, 15 Feb 2019 16:32:41 +0100	[thread overview]
Message-ID: <20190215153241.6857-14-antoine.tenart@bootlin.com> (raw)
In-Reply-To: <20190215153241.6857-1-antoine.tenart@bootlin.com>

The GMAC configuration helper modifies values in the auto-negotiation
register. Some of its values require the port to be forced down when
modifying their values. This patches fixes the check made on the bit to
be updated in this register, so that the port is forced down when
needed. This fix cases where some of those parameters were updated, but
not taken into account, such as when using RGMII interfaces.

Fixes: d14e078f23cc ("net: marvell: mvpp2: only reprogram what is necessary on mac_config")
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index 80406195a255..0419a18f0a28 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -4641,9 +4641,19 @@ static void mvpp2_gmac_config(struct mvpp2_port *port, unsigned int mode,
 		}
 	}
 
+/* Some fields of the auto-negotiation register require the port to be down when
+ * their value is updated.
+ */
+#define MVPP2_GMAC_AN_PORT_DOWN_MASK	\
+		(MVPP2_GMAC_IN_BAND_AUTONEG | \
+		 MVPP2_GMAC_IN_BAND_AUTONEG_BYPASS | \
+		 MVPP2_GMAC_CONFIG_MII_SPEED | MVPP2_GMAC_CONFIG_GMII_SPEED | \
+		 MVPP2_GMAC_AN_SPEED_EN | MVPP2_GMAC_CONFIG_FULL_DUPLEX | \
+		 MVPP2_GMAC_AN_DUPLEX_EN)
+
 	if ((old_ctrl0 ^ ctrl0) & MVPP2_GMAC_PORT_TYPE_MASK ||
 	    (old_ctrl2 ^ ctrl2) & MVPP2_GMAC_INBAND_AN_MASK ||
-	    (old_an ^ an) & MVPP2_GMAC_IN_BAND_AUTONEG) {
+	    (old_an ^ an) & MVPP2_GMAC_AN_PORT_DOWN_MASK) {
 		/* Force link down */
 		old_an &= ~MVPP2_GMAC_FORCE_LINK_PASS;
 		old_an |= MVPP2_GMAC_FORCE_LINK_DOWN;
-- 
2.20.1


  parent reply	other threads:[~2019-02-15 15:35 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15 15:32 [PATCH net-next 00/13] net: mvpp2: various fixes Antoine Tenart
2019-02-15 15:32 ` [PATCH net-next 01/13] net: mvpp2: do not call phylink_mac_change if there is no event Antoine Tenart
2019-02-15 17:05   ` Russell King - ARM Linux admin
2019-02-18 10:40     ` Antoine Tenart
2019-02-15 15:32 ` [PATCH net-next 02/13] net: mvpp2: a port can be disabled even if we use the link IRQ Antoine Tenart
2019-02-15 15:32 ` [PATCH net-next 03/13] net: mvpp2: do not disable the port if the mode hasn't changed Antoine Tenart
2019-02-15 15:32 ` [PATCH net-next 04/13] net: mvpp2: reconfiguring the port interface is PPv2.2 specific Antoine Tenart
2019-02-15 15:32 ` [PATCH net-next 05/13] net: mvpp2: do not set the XLG MAC in reset when disabling a port Antoine Tenart
2019-02-15 15:32 ` [PATCH net-next 06/13] net: mvpp2: fix a typo in the header Antoine Tenart
2019-02-15 15:32 ` [PATCH net-next 07/13] net: mvpp2: fix validate for PPv2.1 Antoine Tenart
2019-02-15 15:32 ` [PATCH net-next 08/13] net: mvpp2: fix the computation of the RXQs Antoine Tenart
2019-02-15 15:32 ` [PATCH net-next 09/13] net: mvpp2: update the port documentation regarding the GoP Antoine Tenart
2019-02-15 15:32 ` [PATCH net-next 10/13] net: mvpp2: reset the XPCS while reconfiguring the serdes lanes Antoine Tenart
2019-02-15 17:12   ` Russell King - ARM Linux admin
2019-02-15 17:23     ` Stefan Chulski
2019-02-18 10:26     ` Antoine Tenart
2019-02-18 10:43       ` Russell King - ARM Linux admin
2019-02-18 10:47         ` Russell King - ARM Linux admin
2019-02-18 10:52           ` Antoine Tenart
2019-02-18 11:08             ` [EXT] " Stefan Chulski
2019-02-18 11:28               ` Russell King - ARM Linux admin
2019-02-18 11:33                 ` Stefan Chulski
2019-02-18 10:50         ` Antoine Tenart
2019-02-15 15:32 ` [PATCH net-next 11/13] net: mvpp2: reset the XLG MAC in port_reset Antoine Tenart
2019-02-15 15:32 ` [PATCH net-next 12/13] net: mvpp2: fix alignment of MVPP2_GMAC_CONFIG_MII_SPEED definition Antoine Tenart
2019-02-15 15:32 ` Antoine Tenart [this message]
2019-02-17 21:23 ` [PATCH net-next 00/13] net: mvpp2: various fixes David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190215153241.6857-14-antoine.tenart@bootlin.com \
    --to=antoine.tenart@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=gregory.clement@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=mw@semihalf.com \
    --cc=nadavh@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=stefanc@marvell.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=ymarkman@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).