Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968848AbdDSSLu (ORCPT ); Wed, 19 Apr 2017 14:11:50 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:35793 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966614AbdDSSLr (ORCPT ); Wed, 19 Apr 2017 14:11:47 -0400 Subject: Re: [PATCH] net: phy: fix auto-negotiation stall due to unavailable interrupt To: Alexander Kochetkov , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1492609604-16359-1-git-send-email-al.kochet@gmail.com> From: Sergei Shtylyov Organization: Cogent Embedded Message-ID: <129784d6-9020-6d01-4b3d-4740ac61368b@cogentembedded.com> Date: Wed, 19 Apr 2017 21:11:43 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1492609604-16359-1-git-send-email-al.kochet@gmail.com> Content-Type: text/plain; charset=utf-8; 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: 1191 Lines: 28 Hello! On 04/19/2017 04:46 PM, Alexander Kochetkov wrote: > The problem I fix related to SMSC LAN8710/LAN8720 PHY handled using > interrupts. During power-up cycle the PHY do auto-negotiation, generate > interrupt and set BMSR_ANEGCOMPLETE flag. Interrupt is handled by PHY > state machine but doesn't update link because PHY is in PHY_READY state. > After some time MAC bring up and connect with PHY. It start PHY using > phy_start(). During startup PHY change state to PHY_AN but doesn't > set BMCR_ANRESTART flag due to genphy_config_aneg() doesn't update MII_BMCR > because there no new to advertising. As a result, state machine wait for ^^^^^^^^^^^^ ^^^^^^^^^^^ There is no new what? Advertize, maybe? > interrupt from PHY and nether get "link is up". Because BMSR_ANEGCOMPLETE ^^^^^^ Never, neither? :-) > already set the patch schedule check link without waiting interrupt. > In case genphy_config_aneg() update MII_BMCR and set BMCR_ANRESTART > flag, BMSR_ANEGCOMPLETE will be cleared and state machine will continue > on auto-negotiation interrupt. > > Signed-off-by: Alexander Kochetkov [...] MBR, Sergei