Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753904AbbGIRlT (ORCPT ); Thu, 9 Jul 2015 13:41:19 -0400 Received: from smtp44.i.mail.ru ([94.100.177.104]:33847 "EHLO smtp44.i.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752210AbbGIRlN (ORCPT ); Thu, 9 Jul 2015 13:41:13 -0400 X-Greylist: delayed 77104 seconds by postgrey-1.27 at vger.kernel.org; Thu, 09 Jul 2015 13:41:12 EDT Message-ID: <559EB22E.7070607@list.ru> Date: Thu, 09 Jul 2015 20:41:02 +0300 From: Stas Sergeev User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: linux-net@vger.kernel.org CC: Linux kernel , Sebastien Rannou , Arnaud Ebalard , Stas Sergeev , Thomas Petazzoni , netdev , Linux kernel , stable@vger.kernel.org Subject: [PATCH 2/2] mvneta: use inband status only when link type is "auto" References: <559EB0A4.5080101@list.ru> In-Reply-To: <559EB0A4.5080101@list.ru> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam: Not detected X-Mras: Ok Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2310 Lines: 64 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 the 'link' DT property is set to "auto". For old configurations where the 'link' property is not specified, the default is to not use auto-negotiation. 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 CC: Thomas Petazzoni CC: netdev@vger.kernel.org CC: linux-kernel@vger.kernel.org CC: stable@vger.kernel.org --- drivers/net/ethernet/marvell/mvneta.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 74176ec..b7f4d7f 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -3009,7 +3009,7 @@ static int mvneta_probe(struct platform_device *pdev) char hw_mac_addr[ETH_ALEN]; const char *mac_from; int phy_mode; - int fixed_phy = 0; + int autoneg_link = 0; int err; /* Our multiqueue support is not complete, so for now, only @@ -3043,7 +3043,7 @@ static int mvneta_probe(struct platform_device *pdev) dev_err(&pdev->dev, "cannot register fixed PHY\n"); goto err_free_irq; } - fixed_phy = 1; + autoneg_link = of_phy_is_autoneg_link(dn); /* In the case of a fixed PHY, the DT node associated * to the PHY is the Ethernet MAC DT node. @@ -3068,7 +3068,7 @@ static int mvneta_probe(struct platform_device *pdev) pp->phy_node = phy_node; pp->phy_interface = phy_mode; pp->use_inband_status = (phy_mode == PHY_INTERFACE_MODE_SGMII) && - fixed_phy; + autoneg_link; pp->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(pp->clk)) { -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/