Commit d6001764 authored by Stas Sergeev's avatar Stas Sergeev Committed by Greg Kroah-Hartman

mvneta: use inband status only when explicitly enabled

[ Upstream commit f8af8e6e in net-next tree,
  will be pushed to Linus very soon. ]

The commit 898b2970 ("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/865Signed-off-by: default avatarStas Sergeev <stsp@users.sourceforge.net>

CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
CC: netdev@vger.kernel.org
CC: linux-kernel@vger.kernel.org
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ebfd3e10
...@@ -3029,8 +3029,8 @@ static int mvneta_probe(struct platform_device *pdev) ...@@ -3029,8 +3029,8 @@ static int mvneta_probe(struct platform_device *pdev)
const char *dt_mac_addr; const char *dt_mac_addr;
char hw_mac_addr[ETH_ALEN]; char hw_mac_addr[ETH_ALEN];
const char *mac_from; const char *mac_from;
const char *managed;
int phy_mode; int phy_mode;
int fixed_phy = 0;
int err; int err;
/* Our multiqueue support is not complete, so for now, only /* Our multiqueue support is not complete, so for now, only
...@@ -3064,7 +3064,6 @@ static int mvneta_probe(struct platform_device *pdev) ...@@ -3064,7 +3064,6 @@ static int mvneta_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "cannot register fixed PHY\n"); dev_err(&pdev->dev, "cannot register fixed PHY\n");
goto err_free_irq; goto err_free_irq;
} }
fixed_phy = 1;
/* In the case of a fixed PHY, the DT node associated /* In the case of a fixed PHY, the DT node associated
* to the PHY is the Ethernet MAC DT node. * to the PHY is the Ethernet MAC DT node.
...@@ -3088,8 +3087,10 @@ static int mvneta_probe(struct platform_device *pdev) ...@@ -3088,8 +3087,10 @@ static int mvneta_probe(struct platform_device *pdev)
pp = netdev_priv(dev); pp = netdev_priv(dev);
pp->phy_node = phy_node; pp->phy_node = phy_node;
pp->phy_interface = phy_mode; 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); pp->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(pp->clk)) { if (IS_ERR(pp->clk)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment