From patchwork Tue Nov 23 10:00:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12633825 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 92348C433F5 for ; Tue, 23 Nov 2021 10:03:10 +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:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6bJIA0/yuzey1lG3ZQdBBkrR0cB1Cnfm+u9ajdbgeKA=; b=YOnoApZ8lqLB8i rGWAy9FVbmbVCi7iXitQfhR5PHFwDFatlwEBzY0A5noRD9FHWW1bQRR2t7fCu7vPqbCODYdQ76jrp SfhC45HZMj60RqXwjH4NOUcw3ibMhLgNmZ44QpPddzivooINIYndZlBIgcIn8vDWShIKQAkp/tMjS BW74MDv8Ywjs9Wt0XqeVA8PjSKkD7k3MhxhvZhYbY7W1rrmTvIWX95RMwWWX63I7d43U/K4ZxweRP j/t/nUM8rpSuDX8RMEjYIcKgOEsDNjP0mZZ++aF0IUpVi011WnhM5SOPcksIfj2JphXcyfXJB39XM cSOj2JB0S5WiO9PA+jIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpSdh-001bzO-I6; Tue, 23 Nov 2021 10:03:01 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpSd3-001anJ-K1; Tue, 23 Nov 2021 10:02:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To: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=duXHLomEjDNg78y+Mdk92Vi4EmOn6BUlBnGXhSw1tg4=; b=xQF9OB60AtLiQArSuJ/UXVLd3S 8HjB630S8dHL3e1iQ/Jscga+KObWLqy4D9+HL/3oQresDkBm1uX09HMf8VnIXJcZFLjWoRowtDQEV 3u9DSiCa/DndDWxml5S9roVffTizvr+OUEZJyaxsiZSXl0Jfot8tDtqvmxdyY/0IKN2tjuzMcaDRJ NnjBxAJzd6tag/OKl6yUwGFT2sZ8V8OQg/F7hs0hwmc1tKVy55W7mHBAbSXCTfxxU+sTH9PvMcuq3 vmCfeBK+3YsobU8AiaQihC9YmPUde03omi7I/A80PiN2f8aqd7RvHBBeReYOK5bGbLM7y1n8Cqja6 90OxPBzg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:36034 helo=rmk-PC.armlinux.org.uk) 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 1mpSb1-0007hW-EQ; Tue, 23 Nov 2021 10:00:15 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mpSb0-00BXoP-Dr; Tue, 23 Nov 2021 10:00:14 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Chris Snook , Felix Fietkau , Florian Fainelli , John Crispin , Mark Lee , Matthias Brugger , Michal Simek , Radhey Shyam Pandey , Sean Wang , Vivien Didelot , Vladimir Oltean Cc: Andrew Lunn ,"David S. Miller" , Heiner Kallweit ,Jakub Kicinski , linux-arm-kernel@lists.infradead.org,linux-mediatek@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH RFC net-next 1/8] net: dsa: consolidate phylink creation MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 23 Nov 2021 10:00:14 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211123_020221_700621_F227423A X-CRM114-Status: GOOD ( 13.22 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The code in port.c and slave.c creating the phylink instance is very similar - let's consolidate this into a single function. Signed-off-by: Russell King (Oracle) --- net/dsa/dsa_priv.h | 2 +- net/dsa/port.c | 44 ++++++++++++++++++++++++++++---------------- net/dsa/slave.c | 19 +++---------------- 3 files changed, 32 insertions(+), 33 deletions(-) diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h index a5c9bc7b66c6..3fb2c37c9b88 100644 --- a/net/dsa/dsa_priv.h +++ b/net/dsa/dsa_priv.h @@ -258,13 +258,13 @@ int dsa_port_mrp_add_ring_role(const struct dsa_port *dp, const struct switchdev_obj_ring_role_mrp *mrp); int dsa_port_mrp_del_ring_role(const struct dsa_port *dp, const struct switchdev_obj_ring_role_mrp *mrp); +int dsa_port_phylink_create(struct dsa_port *dp); int dsa_port_link_register_of(struct dsa_port *dp); void dsa_port_link_unregister_of(struct dsa_port *dp); int dsa_port_hsr_join(struct dsa_port *dp, struct net_device *hsr); void dsa_port_hsr_leave(struct dsa_port *dp, struct net_device *hsr); int dsa_port_tag_8021q_vlan_add(struct dsa_port *dp, u16 vid, bool broadcast); void dsa_port_tag_8021q_vlan_del(struct dsa_port *dp, u16 vid, bool broadcast); -extern const struct phylink_mac_ops dsa_port_phylink_mac_ops; static inline bool dsa_port_offloads_bridge_port(struct dsa_port *dp, const struct net_device *dev) diff --git a/net/dsa/port.c b/net/dsa/port.c index f6f12ad2b525..eaa66114924b 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -1072,7 +1072,7 @@ static void dsa_port_phylink_mac_link_up(struct phylink_config *config, speed, duplex, tx_pause, rx_pause); } -const struct phylink_mac_ops dsa_port_phylink_mac_ops = { +static const struct phylink_mac_ops dsa_port_phylink_mac_ops = { .validate = dsa_port_phylink_validate, .mac_pcs_get_state = dsa_port_phylink_mac_pcs_get_state, .mac_config = dsa_port_phylink_mac_config, @@ -1081,6 +1081,30 @@ const struct phylink_mac_ops dsa_port_phylink_mac_ops = { .mac_link_up = dsa_port_phylink_mac_link_up, }; +int dsa_port_phylink_create(struct dsa_port *dp) +{ + struct dsa_switch *ds = dp->ds; + phy_interface_t mode; + int err; + + err = of_get_phy_mode(dp->dn, &mode); + if (err) + mode = PHY_INTERFACE_MODE_NA; + + if (ds->ops->phylink_get_interfaces) + ds->ops->phylink_get_interfaces(ds, dp->index, + dp->pl_config.supported_interfaces); + + dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(dp->dn), + mode, &dsa_port_phylink_mac_ops); + if (IS_ERR(dp->pl)) { + pr_err("error creating PHYLINK: %ld\n", PTR_ERR(dp->pl)); + return PTR_ERR(dp->pl); + } + + return 0; +} + static int dsa_port_setup_phy_of(struct dsa_port *dp, bool enable) { struct dsa_switch *ds = dp->ds; @@ -1157,27 +1181,15 @@ static int dsa_port_phylink_register(struct dsa_port *dp) { struct dsa_switch *ds = dp->ds; struct device_node *port_dn = dp->dn; - phy_interface_t mode; int err; - err = of_get_phy_mode(port_dn, &mode); - if (err) - mode = PHY_INTERFACE_MODE_NA; - dp->pl_config.dev = ds->dev; dp->pl_config.type = PHYLINK_DEV; dp->pl_config.pcs_poll = ds->pcs_poll; - if (ds->ops->phylink_get_interfaces) - ds->ops->phylink_get_interfaces(ds, dp->index, - dp->pl_config.supported_interfaces); - - dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(port_dn), - mode, &dsa_port_phylink_mac_ops); - if (IS_ERR(dp->pl)) { - pr_err("error creating PHYLINK: %ld\n", PTR_ERR(dp->pl)); - return PTR_ERR(dp->pl); - } + err = dsa_port_phylink_create(dp); + if (err) + return err; err = phylink_of_phy_connect(dp->pl, port_dn, 0); if (err && err != -ENODEV) { diff --git a/net/dsa/slave.c b/net/dsa/slave.c index ad61f6bc8886..33b54eadc641 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -1851,14 +1851,9 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev) struct dsa_port *dp = dsa_slave_to_port(slave_dev); struct device_node *port_dn = dp->dn; struct dsa_switch *ds = dp->ds; - phy_interface_t mode; u32 phy_flags = 0; int ret; - ret = of_get_phy_mode(port_dn, &mode); - if (ret) - mode = PHY_INTERFACE_MODE_NA; - dp->pl_config.dev = &slave_dev->dev; dp->pl_config.type = PHYLINK_NETDEV; @@ -1871,17 +1866,9 @@ static int dsa_slave_phy_setup(struct net_device *slave_dev) dp->pl_config.poll_fixed_state = true; } - if (ds->ops->phylink_get_interfaces) - ds->ops->phylink_get_interfaces(ds, dp->index, - dp->pl_config.supported_interfaces); - - dp->pl = phylink_create(&dp->pl_config, of_fwnode_handle(port_dn), mode, - &dsa_port_phylink_mac_ops); - if (IS_ERR(dp->pl)) { - netdev_err(slave_dev, - "error creating PHYLINK: %ld\n", PTR_ERR(dp->pl)); - return PTR_ERR(dp->pl); - } + ret = dsa_port_phylink_create(dp); + if (ret) + return ret; if (ds->ops->get_phy_flags) phy_flags = ds->ops->get_phy_flags(ds, dp->index); From patchwork Tue Nov 23 10:00:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12633827 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 D1617C433EF for ; Tue, 23 Nov 2021 10:03:31 +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:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=o0ByuR5rhCRsoT2mOsbAnqP5pdSjzbSWrEd2TDw4nzo=; b=q0GACUD0NJXpa+ EhzeGVVUYuNp23JG6XXLSPOUC4lDL2gX62YiqIWH7AlnvFECdm+9WQt2saRrQMG7JQ0uWsX1pjqZw 9QpqWjzqvJO9C7C3yr1FwnA2dxhN9zCyAMJVjcsvUl5LkNkcCQHKRp+q2iwdc8jgp9vbwV53mJjPl zSz7ROx9qfNRMO213xa94z0k82xRKGP6tYyb43Awx1K44roqygqTf7pT4/HTszRMBwwJ5BvONhaoR VuyQD4EPav0hb7YMwrV8DjDzik8mfKFHi+tnIM5/O+vjtzGLiga5XkvDVzhgF4ILIr+NTpJqvpq+D FkMu9jLUrlpRfPNZ3V2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpSe3-001cB0-J4; Tue, 23 Nov 2021 10:03:23 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpSd6-001aoP-JR; Tue, 23 Nov 2021 10:02:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To: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=fTcvLpPz/LI1BZa+3R5EayZc6ONehYohUJqWm4x8FEc=; b=fMwWV7P6zDvruLM/U/VTSCMKe5 8HRTNuJolzo5qpf89sdHgskdaGGxqQqy8Sz5VlDvjsRi/iATHQO6VJWkZxYW9YSkiVisHrYnRmbV2 qVAwjHtxpneXvU4CEH8ljxlVq8x+Vl31vV3G4qqpVxLQ7jAr73oil6nSQMhcUoJstAQzcIXkcyKS7 ML+ggqTKYQhkjxBKqVaRwS6vYxI9cuEBv+zAu2qi9MNcslTnoD2wbib7Q86lOCbNC1rIOIq5fdJWL Kxwc+4KGfbVXw0k7lvv/enxL53hDPKMWI8t+EYqDOCVxKfvb78z5O31L9cwacJyaCHHR2gYxmekoS QZQIRgeA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:36036 helo=rmk-PC.armlinux.org.uk) 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 1mpSb6-0007hi-0r; Tue, 23 Nov 2021 10:00:20 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mpSb5-00BXoV-IG; Tue, 23 Nov 2021 10:00:19 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Chris Snook , Felix Fietkau , Florian Fainelli , John Crispin , Mark Lee , Matthias Brugger , Michal Simek , Radhey Shyam Pandey , Sean Wang , Vivien Didelot , Vladimir Oltean Cc: Andrew Lunn , "David S. Miller" , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH RFC net-next 2/8] net: phylink: add legacy_pre_march2020 indicator MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 23 Nov 2021 10:00:19 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211123_020224_672117_30C96064 X-CRM114-Status: GOOD ( 11.59 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Add a boolean to phylink_config to indicate whether a driver has not been updated for the changes in commit 7cceb599d15d ("net: phylink: avoid mac_config calls"), and thus are reliant on the old behaviour. We were keying this behaviour on the presence of a PCS, but this becomes an unreliable indicator when making PCS optional. Hence, we use a flag instead. Signed-off-by: Russell King (Oracle) --- include/linux/phylink.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/phylink.h b/include/linux/phylink.h index 01224235df0f..d005b8e36048 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -84,6 +84,8 @@ enum phylink_op_type { * struct phylink_config - PHYLINK configuration structure * @dev: a pointer to a struct device associated with the MAC * @type: operation type of PHYLINK instance + * @legacy_pre_march2020: driver has not been updated for March 2020 updates + * (See commit 7cceb599d15d ("net: phylink: avoid mac_config calls") * @pcs_poll: MAC PCS cannot provide link change interrupt * @poll_fixed_state: if true, starts link_poll, * if MAC link is at %MLO_AN_FIXED mode. @@ -97,6 +99,7 @@ enum phylink_op_type { struct phylink_config { struct device *dev; enum phylink_op_type type; + bool legacy_pre_march2020; bool pcs_poll; bool poll_fixed_state; bool ovr_an_inband; From patchwork Tue Nov 23 10:00:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12633829 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 9C980C433F5 for ; Tue, 23 Nov 2021 10:04:11 +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:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l83a6q/zZUDbfVh0PBXf53aDnwNcqHEUlUbAHqbYyjc=; b=NZiNtZSpHyWVxR Wjws+JPkzuFyYwy1IASR28/ak+355ZEq6SRo4SaUEcz0oNQX/BOSE7Bs/WdbiizjnL9btNntxclG/ b0kyyxhpWiLRYNZIRK3pZAtKydFauqdGGMYvYe8hRylB1Tizk0GuuToMmphvN+Hei/AaW5jdeW8S1 VDv9/fDrjxKXbEB0gC9W1wJlt/2cN9TI0jmYpAV91ps2HdS8fan1FZSjVO/WpmWg/Pk0bNYKwzRsn 8MzQ1qsIN5CavoSDonKmKDcUXnYtl+hG2CaMb9zhbMWI8JlddhCNnuh+3vEtihW19DK87JIlWsF1+ 6rolXvNjY8H0B7sqw46A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpSei-001cWM-2I; Tue, 23 Nov 2021 10:04:04 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpSdC-001apg-Cq; Tue, 23 Nov 2021 10:02:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To: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=qTGDaNQC8dzlK7EnxMVipMoSGhh3jfdSBn/mQjw1NJw=; b=vQyZmHOFMEP749C7l9bAHqV755 qedpKIxajNJc8B0BMyYjGhimcCF8zEEkbA/OxagFs1zEfeDL2wbV6CSSu61t5AJPS2VdgGiq3g7tY kUxqts6yexqEgyWmYSvUHcIvwdt9zqG4rMF0n+KawC+/8uZB8vh1dV2BkDAEuXlXgY2N4jNv7duH5 hmUI0dNg8HEel2ERGrtbi21OWgjq2Y5v04sn+f/VvP/dzmciuovcxBhJp+93J4Tfwcwz8ntAzMqVP Re/a8oOShJ1X+BWoCz/5LL4SJwS57rhHrNQ9jt7/tLYXvt6Q8900hNU63+slzlplRZf4QLInu8wge w4rUeHpw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:36038 helo=rmk-PC.armlinux.org.uk) 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 1mpSbB-0007i6-5F; Tue, 23 Nov 2021 10:00:25 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mpSbA-00BXob-MG; Tue, 23 Nov 2021 10:00:24 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Chris Snook , Felix Fietkau , Florian Fainelli , John Crispin , Mark Lee , Matthias Brugger , Michal Simek , Radhey Shyam Pandey , Sean Wang , Vivien Didelot , Vladimir Oltean Cc: Andrew Lunn ,"David S. Miller" , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH RFC net-next 3/8] net: dsa: mark DSA phylink as legacy_pre_march2020 MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 23 Nov 2021 10:00:24 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211123_020230_489634_38E23A06 X-CRM114-Status: UNSURE ( 9.32 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org As DSA doesn't make use of the PCS support, but it does have PCS, it must be marked as a pre-March 2020 driver to maintain the old phylink behaviour. Signed-off-by: Russell King (Oracle) --- net/dsa/port.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/dsa/port.c b/net/dsa/port.c index eaa66114924b..cfb48dc57f73 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -1091,6 +1091,13 @@ int dsa_port_phylink_create(struct dsa_port *dp) if (err) mode = PHY_INTERFACE_MODE_NA; + /* Presence of phylink_mac_link_state or phylink_mac_an_restart is + * an indicator of a legacy phylink driver. + */ + if (ds->ops->phylink_mac_link_state || + ds->ops->phylink_mac_an_restart) + dp->pl_config.legacy_pre_march2020 = true; + if (ds->ops->phylink_get_interfaces) ds->ops->phylink_get_interfaces(ds, dp->index, dp->pl_config.supported_interfaces); From patchwork Tue Nov 23 10:00:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12633831 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 7729FC433EF for ; Tue, 23 Nov 2021 10:04:42 +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:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Cxr9fWceLkGPcYfxEhCKEDQZAeSb94u/SLK4USTJRC0=; b=hJKCrtiGl3nUWF WqB616sTqaViQVQWjecrGdUaySFvMhzxnTa0B+iMN9YTmwBw4sRGX4x+Tgo9xd16pKH1RsxVrT7+0 o0j/dX5LHOGyz8z8tFImGybcJWD/5qfLBbe3OS2yq8GnMo5kmzdmtihoSFXMi7AKALgb9BN4+75Gl tfpd8PZZJHS9MeRbHWpvIYvLxwPqkHA1Uvz8H/1KLsWEQ1iKhAe0CDI5vT6Kr+UZUtz+J6Gab8hUx c0qeiv8S7iEaC5BUhz7bbhShZrXXHlwlahCT+Ur0CEzS0qki7CLGRc93BNWmjNVsUAcZsNVILCRNI /IQN63Akv1kPabPJgsSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpSfD-001cmV-5D; Tue, 23 Nov 2021 10:04:35 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpSdG-001aqz-Nd; Tue, 23 Nov 2021 10:02:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To: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=bPIJgLfiVHs9dWh/I88pAMSJy+rMDL+vIYEYo3gmZ14=; b=0J2qxzsH7fGBBtlRugWWBIYhnk P0fwJie7lLGJyIb6LgwFkOnpK+DGNb4Gjv2BxjMtWR2wmL4XMRGrZzA2bbpXq0BgfwmbA+aNpYZWx 9H9RkZSWl3od6wTSWftgZPciNiratuPQDwNQ65VQvb/gTTouXd3NcUt4ZWw9KgJLtA3fHDYcgkdVb CfLRjKOGqsTmocCssXjYnlkusAgSfWSdMC8/MCriVwZgqOUpcNzF/xKgsVKsblCWSkfA6w8TlV8M2 dyQEX8cCgom8JixGqX/GZR4QbiAZkUakpyNUbpQZluTSMhes8TByPg9MBML3opBNizZYpBmvbS8qC lk9YGM7Q==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:36040 helo=rmk-PC.armlinux.org.uk) 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 1mpSbG-0007iN-9X; Tue, 23 Nov 2021 10:00:30 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mpSbF-00BXoh-Qb; Tue, 23 Nov 2021 10:00:29 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Chris Snook , Felix Fietkau , Florian Fainelli , John Crispin , Mark Lee , Matthias Brugger , Michal Simek , Radhey Shyam Pandey , Sean Wang , Vivien Didelot , Vladimir Oltean Cc: Andrew Lunn ,"David S. Miller" , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH RFC net-next 4/8] net: mtk_eth_soc: mark as a legacy_pre_march2020 driver MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 23 Nov 2021 10:00:29 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211123_020234_805912_1F42007A X-CRM114-Status: UNSURE ( 9.63 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org mtk_eth_soc has not been updated for commit 7cceb599d15d ("net: phylink: avoid mac_config calls"), so mark it as a legacy driver. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index de4152e2e3e4..a068cf5c970f 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -2923,6 +2923,10 @@ static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np) mac->phylink_config.dev = ð->netdev[id]->dev; mac->phylink_config.type = PHYLINK_NETDEV; + /* This driver makes use of state->speed/state->duplex in + * mac_config + */ + mac->phylink_config.legacy_pre_march2020 = true; mac->phylink_config.mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE | MAC_10 | MAC_100 | MAC_1000 | MAC_2500FD; From patchwork Tue Nov 23 10:00:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12633817 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 4DFABC433EF for ; Tue, 23 Nov 2021 10:01:00 +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:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=V/affAkTmaaiTTVyJOeqDcs82skEn9aypgF5FyPYUhQ=; b=uqP0f6wlVdpQJU l3REv0Srn/uvjuZT22FL3mU6fPsnBaJ7M/WDReFCNK3BB7xZX9WwZjGQ3snIb2HvECBTHLGjMV+Im zhi4m+LRLAfzBvOLw0dfSQFE24Mu0RQOuAw0MiGnwA7INMAzJ8WcI2JTFUBs1qynWUYil9CcqFCZd Gi4BnIwLb8qRkLoZxh6WLux14MgGJdY5RYi7dXl3nrbC1Tkeg9k8LiKfUguMjnLNjLJL8LFoT52a0 OH2kUei8xXzL9iS6KjdR+cFKup/M6p4E8PqN8O6sPv+koFctuJRL2zH9BtT8g9///3q3HGYLYmefx smWFSDCfXYRaT72w22Zw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpSbd-001awg-I9; Tue, 23 Nov 2021 10:00:53 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpSbQ-001as8-Ac; Tue, 23 Nov 2021 10:00:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To: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=zGyMLwmozIGa5HKsKLxD/S/r9K2lopGCdgR2w8ENWEg=; b=Znx4acxXz0is16s2+/4xzxhLCN zoU22FidEK2K5oR9YW6ayPtd14p+wWQB4mHjq86r6sjM6FjMF+4AW0c2JfUWmZdYh7Sr8/V1s/cu2 VvxYd3JudKmYfdmCcbYUFB8m12qImxEJQXZZ0mejJWnCku+/KYFKi/PMVJvRiXDp6W79I+A0vi0j+ rgkG5+rv534rYDMBQTNpYJUPORWYk4DegC2BSztLNcABw6wgJY06tsgeHb0/cFhzUiQ8BNDdWFbq6 HCW3DJo4e+uRJ8yEgMrVrts33zRyzRvl1QBbtgbAUWVYjeThjodIWFVPQMf0sUjZPwKOtPjY+4lN+ ABfjaY6A==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:36046 helo=rmk-PC.armlinux.org.uk) 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 1mpSbL-0007if-Cg; Tue, 23 Nov 2021 10:00:35 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mpSbK-00BXoo-UE; Tue, 23 Nov 2021 10:00:34 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Chris Snook , Felix Fietkau , Florian Fainelli , John Crispin , Mark Lee , Matthias Brugger , Michal Simek , Radhey Shyam Pandey , Sean Wang , Vivien Didelot , Vladimir Oltean Cc: Andrew Lunn , "David S. Miller" , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH RFC net-next 5/8] net: ag71xx: mark as a legacy_pre_march2020 phylink driver MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 23 Nov 2021 10:00:34 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211123_020040_393098_0D4FFA5F X-CRM114-Status: UNSURE ( 8.93 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org ag71xx has a PCS, but does not make use of the phylink PCS support. Mark it was a pre-March 2020 driver. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/atheros/ag71xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c index ff924f06581e..89b6a8bfee43 100644 --- a/drivers/net/ethernet/atheros/ag71xx.c +++ b/drivers/net/ethernet/atheros/ag71xx.c @@ -1111,6 +1111,7 @@ static int ag71xx_phylink_setup(struct ag71xx *ag) ag->phylink_config.dev = &ag->ndev->dev; ag->phylink_config.type = PHYLINK_NETDEV; + ag->phylink_config.legacy_pre_march2020 = true; ag->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE | MAC_10 | MAC_100 | MAC_1000FD; From patchwork Tue Nov 23 10:00:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12633819 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 B1F46C433EF for ; Tue, 23 Nov 2021 10:01:15 +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:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lT61V902Js7oVkdRj2X4nWaE5g1GUjtX545zNXhcBmI=; b=0YytlhhE7xAt5k 7jqykTUv0660Yu8/8uCnd/BxtexEY4i/t+VlDIx5sTSUi6z9Gi6O5zSFpkcrABZvZIDfNqo9CgXLo hguLTDARnQLHVg2dp4ZMEvzIA+5lKgOw2yeWd74Pm3slG8J5psoXjHGlZSQ4p4uTsw1CfBWTAZV4J F45kcWO+dVMoTl2EJRxBVk0r3aNOi+8i2GOighFzVOZkwYReRPpEvnji/FxOXG2f0+ixivJghv5sr BfjrcDMAdAwbg+5kWJks/ysjvUlUyvFoqYCgW9Dvye5ZUu9//0r9igfzgZ9aBDEvZu22USqfC1RAB X1qoG9uCfMh0WzIjY1hQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpSbs-001b1q-Ag; Tue, 23 Nov 2021 10:01:08 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpSbT-001atq-C8; Tue, 23 Nov 2021 10:00:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To: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=vI3ymyYAKFYvel9BMTNK2PdmqBTT7h36ITGdk3iia7s=; b=KsWTN0MqPdM02Z77p402LRZG8X EWbuvDDUlK5CJtbC+XqIBTCkgbMDGYvNPZmP2D9dCnm1p2Eazb7H+q3SwXw6SnOONrFLzzcnd+w/T tSRGdCt6xC1TyCCIJLxZhV4kBjAaCiMyn+/FPbk86KND98TL454ZBOl9w4ArDZnBRC3ujiTfvqBR9 bWkxVkB0xE446Fr7cI4st+Prd2em+xv6m+yYLkj64rJtkh4yQo7ksXxk5oRI/O9ITZy1pKBt4G3ci WbINXxSkNHwjciIJdRulNro28WTZNKOPmXqXJ6sXY+KWTocfj5Kwnw0tlXIsi9alueOvtOfnES5se C985pGyA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:36048 helo=rmk-PC.armlinux.org.uk) 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 1mpSbQ-0007iy-H4; Tue, 23 Nov 2021 10:00:40 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mpSbQ-00BXou-1d; Tue, 23 Nov 2021 10:00:40 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Chris Snook , Felix Fietkau , Florian Fainelli , John Crispin , Mark Lee , Matthias Brugger , Michal Simek , Radhey Shyam Pandey , Sean Wang , Vivien Didelot , Vladimir Oltean Cc: Andrew Lunn , "David S. Miller" , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH RFC net-next 6/8] net: axienet: mark as a legacy_pre_march2020 phylink driver MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 23 Nov 2021 10:00:40 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211123_020043_455640_BB2F5F69 X-CRM114-Status: UNSURE ( 9.48 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org axienet has a PCS, but does not make use of the phylink PCS support. Mark it was a pre-March 2020 driver. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index e39356364f33..23ac353b35fe 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -2051,6 +2051,7 @@ static int axienet_probe(struct platform_device *pdev) lp->phylink_config.dev = &ndev->dev; lp->phylink_config.type = PHYLINK_NETDEV; + lp->phylink_config.legacy_pre_march2020 = true; lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE | MAC_10FD | MAC_100FD | MAC_1000FD; From patchwork Tue Nov 23 10:00:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12633821 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 5DFE4C433EF for ; Tue, 23 Nov 2021 10:01:30 +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:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wGD1MnQSIicGBg4Ei7TIbTBb42G3KAkwDIhVmfNyf+w=; b=2+IGg4NDk5zGbM MLVHYn/Ebgdk8ls8F5l56RzXm4QvQr7O++YFfSx4ewxz1DmdMCe+CXKqUT8EFLDH0dKntaifmIji9 lytbQ4p3uAb1o9FGdFrha4/BReKAOxcOL+Ktarv0afLjVlye64iW2EpVuxsVAQzm6S7j0lU8Tb9UR NpbsSrtIw/GJGnrr52C3WGrR/2mOosoIg9vFMDTzRhIdiyyvoO1PlL25Hec0ig1F1nRmTy2pVmMwg LVy2Fcn5+KioRNK6v7spvfexznpcqMf86L99k1vQX9PgH2tRGJnFxVCeFXNSDN9bQpZ3JNgxD8xK+ rZLhOQliI3XHb3VYEZXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpSc7-001b7V-CI; Tue, 23 Nov 2021 10:01:23 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpSbY-001avH-HR; Tue, 23 Nov 2021 10:00:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To: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=MOF/CQ8LQ/bDyhO5wnHP0aCMGCUGEoCfExaTjBY+3Os=; b=YP9Sc7C8wM1jmvB6i3gl7i7ng4 ZtQd03DSASH0V8Lpn/sLNHDpSlfTO+UK8xK30NdNpn5Xax22s5C+oBJGaSNcA3M5xYuKoHOd1iK/5 w3Bq8yLpFKhmhPC9p5e7KElAtXLgavZ+LM3Ne5gvrhQOqq5AsvdQKjYxByuwoZjbflGDTNLeADm73 KA87M/LYTbXHjXlXJ34IcJawA/yOoUJ3viBm45TlpDKaQrbn75jF0tT0rd1Z0YyEwI3ouD8Tuhul9 AduLp4L4aMPHlJ/7N5fVlD9MYkpZc/LAFYIZhP/LeVH8DTLC8N0ylepvoWjY5AV31HJpSrbQHnW/a DOOxwMcQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:36052 helo=rmk-PC.armlinux.org.uk) 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 1mpSbV-0007jG-Ka; Tue, 23 Nov 2021 10:00:45 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mpSbV-00BXp0-5d; Tue, 23 Nov 2021 10:00:45 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Chris Snook , Felix Fietkau , Florian Fainelli , John Crispin , Mark Lee , Matthias Brugger , Michal Simek , Radhey Shyam Pandey , Sean Wang , Vivien Didelot , Vladimir Oltean Cc: Andrew Lunn , "David S. Miller" , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH RFC net-next 7/8] net: phylink: use legacy_pre_march2020 MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 23 Nov 2021 10:00:45 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211123_020048_611554_746F2E6E X-CRM114-Status: GOOD ( 20.18 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Use the legacy flag to indicate whether we should operate in legacy mode. This allows us to stop using the presence of a PCS as an indicator to the age of the phylink user, and make PCS presence optional. Legacy mode involves: 1) calling mac_config() whenever the link comes up 2) calling mac_config() whenever the inband advertisement changes, possibly followed by a call to mac_an_restart() 3) making use of mac_an_restart() 4) making use of mac_pcs_get_state() All the above functionality was moved to a seperate "PCS" block of operations in March 2020. Update the documents to indicate that the differences that this flag makes. Signed-off-by: Russell King (Oracle) --- drivers/net/phy/phylink.c | 12 ++++++------ include/linux/phylink.h | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 3603c024109a..a935655c39c0 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -742,7 +742,7 @@ static void phylink_mac_pcs_an_restart(struct phylink *pl) phylink_autoneg_inband(pl->cur_link_an_mode)) { if (pl->pcs_ops) pl->pcs_ops->pcs_an_restart(pl->pcs); - else + else if (pl->config->legacy_pre_march2020) pl->mac_ops->mac_an_restart(pl->config); } } @@ -803,7 +803,7 @@ static int phylink_change_inband_advert(struct phylink *pl) if (test_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state)) return 0; - if (!pl->pcs_ops) { + if (!pl->pcs_ops && pl->config->legacy_pre_march2020) { /* Legacy method */ phylink_mac_config(pl, &pl->link_config); phylink_mac_pcs_an_restart(pl); @@ -854,7 +854,8 @@ static void phylink_mac_pcs_get_state(struct phylink *pl, if (pl->pcs_ops) pl->pcs_ops->pcs_get_state(pl->pcs, state); - else if (pl->mac_ops->mac_pcs_get_state) + else if (pl->mac_ops->mac_pcs_get_state && + pl->config->legacy_pre_march2020) pl->mac_ops->mac_pcs_get_state(pl->config, state); else state->link = 0; @@ -1024,12 +1025,11 @@ static void phylink_resolve(struct work_struct *w) } phylink_major_config(pl, false, &link_state); pl->link_config.interface = link_state.interface; - } else if (!pl->pcs_ops) { + } else if (!pl->pcs_ops && pl->config->legacy_pre_march2020) { /* The interface remains unchanged, only the speed, * duplex or pause settings have changed. Call the * old mac_config() method to configure the MAC/PCS - * only if we do not have a PCS installed (an - * unconverted user.) + * only if we do not have a legacy MAC driver. */ phylink_mac_config(pl, &link_state); } diff --git a/include/linux/phylink.h b/include/linux/phylink.h index d005b8e36048..a2f266cc3442 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -190,6 +190,10 @@ void validate(struct phylink_config *config, unsigned long *supported, * negotiation completion state in @state->an_complete, and link up state * in @state->link. If possible, @state->lp_advertising should also be * populated. + * + * Note: This is a legacy method. This function will not be called unless + * legacy_pre_march2020 is set in &struct phylink_config and there is no + * PCS attached. */ void mac_pcs_get_state(struct phylink_config *config, struct phylink_link_state *state); @@ -230,6 +234,15 @@ int mac_prepare(struct phylink_config *config, unsigned int mode, * guaranteed to be correct, and so any mac_config() implementation must * never reference these fields. * + * Note: For legacy March 2020 drivers (drivers with legacy_pre_march2020 set + * in their &phylnk_config and which don't have a PCS), this function will be + * called on each link up event, and to also change the in-band advert. For + * non-legacy drivers, it will only be called to reconfigure the MAC for a + * "major" change in e.g. interface mode. It will not be called for changes + * in speed, duplex or pause modes or to change the in-band advertisement. + * In any case, it is strongly preferred that speed, duplex and pause settings + * are handled in the mac_link_up() method and not in this method. + * * (this requires a rewrite - please refer to mac_link_up() for situations * where the PCS and MAC are not tightly integrated.) * @@ -314,6 +327,10 @@ int mac_finish(struct phylink_config *config, unsigned int mode, /** * mac_an_restart() - restart 802.3z BaseX autonegotiation * @config: a pointer to a &struct phylink_config. + * + * Note: This is a legacy method. This function will not be called unless + * legacy_pre_march2020 is set in &struct phylink_config and there is no + * PCS attached. */ void mac_an_restart(struct phylink_config *config); From patchwork Tue Nov 23 10:00:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 12633823 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 4DF3DC433F5 for ; Tue, 23 Nov 2021 10:01:53 +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:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SeYI09hHvI9lZyTSep+mkuL6JQ55atANtspV5uLKG6Q=; b=AwdceuZcY6I828 n0+5p6eIihNPrwhXqdbEelRdRdAPZnRS54pguG5I05BP6ZeV99+SWtQB5PZuLaS5T5yG3KgiP04nu C9b7ScDDUVgMpf03U1vqehWIHpAvYQoGHJD7qe9jwHvNev1keV7uKP3ow6xlZQYYGbSOATsNwDsxW 3rqGzzA+D7Zf2zfyTgH45WUWc54ZIgULqZ0dhbIBuBPYV1ajnvExENjmG51b2WhseIJeEJ/yNeW0F RVONVyxQSd/Y5nUJHLs1QU5Dj4/Yvkb6YaOSsJPEbz1GZroPE9LUGRPXToq7wz9Hh/RDHg/VUClhC xmfXrMpw9q0SuX0b02ZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpScU-001bIA-5Y; Tue, 23 Nov 2021 10:01:46 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpSbd-001awW-Nl; Tue, 23 Nov 2021 10:00:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To: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=4XNr7BR/5TNI3l9M9GhQTw+9AcyHIzcldXrTiciICEw=; b=jtOBoFyYnUmDSM0C8Gihatnao6 TgqKkjPtCU/0kY0uDkGtR2xUUpuZw6hVB8DqU5UEwVddwdE9HXIkjXDjEszFHCTaON4CA4M1Qgde5 8KVaRHKIPeh+I44LXgCFtpCa/cWvz7I0l91zc51+svkQ8GxyhK+nzalacD6KftHgmIrSTT6ozgyJF cbu/pKRjcF8XSRRs0XPZE3+h8iC8oDOuEvAI4VN18qsx2qmyNd6pbZpl/dfd7gVi6k+g/H7RcfCa3 TeC5Co3htPtyuk/pd5QFiJeSlEarIotL2OPlf2uE9Aly6X5NlbG23dPFt6QqDeiQp7t9/HsofV5TB LICt3ikQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:36056 helo=rmk-PC.armlinux.org.uk) 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 1mpSba-0007jX-Oe; Tue, 23 Nov 2021 10:00:50 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mpSba-00BXp6-9e; Tue, 23 Nov 2021 10:00:50 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Chris Snook , Felix Fietkau , Florian Fainelli , John Crispin , Mark Lee , Matthias Brugger , Michal Simek , Radhey Shyam Pandey , Sean Wang , Vivien Didelot , Vladimir Oltean Cc: Andrew Lunn , "David S. Miller" , Heiner Kallweit , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, netdev@vger.kernel.org Subject: [PATCH RFC net-next 8/8] net: phylink: allow PCS to be removed MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 23 Nov 2021 10:00:50 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211123_020053_804425_A202713D X-CRM114-Status: GOOD ( 15.09 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Allow phylink_set_pcs() to be called with a NULL pcs argument to remove the PCS from phylink. This is only supported on non-legacy drivers where doing so will have no effect on the mac_config() calling behaviour. Signed-off-by: Russell King (Oracle) --- drivers/net/phy/phylink.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index a935655c39c0..9f0f0e0aad55 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1196,15 +1196,25 @@ EXPORT_SYMBOL_GPL(phylink_create); * in mac_prepare() or mac_config() methods if it is desired to dynamically * change the PCS. * - * Please note that there are behavioural changes with the mac_config() - * callback if a PCS is present (denoting a newer setup) so removing a PCS - * is not supported, and if a PCS is going to be used, it must be registered - * by calling phylink_set_pcs() at the latest in the first mac_config() call. + * Please note that for legacy phylink users, there are behavioural changes + * with the mac_config() callback if a PCS is present (denoting a newer setup) + * so removing a PCS is not supported. If a PCS is going to be used, it must + * be registered by calling phylink_set_pcs() at the latest in the first + * mac_config() call. + * + * For modern drivers, this may be called with a NULL pcs argument to + * disconnect the PCS from phylink. */ void phylink_set_pcs(struct phylink *pl, struct phylink_pcs *pcs) { + if (pl->config->legacy_pre_march2020 && pl->pcs && !pcs) { + phylink_warn(pl, + "Removing PCS is not supported in a legacy driver"); + return; + } + pl->pcs = pcs; - pl->pcs_ops = pcs->ops; + pl->pcs_ops = pcs ? pcs->ops : NULL; } EXPORT_SYMBOL_GPL(phylink_set_pcs);