From patchwork Tue Apr 1 23:55:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Holler X-Patchwork-Id: 336212 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 2ADEA1400E5 for ; Wed, 2 Apr 2014 11:11:54 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756762AbaDBALa (ORCPT ); Tue, 1 Apr 2014 20:11:30 -0400 Received: from h1446028.stratoserver.net ([85.214.92.142]:39494 "EHLO mail.ahsoftware.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754481AbaDAX5L (ORCPT ); Tue, 1 Apr 2014 19:57:11 -0400 Received: by mail.ahsoftware.de (Postfix, from userid 65534) id 6187F423C2AD; Wed, 2 Apr 2014 01:57:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.ahsoftware.de X-Spam-Level: X-Spam-Status: No, score=-101.0 required=5.0 tests=ALL_TRUSTED, USER_IN_WHITELIST autolearn=disabled version=3.3.1 Received: from eiche.ahsoftware (p57B220DA.dip0.t-ipconnect.de [87.178.32.218]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.ahsoftware.de (Postfix) with ESMTPSA id 7E2D2423C270; Wed, 2 Apr 2014 01:57:09 +0200 (CEST) Received: by eiche.ahsoftware (Postfix, from userid 65534) id CF05380CD8; Wed, 2 Apr 2014 01:57:08 +0200 (CEST) Received: from krabat.ahsoftware (unknown [192.168.207.2]) by eiche.ahsoftware (Postfix) with ESMTP id F274580290; Tue, 1 Apr 2014 23:56:25 +0000 (UTC) From: Alexander Holler To: linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org, Florian Fainelli , Michal Simek , Alexander Holler , Subject: [PATCH regression] net: phy: fix initialization (config_init) for Marvel 88E1116R PHYs Date: Wed, 2 Apr 2014 01:55:59 +0200 Message-Id: <1396396559-6971-1-git-send-email-holler@ahsoftware.de> X-Mailer: git-send-email 1.8.3.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Commit 7cd1463664c2a15721ff4ccfb61d4d970815cb3d (introduced with 3.14) changed the initialization of the mv643xx_eth driver to use phy_init_hw() to reset the PHY. Unfortunately the initialization for the 88E1116R PHY was broken such, that it used mdelay() instead of really waiting for a reset to finish. The effect was that the ethernet on my Kirkwood 88F6281 based device didn't come up anymore (no carrier). Fix this by waiting for a reset to finish before proceeding further. Signed-off-by: Alexander Holler Cc: Michal Simek Cc: Florian Fainelli Cc: --- drivers/net/phy/marvell.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index bd37e45..5b84808 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -396,7 +396,9 @@ static int m88e1116r_config_init(struct phy_device *phydev) if (err < 0) return err; - mdelay(500); + do + temp = phy_read(phydev, MII_BMCR); + while (temp & BMCR_RESET); err = phy_write(phydev, MII_MARVELL_PHY_PAGE, 0); if (err < 0) @@ -429,7 +431,9 @@ static int m88e1116r_config_init(struct phy_device *phydev) if (err < 0) return err; - mdelay(500); + do + temp = phy_read(phydev, MII_BMCR); + while (temp & BMCR_RESET); return 0; }