From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752835AbdK2VHX convert rfc822-to-8bit (ORCPT ); Wed, 29 Nov 2017 16:07:23 -0500 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:41768 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752219AbdK2VHV (ORCPT ); Wed, 29 Nov 2017 16:07:21 -0500 From: Yan Markman To: Russell King - ARM Linux CC: Antoine Tenart , "andrew@lunn.ch" , "f.fainelli@gmail.com" , "davem@davemloft.net" , "gregory.clement@free-electrons.com" , "thomas.petazzoni@free-electrons.com" , "miquel.raynal@free-electrons.com" , "Nadav Haklai" , "mw@semihalf.com" , "Stefan Chulski" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [EXT] Re: [PATCH net] net: phylink: fix link state on phy-connect Thread-Topic: [EXT] Re: [PATCH net] net: phylink: fix link state on phy-connect Thread-Index: AQHTaE0J1bz47nEl5EqXJeKzEHOhkKMpz+GAgAAA0ICAAeUZ0P//8SEAgAAt2KA= Date: Wed, 29 Nov 2017 21:06:56 +0000 Message-ID: <21ec97be76d54a6c8a80fd5b56d35678@IL-EXCH01.marvell.com> References: <20171128132932.27196-1-antoine.tenart@free-electrons.com> <20171128155317.GA7974@flint.armlinux.org.uk> <20171128155611.GA8358@flint.armlinux.org.uk> <20448667430e434aad5bb8cd1b082611@IL-EXCH01.marvell.com> <20171129195911.GG8356@n2100.armlinux.org.uk> In-Reply-To: <20171129195911.GG8356@n2100.armlinux.org.uk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.5.102.207] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-29_07:,, signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1711290272 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The attached p21 patch doesn't change anything. But another one from the mail-text is good void phylink_disconnect_phy(struct phylink *pl) + pl->phy_state.link = false; There still (not for my MRVL-PP2) problem: It is expected that on ifconfig-down the callback pl->ops->mac_link_down(ndev, pl->link_an_mode); would be called, but it isn't -----Original Message----- From: Russell King - ARM Linux [mailto:linux@armlinux.org.uk] Sent: Wednesday, November 29, 2017 9:59 PM To: Yan Markman Cc: Antoine Tenart ; andrew@lunn.ch; f.fainelli@gmail.com; davem@davemloft.net; gregory.clement@free-electrons.com; thomas.petazzoni@free-electrons.com; miquel.raynal@free-electrons.com; Nadav Haklai ; mw@semihalf.com; Stefan Chulski ; netdev@vger.kernel.org; linux-kernel@vger.kernel.org Subject: [EXT] Re: [PATCH net] net: phylink: fix link state on phy-connect External Email ---------------------------------------------------------------------- On Wed, Nov 29, 2017 at 07:33:44PM +0000, Yan Markman wrote: > Hi Russel > > On my board I have [Marvell 88E1510] phy working with STATUS-POLLING I > see some inconsistencies -- first ifconfig-up is different from furthers, no "link is down" reports. > Please refer the behavior example below. > My patch is a "simple solution" -- always reset/clear Link-state-parameters before going UP. > Possibly, more correct (but much more complicated) solution would be in the phy state machine and phylink resolve modification. > I just found that > On ifconfig-down, the phy-state-machine and phylink-resolve > are stopped before executing before passing over full graceful down/reset state. > The further ifconfig-up starts with old state parameters. > Special cases not-tested but logic 2 test-cases are: > remote side changes speed whilst link is Down or Disconnected. But local ifconfig-up starts with old speed. Hi, I think this is covered in my "phy" branch - but could probably do with further testing, specifically this patch (which I've attached): "phylink: ensure we take the link down when phylink_stop() is called" This takes the link down on the MAC side synchronously when phylink_stop() is called. However, I think your case might also benefit from this patch - please test the patch referred to without this change, and let me know if you need this change to solve your problem: diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 8f43f8779317..c90ad50204b0 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -798,6 +798,7 @@ void phylink_disconnect_phy(struct phylink *pl) mutex_lock(&pl->state_mutex); pl->netdev->phydev = NULL; pl->phydev = NULL; + pl->phy_state.link = false; mutex_unlock(&pl->state_mutex); mutex_unlock(&phy->lock); flush_work(&pl->resolve); Thanks. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up According to speedtest.net: 8.21Mbps down 510kbps up