From patchwork Tue Jul 21 00:49:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 497970 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id D1775140DCD for ; Tue, 21 Jul 2015 10:52:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=BWtR3gGn; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757615AbbGUAwD (ORCPT ); Mon, 20 Jul 2015 20:52:03 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:34856 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757604AbbGUAwB (ORCPT ); Mon, 20 Jul 2015 20:52:01 -0400 Received: by pdrg1 with SMTP id g1so109644764pdr.2; Mon, 20 Jul 2015 17:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tmpQmkRP130SpfU+KzgHReo2Emuj8MF4WXTaMMdOwI0=; b=BWtR3gGnBa6DaAuBWUKWE1D1zEfFqpCA6796JeDtmcsYz8DDsDoSH1G4oV/FHozOvX IYnH+7YnbfP5rnwHT3A6FqNNjpoO5g2A4LyGEA7qiXQIwrDaKssCa4QTF5UPpA1nbQOp 6F/xv0F1tzg+2gIJOUHnRKA1jvl35j/hYNjfoh9sApydXQbySTcnZakPRJYtUEY72IPT fZvVGhEohXQ1+R7sCt9YEp7S3v6iXHV1zxwSJ54TggPzIXSAXLSujdunBy/xfa4N11ph O3QyICfdv2HP+K232LXfNwEQrTYgOacU1Ka9JqwdCOlvCtJfgJztq3pob/6YKR/W9OHQ udXw== X-Received: by 10.70.37.43 with SMTP id v11mr66343570pdj.89.1437439920916; Mon, 20 Jul 2015 17:52:00 -0700 (PDT) Received: from fainelli-desktop.broadcom.com (5520-maca-inet1-outside.broadcom.com. [216.31.211.11]) by smtp.gmail.com with ESMTPSA id bf5sm24083515pad.43.2015.07.20.17.51.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Jul 2015 17:52:00 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: davem@davemloft.net, linux-kernel@vger.kernel.org, mxs@sbrk.org, arno@natisbad.org, stsp@users.sourceforge.net, devicetree@vger.kernel.org, thomas.petazzoni@free-electrons.com, Stas Sergeev Subject: [PATCH net v5 4/4] mvneta: use inband status only when explicitly enabled Date: Mon, 20 Jul 2015 17:49:58 -0700 Message-Id: <1437439798-12622-5-git-send-email-f.fainelli@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1437439798-12622-1-git-send-email-f.fainelli@gmail.com> References: <1437439798-12622-1-git-send-email-f.fainelli@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Stas Sergeev 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 Signed-off-by: Stas Sergeev CC: Thomas Petazzoni CC: netdev@vger.kernel.org CC: linux-kernel@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 370e20ed224c..e4fb172d91a6 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -3029,8 +3029,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 @@ -3064,7 +3064,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. @@ -3088,8 +3087,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)) {