All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stas Sergeev <stsp@list.ru>
To: netdev <netdev@vger.kernel.org>
Cc: Linux kernel <linux-kernel@vger.kernel.org>,
	Sebastien Rannou <mxs@sbrk.org>,
	Arnaud Ebalard <arno@natisbad.org>,
	Stas Sergeev <stsp@users.sourceforge.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	stable@vger.kernel.org
Subject: [PATCH 3/3] mvneta: use inband status only when explicitly enabled
Date: Tue, 14 Jul 2015 20:14:55 +0300	[thread overview]
Message-ID: <55A5438F.8070903@list.ru> (raw)
In-Reply-To: <55A5424D.4030809@list.ru>


The commit 898b2970e2c9 ("mvneta: implement SGMII-based in-band link state
signaling") implemented the link parameters auto-negotiation unconditionally.
Unfortunately it appears that some HW that implements SGMII protocol,
doesn't generate the inband status, so it is not possible to auto-negotiate
anything with such HW.

This patch enables the auto-negotiation only if explicitly requested with
the 'managed' DT property.

This patch fixes the following regression:
https://lkml.org/lkml/2015/7/8/865
and is therefore CCed to stable.

Signed-off-by: Stas Sergeev <stsp@users.sourceforge.net>

CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
CC: netdev@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: stable@vger.kernel.org
---
 drivers/net/ethernet/marvell/mvneta.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 74176ec..7a1deee 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -3008,8 +3008,8 @@ static int mvneta_probe(struct platform_device *pdev)
 	const char *dt_mac_addr;
 	char hw_mac_addr[ETH_ALEN];
 	const char *mac_from;
+	const char *managed;
 	int phy_mode;
-	int fixed_phy = 0;
 	int err;

 	/* Our multiqueue support is not complete, so for now, only
@@ -3043,7 +3043,6 @@ static int mvneta_probe(struct platform_device *pdev)
 			dev_err(&pdev->dev, "cannot register fixed PHY\n");
 			goto err_free_irq;
 		}
-		fixed_phy = 1;

 		/* In the case of a fixed PHY, the DT node associated
 		 * to the PHY is the Ethernet MAC DT node.
@@ -3067,8 +3066,10 @@ static int mvneta_probe(struct platform_device *pdev)
 	pp = netdev_priv(dev);
 	pp->phy_node = phy_node;
 	pp->phy_interface = phy_mode;
-	pp->use_inband_status = (phy_mode == PHY_INTERFACE_MODE_SGMII) &&
-				fixed_phy;
+
+	err = of_property_read_string(dn, "managed", &managed);
+	pp->use_inband_status = (err == 0 &&
+				 strcmp(managed, "in-band-status") == 0);

 	pp->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(pp->clk)) {
-- 
1.9.1

  parent reply	other threads:[~2015-07-14 17:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 17:09 [PATCH v3 0/3] net: enable inband link state negotiation only when explicitly requested Stas Sergeev
2015-07-14 17:11 ` [PATCH 1/3] fixed_phy: handle link-down case Stas Sergeev
2015-07-14 18:28   ` Florian Fainelli
     [not found]     ` <55A56D4D.5090004@list.ru>
2015-07-15 15:33       ` Fwd: " Stas Sergeev
2015-07-14 17:13 ` [PATCH 2/3] of_mdio: add new DT property 'managed' to specify the PHY management type Stas Sergeev
2015-07-14 17:13   ` Stas Sergeev
2015-07-14 17:51   ` Florian Fainelli
2015-07-14 17:51     ` Florian Fainelli
2015-07-14 20:26     ` Stas Sergeev
2015-07-14 17:14 ` Stas Sergeev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-07-16 14:49 [PATCH v4 0/3] net: enable inband link state negotiation only when explicitly requested Stas Sergeev
2015-07-16 14:53 ` [PATCH 3/3] mvneta: use inband status only when explicitly enabled Stas Sergeev
2015-07-10 16:38 [PATCH v2 0/2] net: enable inband link state negotiation only when explicitly requested Stas Sergeev
2015-07-10 16:45 ` [PATCH 3/3] mvneta: use inband status only when explicitly enabled Stas Sergeev

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=55A5438F.8070903@list.ru \
    --to=stsp@list.ru \
    --cc=arno@natisbad.org \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mxs@sbrk.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stsp@users.sourceforge.net \
    --cc=thomas.petazzoni@free-electrons.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 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.