Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752998AbbHMRMG (ORCPT ); Thu, 13 Aug 2015 13:12:06 -0400 Received: from mail-lb0-f175.google.com ([209.85.217.175]:36032 "EHLO mail-lb0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752122AbbHMRMD (ORCPT ); Thu, 13 Aug 2015 13:12:03 -0400 Message-ID: <55CCCFDF.3090408@gmail.com> Date: Thu, 13 Aug 2015 20:11:59 +0300 From: Igor Plyatov Reply-To: plyatov@gmail.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Joe Perches CC: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, f.fainelli@gmail.com, luwei.zhou@freescale.com, richardcochran@gmail.com, davem@davemloft.net, u.kleine-koenig@pengutronix.de, Fabio.Estevam@freescale.com, LW@KARO-electronics.de, Frank.Li@freescale.com Subject: Re: [PATCH] net: phy: workaround for buggy cable detection by LAN8700 after cable plugging References: <1439471556-13760-1-git-send-email-plyatov@gmail.com> <1439484648.4818.13.camel@perches.com> In-Reply-To: <1439484648.4818.13.camel@perches.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1482 Lines: 41 Dear Joe, > On Thu, 2015-08-13 at 16:12 +0300, Igor Plyatov wrote: >> * Due to HW bug, LAN8700 sometimes does not detect presence of energy in the >> Ethernet cable in Energy Detect Power-Down mode (e.g while EDPWRDOWN bit is >> set, the ENERGYON bit does not asserted sometimes). This is a common bug of >> LAN87xx family of PHY chips. >> * The lan87xx_read_status() was improved to acquire ENERGYON bit. Its previous >> algorythm still not reliable on 100 % and sometimes skip cable plugging. > [] >> diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c > [] >> @@ -104,10 +104,12 @@ static int lan911x_config_init(struct phy_device *phydev) >> static int lan87xx_read_status(struct phy_device *phydev) >> { >> int err = genphy_read_status(phydev); >> + int rc; > Is there a reason to move this declaration? There is no strict requirement to move declaration of the rc. It was made just to have all declarations easily visible. >> + int i; >> >> if (!phydev->link) { >> /* Disable EDPD to wake up PHY */ >> - int rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS); >> + rc = phy_read(phydev, MII_LAN83C185_CTRL_STATUS); >> if (rc < 0) >> return rc; >> > Best wishes -- Igor Plyatov -- 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/