Received: by 10.223.164.202 with SMTP id h10csp3218638wrb; Tue, 28 Nov 2017 07:57:50 -0800 (PST) X-Google-Smtp-Source: AGs4zMba2IsYZAzBFPhojku/w9X5t8uC5fHk5AyE6ZMWItTTsSmAkVoZojtvo18NrkIwoUwpco5q X-Received: by 10.159.255.1 with SMTP id bi1mr6709576plb.8.1511884670515; Tue, 28 Nov 2017 07:57:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511884670; cv=none; d=google.com; s=arc-20160816; b=oYybsij6jn0CJOSt7VQnvYG9jk5PTKZV/Y0UflK70ctKWKlAW25FFA8O+M1E6S2/d2 K0kwdURnKLC+KlJrIr5pX4xNUWRYPHHYno3K0CitvR6YhTnojXscrkZAwFIuGZok3809 /yFazrrd/1cFbWnYXZo1C4rwAg3ezq7R3Y9YFE/B/8ML/pniYOvLP7I6Ax0Gk4I3EBVc J6TPGk4QSeYaeFvoOSr8+S1xniKScKrbQ4hs4SoJ6lRLhR/c2YNjvtaLXciy70wsjs/V 7ycd5JX/AnrBgRQF9RoxrZmmteeceJdC1Quf/Lq0zuVlJ4V4s0/ezNSA06/xGfbo8RZo 844g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=UgvOHyTrI29hVNl7N2dd0MgQakY1ZqK1SzJXFj2cyAQ=; b=h0gM16UVH5K5aOLb/t9t5cQrqTYZv/mRl7EHCueoT5IZd1p0Mw0DMI2EuEurXQomWw KjpOHIjIpJ/dwP+XCT9FntpNwFP0ebuZ4dp5xR/0FDwX2BSgMotG9vsZreGCFen3GU69 tKfG7VEOA2sAl0ftz8Rhp/NmVbj/1K9yWyfa2n9yuhGV7qEEbvpdkdZjLr5mYS/ywGp1 vgSQL58sDWThqyf8lMH+KIIDk/0mRGtc73AIHmHkq9FK5DTsiYJQsHClSYzwlYB5M6eM BPaYFitYixTuwg3QTVchP+yAOZRExYmrwqmn64H3UflqVC9eDtXLHKPUhcfx02t05ft4 DGqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=bcMBX9gc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si24361809pgd.769.2017.11.28.07.57.35; Tue, 28 Nov 2017 07:57:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@armlinux.org.uk header.s=pandora-2014 header.b=bcMBX9gc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932124AbdK1P4d (ORCPT + 77 others); Tue, 28 Nov 2017 10:56:33 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:51724 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932087AbdK1P4a (ORCPT ); Tue, 28 Nov 2017 10:56:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=UgvOHyTrI29hVNl7N2dd0MgQakY1ZqK1SzJXFj2cyAQ=; b=bcMBX9gcGS/zyZ1NqBxfw67OJBvD7PRWSiLaxV41mgInOkzZXseFytENGTKGdOdc3hDn+BHTOqztVR5SyZ1irwZ91tQ0rCnbxPeKkGCvttM0i/BwIJOe4m1MAcMAEFbbZ1rsvOInFI3SqNYcsMTUzyrTtxGYKzX/mUJg1LvrolA=; Received: from flint.armlinux.org.uk ([fd8f:7570:feb6:1:201:2ff:fe14:8fad]:34862) by pandora.armlinux.org.uk with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1eJiF8-0006it-CS; Tue, 28 Nov 2017 15:56:18 +0000 Received: from rmk by flint.armlinux.org.uk with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1eJiF1-0002Bw-Pa; Tue, 28 Nov 2017 15:56:11 +0000 Date: Tue, 28 Nov 2017 15:56:11 +0000 From: Russell King To: Antoine Tenart Cc: andrew@lunn.ch, f.fainelli@gmail.com, davem@davemloft.net, Yan Markman , gregory.clement@free-electrons.com, thomas.petazzoni@free-electrons.com, miquel.raynal@free-electrons.com, nadavh@marvell.com, mw@semihalf.com, stefanc@marvell.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: phylink: fix link state on phy-connect Message-ID: <20171128155611.GA8358@flint.armlinux.org.uk> References: <20171128132932.27196-1-antoine.tenart@free-electrons.com> <20171128155317.GA7974@flint.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171128155317.GA7974@flint.armlinux.org.uk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Oh, and lastly, please send patches to linux@armlinux.org.uk or the address I use in the sign-offs - sending them to rmk@armlinux.org.uk is for personal non-Linux mail only, and has resulted in _all_ of these messages ending up in my spam folder. Thanks. On Tue, Nov 28, 2017 at 03:53:17PM +0000, Russell King wrote: > On Tue, Nov 28, 2017 at 02:29:32PM +0100, Antoine Tenart wrote: > > From: Yan Markman > > Hi, thanks for the patch. > > > When calling successively _connect, _disconnect and _connect again, if > > the link configuration changed whilst being down from the phylink > > perspective, the last _connect would stay in an incorrect old speed. > > Fixes this by setting the link configuration parameters to an unknown > > value when calling phylink_bringup_phy. > > Under what circumstances does this occur? > > > > > Fixes: 9525ae83959b ("phylink: add phylink infrastructure") > > Signed-off-by: Yan Markman > > [Antoine: commit message] > > Signed-off-by: Antoine Tenart > > --- > > drivers/net/phy/phylink.c | 10 ++++++++++ > > 1 file changed, 10 insertions(+) > > > > diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c > > index e3bbc70372d3..c2cec3eef67d 100644 > > --- a/drivers/net/phy/phylink.c > > +++ b/drivers/net/phy/phylink.c > > @@ -621,6 +621,16 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy) > > if (ret) > > return ret; > > > > + /* On _disconnect, the phy state machine and phylink resolve > > + * are stopped before executing full gracefull down/reset state. > > + * The further _connect starts with incorrect init state. Let's set > > + * init values here. > > + */ > > + pl->phy_state.link = false; > > + pl->link_config.pause = MLO_PAUSE_AN; > > + pl->link_config.speed = SPEED_UNKNOWN; > > + pl->link_config.duplex = DUPLEX_UNKNOWN; > > It would be much better to clean up the phy_state in > phylink_disconnect_phy() and trigger a resolve, rather than doing that > each time a PHY is connected - the link should be taken down when the > PHY is removed. > > However, I'd like to know under what circumstances this is happening, > since, if you're hotplugging a PHY you should be doing that via SFP > which has additional link up/down handling. What board is this with? > > Also note that there's a number of patches in my "phy" branch that > I'm intending to send as a result of working with Florian over the > last few weeks. There's several people working fairly independently > in this area and having everyone send patches independently of each > other could get painful to manage. > > I'm intending to send patches once I know that net-next is open. > > -- > Russell King > ARM architecture Linux Kernel maintainer -- Russell King ARM architecture Linux Kernel maintainer From 1585325776084199520@xxx Tue Nov 28 15:54:35 +0000 2017 X-GM-THRID: 1585316788419333533 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread