From patchwork Fri Jun 23 14:15:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13290715 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8A447EB64DD for ; Fri, 23 Jun 2023 14:16:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc: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=0YTlra2SZFVioZOT7y80SSLy6btcozzujvMAzbudwhg=; b=pVZwSjG49xoaou wQ7+cPgVAVUdj8zJBh/wftnoBAqmJxGEzgJ85UhO9TqIXJ1DEW6bUIF0h/vqJJSMeJ/enHdeeE3KC b95aTRQhcAeW55SmHry7PzDjvZFpRcEedSgE9v/MX03XHDNMKhPOq5cF/weIQ8fa7kfduCCayZC4s Q4+eHT/QmSLTNiIIzkDIO9S48KA3p3tuA4C9Tv4UswGBNXm7FRfSAbcSapSZq1ml6LPfyKA6iuasb qyro2OJXyD/ppB9zS7Lhs0B2d99G1w2B6Iv28Ma5P3+eVvnNMmXHbgtoxKB/rj/KD0QraAytxnsAH t6LhqbtU6nFFeFTG5cOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qChaH-003jjg-2l; Fri, 23 Jun 2023 14:16:21 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qChaF-003jhz-1D; Fri, 23 Jun 2023 14:16:20 +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=82rInuCvL9xAeabMebQ9Lh4wrm60BVdO9VOZwhsHwtw=; b=QWr4Mnq42Q5VaRp/cAOAzZoOOE 9ulNjwhn4LJM5YnHEVt7GkdNfeMYYhkcQH95mnd3mZqS8MnPVhehc6JTrnpikd9+hacvu0L8sw9zW y+k8F9Tiky73mEFnvckzb8lwLT1pCFshyCOLANjbLOGVJwsXwcBKTA2rNmq5ziJ2rJ5qVmqHEcyfi zFQlWUkOF0TRR+x4WUtzxLGduvkvTJiVyO7UK94NNsaRDvFHvxozlkAj57g9/+zjdLiY5SPgZoQ/2 3aeXHsfhe3G5dnGtFnQ1IA0llfpH7Hb4D/bNZyq3GfyfjOOfz5MxmgA/W+ispFqXXB8GR3EMgZ9k1 DGAp/lXg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:51774) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qChZw-0005NS-VQ; Fri, 23 Jun 2023 15:16:01 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qChZo-0001X0-LF; Fri, 23 Jun 2023 15:15:52 +0100 Date: Fri, 23 Jun 2023 15:15:52 +0100 From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Belloni , AngeloGioacchino Del Regno , =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= , Claudiu Manoil , Daniel Golle , "David S. Miller" , DENG Qingfang , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Landen Chao , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Matthias Brugger , netdev@vger.kernel.org, Paolo Abeni , Sean Wang , UNGLinuxDriver@microchip.com, Vladimir Oltean Subject: [PATCH RFC net-next 00/14] dsa/88e6xxx/phylink changes after the next merge window Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230623_071619_419179_A8D1C217 X-CRM114-Status: GOOD ( 20.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, This patch series contains the minimum set of patches that I would like to get in for the following merge window. The first four patches are laying the groundwork for converting the mv88e6xxx driver to use phylink PCS support. Patches 5 through 11 perform that conversion. At that point, DSA becomes entirely phylink-legacy free, since all drivers either set the "legacy_pre_march2020" boolean false, or use the legacy adjust_link mechanism and thus don't implement phylink. That then allows patches 12 and 13 which removes all setting of legacy_pre_march2020 from DSA, since it becomes no longer relevant. This leaves the final user of that boolean as mtk_eth_soc, which makes use of state->speed in its mac_config() method which has *always* been against the phylink API documentation, and has never been guaranteed to hold a correct value in this function. Moreover, I consider this to be broken, because it only configures the RGMII clock rate based on state->speed when the interface changes from something non-RGMII to RGMII. So, RGMII is probably rather broken on the SoCs where this code path is used. I have placed a comment in mtk_eth_soc about this, I have asked several times on lists and Cc people about it, but I'm getting nowhere. DTS grepping seems to indicate that there is no board that the mainline kernel supports that would even use this code path. The other issue with mtk_eth_soc's legacy requirement is its implementation of mtk_mac_pcs_get_state(), and this prevents at the moment either getting rid of the mac_pcs_get_state() method from phylink, or marking the driver non-legacy even if we don't care about the RGMII state->speed issue. However, with mtk_eth_soc using phylink_pcs, we can at least kill the old mac_an_restart function, which is what the last patch does. I am not intending to submit this all as a single series; this is merely being sent out as a preview for posting the first batch in maybe three weeks time. In the mean time, it would be great to have testing, particularly with a range of different 88e6xxx switches (I only have a limited subset.) Thanks. drivers/net/dsa/b53/b53_common.c | 6 - drivers/net/dsa/mt7530.c | 6 - drivers/net/dsa/mv88e6xxx/Makefile | 3 + drivers/net/dsa/mv88e6xxx/chip.c | 424 ++---------- drivers/net/dsa/mv88e6xxx/chip.h | 33 +- drivers/net/dsa/mv88e6xxx/pcs-6185.c | 190 ++++++ drivers/net/dsa/mv88e6xxx/pcs-6352.c | 390 +++++++++++ drivers/net/dsa/mv88e6xxx/pcs-639x.c | 898 ++++++++++++++++++++++++++ drivers/net/dsa/mv88e6xxx/port.c | 30 - drivers/net/dsa/mv88e6xxx/serdes.c | 1106 +------------------------------- drivers/net/dsa/mv88e6xxx/serdes.h | 108 +--- drivers/net/dsa/ocelot/felix.c | 6 - drivers/net/dsa/qca/qca8k-8xxx.c | 2 - drivers/net/dsa/sja1105/sja1105_main.c | 6 - drivers/net/phy/mdio_bus.c | 24 +- drivers/net/phy/phylink.c | 132 +++- include/linux/mdio.h | 26 + include/linux/phylink.h | 41 +- include/net/dsa.h | 3 - net/dsa/port.c | 41 -- 20 files changed, 1742 insertions(+), 1733 deletions(-) create mode 100644 drivers/net/dsa/mv88e6xxx/pcs-6185.c create mode 100644 drivers/net/dsa/mv88e6xxx/pcs-6352.c create mode 100644 drivers/net/dsa/mv88e6xxx/pcs-639x.c