Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp689282ybl; Tue, 28 Jan 2020 10:10:37 -0800 (PST) X-Google-Smtp-Source: APXvYqyocM2P6Y18rQTqmjUrAMF5AEUcYpYHj07QZZgZ7Ta2woE+n5We57lL96zDnbAyaSSa770M X-Received: by 2002:a9d:7e8a:: with SMTP id m10mr16235672otp.27.1580235036897; Tue, 28 Jan 2020 10:10:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580235036; cv=none; d=google.com; s=arc-20160816; b=gbSpR5Sm89K7OylGo48CKvqOLGWSmPxjkDueKBcJyad7Myo493SjqUFdoaSae7t3q1 2VX2N1DJOe/p080WCOEt0RZTzaWPdqJY4Tt4avcxqC+28UHErZyPhBgSYR/1N8DUn0s/ bDN2riiMM5BrnVmjIgG/tyikB8HNajWrN3ySVVKPp8E3dlT8Dw/Mj+IAdK5VSPxNPiXA 6ZI5uPeojBWKl0uX9/1f6eEiXQWyNWANylcBEEBHZQ4fwiQA32NT4CkgWcnsnR9WgqSB P5VyTnsGE3H8Nzes0Y7sbafWayiQrZG74dxHsBULv3rLVQgLyRy+S0u3PLCOGShNMjxI xK5w== 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; bh=27BCOIqr/wU+I4IrmORaozwu+T70UyCl4JtrDd+CI94=; b=b0X+nusRMDAkq8ZYlFgc+3bk94eOyrisQbgOO51voZsBw0xyQbDVorl6YLOkG7RBBZ dyF/pv65kmNsvkbgWtucQAvbHyCUNkCV5MsSASQ7BK9cep8uZH5meJkCEvz/nPIpk/A0 jeQDH4QdBdx1FChFgs04DDVo+9+CLIs06FAnyJ6A03FSTu0jJ3nuZHPJ+MQewjEWMlYK pUWS3B7ssuSXrTemTMGZg0AC8+1PzO11SwT1QOc7XfgTzQpxjNn8uNh0Ka93o275iPpt 0k/BGBeIwiJcJslljvScI1o2S7M+295SrkhNx3dxrZa3q1RuytsHnB/ez7CICH8sXk8/ 4vvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=gdIevUZ2; 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 e9si8768724otk.318.2020.01.28.10.10.24; Tue, 28 Jan 2020 10:10:36 -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 (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=gdIevUZ2; 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 S1726750AbgA1SIW (ORCPT + 99 others); Tue, 28 Jan 2020 13:08:22 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:55994 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726276AbgA1SIW (ORCPT ); Tue, 28 Jan 2020 13:08:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=27BCOIqr/wU+I4IrmORaozwu+T70UyCl4JtrDd+CI94=; b=gdIevUZ2qK6OpxHho3MufWbPt BAR6uXvIytSdD3mS/dJD8OEbTCxNlo+SuFbDltAklslGG5ORJQI5oY0XhpLsmd41S+k3JOAcWaEBW +qrs0ZAor9GYpxnR9GXp6+VIP6VwicXFHpu/bPZZmkew4W+jAgYv9X4UqMX5avJH7sy+8WApdAnFL En6RDgB4j2zlk+EkA6R0xyPLLJZqEc3UNI75Vo0tYLiFCVfyoRfE9aQqS05qpyloeFTQTOMXZtiiz 1Y9ORiDoYgTq8sE0nA1dSdYKIMr/AkfSgmVM+LTMQA4iTk/YzC6rFA2cLC6PqkAthxzzpXk1QGI0b 5aCCeNOaA==; Received: from shell.armlinux.org.uk ([2001:4d48:ad52:3201:5054:ff:fe00:4ec]:32880) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iwVHT-0000c0-EH; Tue, 28 Jan 2020 18:08:10 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1iwVHP-0002ak-1h; Tue, 28 Jan 2020 18:08:03 +0000 Date: Tue, 28 Jan 2020 18:08:03 +0000 From: Russell King - ARM Linux admin To: Andrew Lunn Cc: Jose Abreu , Joao Pinto , Alexandre Torgue , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , Florian Fainelli , Maxime Coquelin , Jakub Kicinski , Giuseppe Cavallaro , "David S. Miller" , "linux-arm-kernel@lists.infradead.org" , Heiner Kallweit Subject: Re: [RFC net-next 6/8] net: phylink: Configure MAC/PCS when link is up without PHY Message-ID: <20200128180802.GD25745@shell.armlinux.org.uk> References: <9a2136885d9a892ff170be88fdffeda82c778a10.1580122909.git.Jose.Abreu@synopsys.com> <20200127112102.GT25745@shell.armlinux.org.uk> <20200127114600.GU25745@shell.armlinux.org.uk> <20200127140038.GD13647@lunn.ch> <20200127140834.GW25745@shell.armlinux.org.uk> <20200127145107.GE13647@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200127145107.GE13647@lunn.ch> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 27, 2020 at 03:51:07PM +0100, Andrew Lunn wrote: > I've also had issues with the DSA links, also being configured to > 10/Half. That seems to be related to having a phy-mode property in > device tree. I need to add a fixed-link property to set the correct > speed. Something is broken here, previously the fixed-link was only > needed if the speed needed to be lower than the ports maximum. I think > that is a separate issue i need to dig into, not part of the PCS to > MAC transfer. I think I understand what is happening on this one more fully. When DSA initialises, the DSA and CPU ports are initially configured to maximum speed via mv88e6xxx_setup_port(), called via mv88e6xxx_setup(), the .setup method, dsa_switch_setup(), and dsa_tree_setup_switches(). dsa_tree_setup_switches() then moves on to calling dsa_port_setup(). dsa_port_setup() calls dsa_port_link_register_of() for the DSA and CPU ports, which calls into dsa_port_phylink_register(). That calls phylink_create(), and then attempts to attach a PHY using phylink_of_phy_connect() - which itself is rather weird - since when has a DSA or CPU port been allowed to have a PHY in its DT node? The upshot is, phylink_create() will (and always has) treated a node without a fixed-link or in-band specification as a "phy" mode link. Moving on, phylink_start() will be called. phylink_start() attempts to set an initial configuration. As there is no PHY attached, phylink has no idea what parameters to set, but it needs to set an initial configuration, so it does so. The result is, dsa_port_phylink_mac_config() gets called without the speed and duplex being set as one would expect. That hasn't changed in phylink yet - so it's a bug that dates back to the phylink integration into the DSA core, and is a regression resulting from that. The reason my patch above appears to solve it is because I'm ignoring calls to mac_config() with mode == MLO_AN_PHY in various circumstances, which results in the initial configuration by mv88e6xxx_setup_port() remaining. I'm not yet sure what to do about that; and I'm out of time to think about that anymore today - but I thought I'd post my analysis so far in the hope that it helps. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up