From patchwork Wed Jul 15 13:18:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 495846 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id DAA981402A9 for ; Wed, 15 Jul 2015 23:17:35 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 307AD4B6E8; Wed, 15 Jul 2015 15:17:34 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uKtMFgDKfo-L; Wed, 15 Jul 2015 15:17:33 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 891A74B6D5; Wed, 15 Jul 2015 15:17:33 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4972E4B6DD for ; Wed, 15 Jul 2015 15:17:31 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yW22kGXaiBOp for ; Wed, 15 Jul 2015 15:17:31 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mx02.posteo.de (mx02.posteo.de [89.146.194.165]) by theia.denx.de (Postfix) with ESMTPS id 146FE4B6D5 for ; Wed, 15 Jul 2015 15:17:29 +0200 (CEST) Received: from dovecot04.posteo.de (unknown [185.67.36.27]) by mx02.posteo.de (Postfix) with ESMTPS id 2195C25AF52E for ; Wed, 15 Jul 2015 15:17:28 +0200 (CEST) Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot04.posteo.de (Postfix) with ESMTPSA id 3mWfQJ49KnzFpWK for ; Wed, 15 Jul 2015 15:17:28 +0200 (CEST) Received: from timelineX.localdomain (ip5b4111d2.dynamic.kabel-deutschland.de [91.65.17.210]) (Authenticated sender: joerg.krause@embedded.rocks) by embedded.rocks (Postfix) with ESMTPSA id 93FF4980977; Wed, 15 Jul 2015 15:17:27 +0200 (CEST) From: =?UTF-8?q?J=C3=B6rg=20Krause?= To: u-boot@lists.denx.de Date: Wed, 15 Jul 2015 15:18:22 +0200 Message-Id: <1436966302-9733-1-git-send-email-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.4.5 MIME-Version: 1.0 Subject: [U-Boot] [PATCH 1/1] net: phy: delay only if reset handler is registered X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" With commit e3a77218a256edbe201112a39beeed8adcabae3f the MII bus is only reset if a reset handler is registered. If there is no reset handler there is no need to wait for a device to come out of the reset. Signed-off-by: Jörg Krause --- drivers/net/phy/phy.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 865abab..65c731a 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -763,11 +763,13 @@ struct phy_device *phy_find_by_mask(struct mii_dev *bus, unsigned phy_mask, phy_interface_t interface) { /* Reset the bus */ - if (bus->reset) + if (bus->reset) { bus->reset(bus); - /* Wait 15ms to make sure the PHY has come out of hard reset */ - udelay(15000); + /* Wait 15ms to make sure the PHY has come out of hard reset */ + udelay(15000); + } + return get_phy_device_by_mask(bus, phy_mask, interface); }