From patchwork Sun Feb 14 20:31:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Clemens Gruber X-Patchwork-Id: 582548 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 9B48614031F for ; Mon, 15 Feb 2016 07:33:28 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751509AbcBNUdE (ORCPT ); Sun, 14 Feb 2016 15:33:04 -0500 Received: from mail.pqgruber.com ([178.189.19.235]:49816 "EHLO mail.pqgruber.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751279AbcBNUdC (ORCPT ); Sun, 14 Feb 2016 15:33:02 -0500 Received: from archie.tuxnet.lan (chello213047168109.15.14.vie.surfer.at [213.47.168.109]) by mail.pqgruber.com (Postfix) with ESMTPSA id 32A999CCAF; Sun, 14 Feb 2016 21:32:59 +0100 (CET) From: Clemens Gruber To: netdev@vger.kernel.org Cc: Florian Fainelli , linux-kernel@vger.kernel.org, "David S . Miller" , Andrew Lunn , Clemens Gruber Subject: [PATCH] phy: marvell: Fix reg-init bug on 88E1510 Date: Sun, 14 Feb 2016 21:31:25 +0100 Message-Id: <1455481885-11395-1-git-send-email-clemens.gruber@pqgruber.com> X-Mailer: git-send-email 2.7.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The function marvell_of_reg_init was called too late, in m88e1510_config_aneg. This function was not reached, due to the phy state machine being stuck at waiting for interrupts (which were not enabled and off by default on the 88E1510) It lead to the ethernet link not coming up at boot. This commit moves the call of marvell_of_reg_init to config_init. Now, a marvell,reg-init option to enable PHY interrupts on pin LED[2] is set early on and the phy state machine does not get stuck anymore. Tested on i.MX6Q boards with Marvell 88E1510 PHYs. Signed-off-by: Clemens Gruber --- drivers/net/phy/marvell.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index e3eb964..c6ef2da 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -446,7 +446,7 @@ static int m88e1510_config_aneg(struct phy_device *phydev) if (err < 0) return err; - return marvell_of_reg_init(phydev); + return 0; } static int m88e1116r_config_init(struct phy_device *phydev) @@ -788,6 +788,17 @@ static int m88e1145_config_init(struct phy_device *phydev) return 0; } +static int m88e1510_config_init(struct phy_device *phydev) +{ + int err; + + err = marvell_of_reg_init(phydev); + if (err < 0) + return err; + + return 0; +} + /* marvell_read_status * * Generic status code does not detect Fiber correctly! @@ -1259,6 +1270,7 @@ static struct phy_driver marvell_drivers[] = { .features = PHY_GBIT_FEATURES, .flags = PHY_HAS_INTERRUPT, .probe = marvell_probe, + .config_init = &m88e1510_config_init, .config_aneg = &m88e1510_config_aneg, .read_status = &marvell_read_status, .ack_interrupt = &marvell_ack_interrupt,