From patchwork Tue Feb 25 09:37:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 11403055 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 619FE14BC for ; Tue, 25 Feb 2020 09:38:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3FAC62176D for ; Tue, 25 Feb 2020 09:38:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ONd3ikGO"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="d/Q7do78" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3FAC62176D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=yheGCKup+mFvpq7cIeBB2JVq9ICearggaCQK7DnL+sY=; b=ONd3ikGOU/xjCr Nd4BYOZcWck2CuQrlbpTf9p4dcPHAL3wYqjvwbm60dVuoxrOCXwFkmTcXi1YAvHUTa/6NpWpMzDud dpuroSR/Ot1PGSALRVNugSEMbolVWcAL4fTLlYuOgEmWVuXeAYKwJhFKXFgSL0tadmC9AKbdHMHWF TArgvtZknXPNZC0jDPsMNYhnt7v2+baYVR8QXuZ9xXqSUIYFAdB0DxrCWhySsgT1FdOXtkXy++9Ov 98GHll4zkV5EQJDua4xDU+kpSxJDyauCdGE1HWp+anDOKIl7P2eYxedN/6OkRATsXgLBu2HB9MQ5L T9vlEMLdfGxJ4Pd3Kwxg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j6Wfa-00059A-6v; Tue, 25 Feb 2020 09:38:26 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j6WfN-00051H-C3; Tue, 25 Feb 2020 09:38:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:Content-Type:MIME-Version: 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:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OgLcUsWl+TfcpKVPqX7tI0GqOaE8EAShX68S92kCpMU=; b=d/Q7do78YcrzGE7LMmEYudWqZ mYDG2BK17749n1rsgAt5lWnGpf6PCujp3aoPmsFt0tuIN3NwTxCZ7MrLyVQ/QlQw87ewH5W2qI932 hLvDyBf83T+zBrBxVM0Zk+homMb7ziNqyDeFMjcpXoSNGharheYxgTttkXETRJu/ohz2ZFasXPl0Q c5DnESzfVY2CbeBgC5AWLzJYp2v9kZ3lhEKCCjKyHPu6OHD2fRm3flNrYVaObebsvtTfhzFwJqNcn w1bT04vior/wrkpM9ckAbUCgCMMN0hNyNUTvxR2IEClx5a3CUHj6tK3QY0xot2wcQpLb0Mgd8BXCZ kEK0goFsA==; Received: from shell.armlinux.org.uk ([2002:4e20:1eda:1:5054:ff:fe00:4ec]:52520) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1j6Wei-0008OC-Ky; Tue, 25 Feb 2020 09:37:32 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1j6WeF-0007KL-PX; Tue, 25 Feb 2020 09:37:03 +0000 Date: Tue, 25 Feb 2020 09:37:03 +0000 From: Russell King - ARM Linux admin To: Andrew Lunn , Florian Fainelli , Heiner Kallweit Subject: [PATCH net-next 0/8] rework phylink interface for split MAC/PCS support Message-ID: <20200225093703.GS25745@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200225_013813_575205_019BA97E X-CRM114-Status: GOOD ( 12.01 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2001:4d48:ad52:3201:214:fdff:fe10:1be6 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, Thomas Petazzoni , Ioana Ciornei , linux-stm32@st-md-mailman.stormreply.com, Jonathan Corbet , Michal Simek , Jose Abreu , Jakub Kicinski , Mark Lee , Sean Wang , Alexandre Torgue , Hauke Mehrtens , Radhey Shyam Pandey , linux-mediatek@lists.infradead.org, John Crispin , Matthias Brugger , Giuseppe Cavallaro , linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, Nicolas Ferre , Vivien Didelot , Maxime Coquelin , Vladimir Oltean , "David S. Miller" , Felix Fietkau Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org Hi, The following series changes the phylink interface to allow us to better support split MAC / MAC PCS setups. The fundamental change required for this turns out to be quite simple. Today, mac_config() is used for everything to do with setting the parameters for the MAC, and mac_link_up() is used to inform the MAC driver that the link is now up (and so to allow packet flow.) mac_config() also has had a few implementation issues, with folk who believe that members such as "speed" and "duplex" are always valid, where "link" gets used inappropriately, etc. With the proposed patches, all this changes subtly - but in a backwards compatible way at this stage. We pass the the full resolved link state (speed, duplex, pause) to mac_link_up(), and it is now guaranteed that these parameters to this function will always be valid (no more SPEED_UNKNOWN or DUPLEX_UNKNOWN here - unless phylink is fed with such things.) Drivers should convert over to using the state in mac_link_up() rather than configuring the speed, duplex and pause in the mac_config() method. The patch series includes a number of MAC drivers which I've thought have been easy targets - I've left the remainder as I think they need maintainer input. However, *all* drivers will need conversion for future phylink development. Documentation/networking/sfp-phylink.rst | 17 +++- drivers/net/dsa/b53/b53_common.c | 4 +- drivers/net/dsa/b53/b53_priv.h | 4 +- drivers/net/dsa/bcm_sf2.c | 4 +- drivers/net/dsa/lantiq_gswip.c | 4 +- drivers/net/dsa/mt7530.c | 4 +- drivers/net/dsa/mv88e6xxx/chip.c | 79 +++++++++++++---- drivers/net/dsa/sja1105/sja1105_main.c | 4 +- drivers/net/ethernet/cadence/macb.h | 1 - drivers/net/ethernet/cadence/macb_main.c | 57 +++++++----- drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 61 ++++++++----- drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.h | 1 + drivers/net/ethernet/marvell/mvneta.c | 63 ++++++++----- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 102 +++++++++++++--------- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 7 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 37 ++++---- drivers/net/phy/phylink.c | 9 +- include/linux/phylink.h | 57 ++++++++---- include/net/dsa.h | 4 +- net/dsa/port.c | 7 +- 21 files changed, 352 insertions(+), 178 deletions(-)