From patchwork Fri Jan 3 11:16:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13925496 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 16B5CE77188 for ; Fri, 3 Jan 2025 11:19: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date: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-Owner; bh=mHO73eZ4Zyam8xJy0OuivfQ5bgy3B7zgOoSDsnku8tY=; b=M+FIXj29bl9jqnT3C2DgWGeFSc 5lVqN7vpZ8rtAmFot7ucEvbqaxUiqe5xrT8qmfY0Kuz9yZSEH8ny1ps6zs505KBJ13YYVXS3Tay9T aQb1JQoxq/8qXvpSHu6zhWvdcF4nn8AqKCKs9xSKHdFqakW4GNjItiRaf+vM98fpQWfT5x/CZ/Y5G wu1hRY0LXA3c2M0fC9WlRs0P/e30yXtmroH81gd31BwTE0EGHFgJSas+3En9OVFL6WTMVkcR0v/o0 vSK5UvdE09tFTRLIsrG6i0nqeYhQ7G3l15CSrLqe2nn8FO0o/l1BDofz6SLIp5DnngStcJiHa4MBU tH+wGJXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTfhj-0000000Coal-0nz9; Fri, 03 Jan 2025 11:18:59 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTffd-0000000Co4T-1sA8; Fri, 03 Jan 2025 11:16: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=mHO73eZ4Zyam8xJy0OuivfQ5bgy3B7zgOoSDsnku8tY=; b=k+Yvh/tL2iCshIm06FH3fLQiHp 23biTiZNQUVZ6llbZgdfWBYIVvYNZTGT7mlsLiU/wKJmO62waJeX/NpVSUkVlBHHeZK6dKWl9omyf Du6vlY/iaURiMJu/aFwv2OcdTcJB/ibt5w/SstS9kB5DUH9jbaeCkc58+Ne8xfSHo30nVnoErlsBd VHgsL8GrnFcboYNuyao/a4ZqWr8XMogZIsLxDZOrGJWiueWrXGNE+GaYBRt5PhPRNPrkKM8sCldYL lXJEraFGCM6EScJABIkeAgbXHr4f0b1uqzAfHa1rKHhXZWk2IBwj5+16Yyr6pqDYJ9LuLwBXbFk1R q2a59OFQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:55396 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.96) (envelope-from ) id 1tTffN-00030A-2o; Fri, 03 Jan 2025 11:16:34 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tTffL-007RoD-1Y; Fri, 03 Jan 2025 11:16:31 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexander Couzens , Alexandre Torgue , Andrew Lunn , AngeloGioacchino Del Regno , Daniel Golle , "David S. Miller" , Eric Dumazet , Ioana Ciornei , Jakub Kicinski , Jose Abreu , Jose Abreu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Matthias Brugger , Maxime Chevallier , Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 1/6] net: phylink: add support for PCS supported_interfaces bitmap MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 03 Jan 2025 11:16:31 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_031649_493909_5205F332 X-CRM114-Status: GOOD ( 16.80 ) 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 support for the PCS to specify which interfaces it supports, which can be used by MAC drivers to build the main supported_interfaces bitmap. Phylink also validates that the PCS returned by the MAC driver supports the interface that the MAC was asked for. An empty supported_interfaces bitmap from the PCS indicates that it does not provide this information, and we handle that appropriately. Reviewed-by: Maxime Chevallier Signed-off-by: Russell King (Oracle) --- drivers/net/phy/phylink.c | 11 +++++++++++ include/linux/phylink.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 6d50c2fdb190..31754d5fd659 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -691,6 +691,17 @@ static int phylink_validate_mac_and_pcs(struct phylink *pl, return -EINVAL; } + /* Ensure that this PCS supports the interface which the MAC + * returned it for. It is an error for the MAC to return a PCS + * that does not support the interface mode. + */ + if (!phy_interface_empty(pcs->supported_interfaces) && + !test_bit(state->interface, pcs->supported_interfaces)) { + phylink_err(pl, "MAC returned PCS which does not support %s\n", + phy_modes(state->interface)); + return -EINVAL; + } + /* Validate the link parameters with the PCS */ if (pcs->ops->pcs_validate) { ret = pcs->ops->pcs_validate(pcs, supported, state); diff --git a/include/linux/phylink.h b/include/linux/phylink.h index 5462cc6a37dc..4b7a20620b49 100644 --- a/include/linux/phylink.h +++ b/include/linux/phylink.h @@ -393,6 +393,8 @@ struct phylink_pcs_ops; /** * struct phylink_pcs - PHYLINK PCS instance + * @supported_interfaces: describing which PHY_INTERFACE_MODE_xxx + * are supported by this PCS. * @ops: a pointer to the &struct phylink_pcs_ops structure * @phylink: pointer to &struct phylink_config * @neg_mode: provide PCS neg mode via "mode" argument @@ -409,6 +411,7 @@ struct phylink_pcs_ops; * the PCS driver. */ struct phylink_pcs { + DECLARE_PHY_INTERFACE_MASK(supported_interfaces); const struct phylink_pcs_ops *ops; struct phylink *phylink; bool neg_mode; From patchwork Fri Jan 3 11:16:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13925507 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 E7A92E77188 for ; Fri, 3 Jan 2025 11:20:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date: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-Owner; bh=IZCni5EAPNv32fyYrhVKtEvOmSsbHmeJ2aH/4kersBw=; b=qqYUfs7VkmOGcjzsFvTnk/HdCp m4auDsaFy5GEgbJ02r/8/lVghBLPQO04HX8hNCmhtvFK5g2RsapT6nhHm/xyV9SbnDp6d3JBUjcdF 7iAzSSI7BeRKQVpwimtk1zASREF7zmKvrQNtbpg4qisNE0DrBQoc/RfORLaVbD+PMtKRKCLUVZQF6 FblCa/nUc5QTl2emDk4687e80CsKd6rlb0Ljtvtmj5xXVXsSyFhkbXe5t4t7iDTr+GfwqhJvqBqX6 jup6IgZieoHW0Ys95fKpIj8J+3IuzFZrI4jvieXi0vhQwrHV3ufuuZcxoa6rLxds20/0JFBxM/ETa YHvdVwGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTfiv-0000000ColQ-0eMd; Fri, 03 Jan 2025 11:20:13 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTffg-0000000Co5d-1Asl; Fri, 03 Jan 2025 11:16:53 +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=IZCni5EAPNv32fyYrhVKtEvOmSsbHmeJ2aH/4kersBw=; b=MUzEwKxwl2kfzS6jbMSOKhZP7/ tSLBVm0qPr+LmI6AZhac7wX95dFIehy7HllBfegUp5rPvNYDHJv+V6i2oxQqJQwb1IKJU31FSynQX yzUSBIKjmKv6lHJwTteE2lE9+xudM8nlUnyzYPtpyIcKiCHsvqghEwO0V/eG6smtEMEpnrshLFB0a z2k4gfZGGSj/oxVwUvpE3Xvlz3fpyR/lthYK1ug/BMHwflSDUvZNLJDDR9yYE6JqW8gw7CXyEUFOR 87Yoe7bg03VBwt+pM/dAtL3pMUgu+oF2+PGP4BnPDt5BgaB6hxBDh+d0GLCVAtfhTSYatscZ/uTap ZPJ/OREg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:55410 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.96) (envelope-from ) id 1tTffT-00030L-0N; Fri, 03 Jan 2025 11:16:39 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tTffQ-007RoJ-4u; Fri, 03 Jan 2025 11:16:36 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexander Couzens , Alexandre Torgue , Andrew Lunn , AngeloGioacchino Del Regno , Daniel Golle , "David S. Miller" , Eric Dumazet , Ioana Ciornei , Jakub Kicinski , Jose Abreu , Jose Abreu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Matthias Brugger , Maxime Chevallier , Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 2/6] net: pcs: xpcs: fill in PCS supported_interfaces MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 03 Jan 2025 11:16:36 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_031652_321299_3B516E54 X-CRM114-Status: UNSURE ( 8.81 ) 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 Fill in the new PCS supported_interfaces member with the interfaces that XPCS supports. Reviewed-by: Maxime Chevallier Signed-off-by: Russell King (Oracle) --- drivers/net/pcs/pcs-xpcs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c index f70ca39f0905..cf41dc5e74e8 100644 --- a/drivers/net/pcs/pcs-xpcs.c +++ b/drivers/net/pcs/pcs-xpcs.c @@ -1446,6 +1446,8 @@ static struct dw_xpcs *xpcs_create(struct mdio_device *mdiodev) if (ret) goto out_clear_clks; + xpcs_get_interfaces(xpcs, xpcs->pcs.supported_interfaces); + if (xpcs->info.pma == WX_TXGBE_XPCS_PMA_10G_ID) xpcs->pcs.poll = false; else From patchwork Fri Jan 3 11:16:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13925508 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 10C77E77188 for ; Fri, 3 Jan 2025 11:21:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date: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-Owner; bh=hL0ZbxOvLUwgHuliz128Mrezo851lPPSOc8xeQi6TDw=; b=KP4GsqnqFC25+KAYDb8kEiQWKh I7X+GMlS4tEeuoiDNJkA6leHEWBcqDJqJEU/sEPTsN0boXAO0rcdEx7fpaQKt+7M+mmT74L/XzHHG wRNzuF3B8MBJhq5WIfxgVj3ZXtcPaGFYLImhfGRMLVZrHiPmHr80I3o56onXxgJwc9PH7ACNPoyne nOWbtzE7dROli5IHWAofZL2H+hQLE/tcnSyRNrAHWtwR+2WjHhpY+0oEPchcSZmB7GiV5AaZ6ag/7 ++DIDhbsuxPI381njnB89YC2zzIwA1grwRjFeEFue8rob93KjxX5//iatRu+AjstKYdODMqldyV37 qJadyNPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTfk7-0000000Cozb-0o75; Fri, 03 Jan 2025 11:21:27 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTffi-0000000Co6U-3vIw; Fri, 03 Jan 2025 11:16: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=hL0ZbxOvLUwgHuliz128Mrezo851lPPSOc8xeQi6TDw=; b=LnxFpI2DSEawHRP3DJLehbZVvH YKkaKYeya3Y72uJTwy3apkWewS1NTzaJ3k4E4qdo/iZ9Fv0uB2QQaQ7CltfH1p7y9LLWM5ZPzXgWj BWEhuZt4Zm2IUxjjmcBydgdiJIs+qbZbtSp6PtIYSFx1uTXYzrIH74TKudYNkj1wNclV+G7dc39gK JwzkWZaiRBoFK3goxr7KEpoTR2xw4Gvr8tgE/tUefoNgtTXpFKm8UEIMuh2BCR/Rl+64no5gHOOWo ARpfERx//JhgmCOXAfp1FJvKpYexcveYdPJpIxcmdGXeMZpGwFYcI+KSyVfjUJ/VRCGpbDnR/mkqL W3t6JSIQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:50404 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.96) (envelope-from ) id 1tTffY-00030b-0V; Fri, 03 Jan 2025 11:16:44 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tTffV-007RoP-8D; Fri, 03 Jan 2025 11:16:41 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexander Couzens , Alexandre Torgue , Andrew Lunn , AngeloGioacchino Del Regno , Daniel Golle , "David S. Miller" , Eric Dumazet , Ioana Ciornei , Jakub Kicinski , Jose Abreu , Jose Abreu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Matthias Brugger , Maxime Chevallier , Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 3/6] net: pcs: mtk-lynxi: fill in PCS supported_interfaces MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 03 Jan 2025 11:16:41 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_031654_969340_52E9F33A X-CRM114-Status: UNSURE ( 8.22 ) 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 Fill in the new PCS supported_interfaces member with the interfaces that the Mediatek LynxI supports. Signed-off-by: Russell King (Oracle) Acked-by: Daniel Golle Reviewed-by: Andrew Lunn --- drivers/net/pcs/pcs-mtk-lynxi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/pcs/pcs-mtk-lynxi.c b/drivers/net/pcs/pcs-mtk-lynxi.c index 7de804535229..a6153e9999a7 100644 --- a/drivers/net/pcs/pcs-mtk-lynxi.c +++ b/drivers/net/pcs/pcs-mtk-lynxi.c @@ -306,6 +306,10 @@ struct phylink_pcs *mtk_pcs_lynxi_create(struct device *dev, mpcs->pcs.poll = true; mpcs->interface = PHY_INTERFACE_MODE_NA; + __set_bit(PHY_INTERFACE_MODE_SGMII, mpcs->pcs.supported_interfaces); + __set_bit(PHY_INTERFACE_MODE_1000BASEX, mpcs->pcs.supported_interfaces); + __set_bit(PHY_INTERFACE_MODE_2500BASEX, mpcs->pcs.supported_interfaces); + return &mpcs->pcs; } EXPORT_SYMBOL(mtk_pcs_lynxi_create); From patchwork Fri Jan 3 11:16:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13925509 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 4AD07E77188 for ; Fri, 3 Jan 2025 11:22:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date: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-Owner; bh=3fPVeRok7tYyHKGOJNHqGUAhct3mDxnPXluFsW2qsWM=; b=32bP0FERPl3Vs0IyEiypXfGUyh 33RXEIEJfvirINb4IweRAyDLBWWOdw54lB8Wv15yjQ/82Kw7tgniqw2ZM62MWu55v5hGqHj/r+4oc YeNkne+1DTv4P6Sl8KXYGX29Wh0Y2ArP0gS+6Jv8ii0ndCwfjJiAEvLLyaN/iAXzS3mdvAZvuDB/J AbPnu7YiknWQiBFrMmzT/BY+Bxa6Ds1KbP9sGtTgKHbx6XeY000vlAZrxssJAJYHq1I1/sCdJWYH5 lPFksaB+wCG5Jrh+wupoVIsBRRKAF89ls16LaDXHPp8O5qtx8wfLfBcx9Gp1PCKW0SmAnflToxGPV 5zuewYeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTflI-0000000CpCE-0W7A; Fri, 03 Jan 2025 11:22:40 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTffr-0000000Co8n-1YjY; Fri, 03 Jan 2025 11:17:04 +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=3fPVeRok7tYyHKGOJNHqGUAhct3mDxnPXluFsW2qsWM=; b=gOefpy8xxs5g/L1BY+Zh8RPhQj v9KfDZSN/ifIgCYkqe781yncGB0YH4fGoElH1eC5LYFFI9M2MOf6DAGXcmDfGLooBdkujx5X1XBOi tqOKjWrTLKzx+8/FB6B18Y3o7ICKFHioYewNNR0KdPC/wjOLne5MnMloOeujheh+51WK/18y5hUc+ V8kwKQ6mzN/FsYHidfWMW67ooW4EppvxiUiZCxhqH9n+QWahTgSgDznMDQcOAv3e9zDRDAmdl5Ua4 mhEC7/GoL07FAZA8+OH8tjwu+DR6Euq+BzoCOZeI94cM3vRJEZHyHy6U9kwkp6aGSQoyPq23aQF0q /42PUrSA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:50410 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.96) (envelope-from ) id 1tTffd-00030z-1d; Fri, 03 Jan 2025 11:16:49 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tTffa-007RoV-Bo; Fri, 03 Jan 2025 11:16:46 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexander Couzens , Alexandre Torgue , Andrew Lunn , AngeloGioacchino Del Regno , Daniel Golle , "David S. Miller" , Eric Dumazet , Ioana Ciornei , Jakub Kicinski , Jose Abreu , Jose Abreu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Matthias Brugger , Maxime Chevallier , Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 4/6] net: pcs: lynx: fill in PCS supported_interfaces MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 03 Jan 2025 11:16:46 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_031703_442270_7033F528 X-CRM114-Status: GOOD ( 10.80 ) 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 Fill in the new PCS supported_interfaces member with the interfaces that Lynx supports. Reviewed-by: Maxime Chevallier Signed-off-by: Russell King (Oracle) --- drivers/net/pcs/pcs-lynx.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/pcs/pcs-lynx.c b/drivers/net/pcs/pcs-lynx.c index 767a8c0714ac..6457190ec6e7 100644 --- a/drivers/net/pcs/pcs-lynx.c +++ b/drivers/net/pcs/pcs-lynx.c @@ -334,9 +334,19 @@ static const struct phylink_pcs_ops lynx_pcs_phylink_ops = { .pcs_link_up = lynx_pcs_link_up, }; +static const phy_interface_t lynx_interfaces[] = { + PHY_INTERFACE_MODE_SGMII, + PHY_INTERFACE_MODE_QSGMII, + PHY_INTERFACE_MODE_1000BASEX, + PHY_INTERFACE_MODE_2500BASEX, + PHY_INTERFACE_MODE_10GBASER, + PHY_INTERFACE_MODE_USXGMII, +}; + static struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio) { struct lynx_pcs *lynx; + int i; lynx = kzalloc(sizeof(*lynx), GFP_KERNEL); if (!lynx) @@ -348,6 +358,9 @@ static struct phylink_pcs *lynx_pcs_create(struct mdio_device *mdio) lynx->pcs.neg_mode = true; lynx->pcs.poll = true; + for (i = 0; i < ARRAY_SIZE(lynx_interfaces); i++) + __set_bit(lynx_interfaces[i], lynx->pcs.supported_interfaces); + return lynx_to_phylink_pcs(lynx); } From patchwork Fri Jan 3 11:16:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13925510 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 C4A7FE77188 for ; Fri, 3 Jan 2025 11:23:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date: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-Owner; bh=4s396obXaI1f8Yz3z+7hU/+8e3s2TBg9V0/XcDUux8s=; b=lQc7rbUu8lxsta6WhAgh2dylhm dUaIhIhlOnrmu62sZko0edXTlPEXZZoSRJTr2LR780hgpgLr22PAHDnkTO3361DM7iSXOf48K0PsH 1kFxqKEdgCqmt/SvLc636tydv/PjSOHVgYTWJ0RSA2n2UxJ674lPi4w0RySk/bbHljUOUFJpjoAUt C8uu6BDdvINaaMALZUcPSC1rp9DEfUCmfpyBOXynFe8/91VhXpfounsS9BShLJ22AIbsihRuKRVKe tMRt+RVRJTZX/9ezRVTPMgShL46S54YnbAF1JWmlVemWXiMfWyChoh7m3+0JRfn/bHo35gkKq8urS Bn2FQ7IQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTfmS-0000000CpJ5-063X; Fri, 03 Jan 2025 11:23:52 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTffw-0000000CoAp-1AVX; Fri, 03 Jan 2025 11:17:09 +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=4s396obXaI1f8Yz3z+7hU/+8e3s2TBg9V0/XcDUux8s=; b=P7wgdPrI4AcqfEfWWuDx1a/tNT 0Ax1clrro5GRgNFgLC8VP3GtrZYGo/YJNafuQ01+Lgv6h+TC4LRtbGfBunbBWoEXzV/2KoggfwLiv vwD/IHr0bV/PVYwuhdIeTG9jn4q4zxkOemjdPO0SLtPXymx4W8tEc3dBKRPr0XPU4IPRBK+W/LEOf tbwCumzIj9YiwFyYiKT8B3f0k/sK9OGW98C+ZCEReksBwvdTd3RoJD9VNpvQLkiFxv/QqAF2wcC7q /cLRRUFbHMIbpVPX3o9AiUubFdmaMScAPhUYMH0aAx68R83LfavnW39ixzTxTK0c0/QJdt/iDPcfv EDLSZ1iw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:38368 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.96) (envelope-from ) id 1tTffj-00031K-0s; Fri, 03 Jan 2025 11:16:55 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tTfff-007Roc-Ff; Fri, 03 Jan 2025 11:16:51 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexander Couzens , Alexandre Torgue , Andrew Lunn , AngeloGioacchino Del Regno , Daniel Golle , "David S. Miller" , Eric Dumazet , Ioana Ciornei , Jakub Kicinski , Jose Abreu , Jose Abreu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Matthias Brugger , Maxime Chevallier , Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 5/6] net: stmmac: use PCS supported_interfaces MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 03 Jan 2025 11:16:51 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_031708_315844_943C2CF1 X-CRM114-Status: GOOD ( 10.41 ) 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 PCS' supported_interfaces member to build the MAC level supported_interfaces bitmap. Reviewed-by: Maxime Chevallier Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 6bc10ffe7a2b..fcb5649fb738 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1203,6 +1203,7 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) struct stmmac_mdio_bus_data *mdio_bus_data; int mode = priv->plat->phy_interface; struct fwnode_handle *fwnode; + struct phylink_pcs *pcs; struct phylink *phylink; priv->phylink_config.dev = &priv->dev->dev; @@ -1224,8 +1225,14 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) /* If we have an xpcs, it defines which PHY interfaces are supported. */ if (priv->hw->xpcs) - xpcs_get_interfaces(priv->hw->xpcs, - priv->phylink_config.supported_interfaces); + pcs = xpcs_to_phylink_pcs(priv->hw->xpcs); + else + pcs = priv->hw->phylink_pcs; + + if (pcs) + phy_interface_or(priv->phylink_config.supported_interfaces, + priv->phylink_config.supported_interfaces, + pcs->supported_interfaces); fwnode = priv->plat->port_node; if (!fwnode) From patchwork Fri Jan 3 11:16:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13925515 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 27B53E77198 for ; Fri, 3 Jan 2025 11:25:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date: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-Owner; bh=/MH/1XbuHmmzMIpU0/jitxqDYSfeHmJOlhMeOQiQWSQ=; b=Xyzw6puxJZfXJJ2Vneyni6yl8V 6wFKiBeVpz9YTeRD0pDqav5o3GoD8jq9fsPGedYkzBJnZS7J57XP9cMXKvpeeBe9oi5avoz1zJdX2 eAkcIPUFK5KdjDBFOLa3b+DIo6gdRMyhKmFLYVcxlORplUwruSD7+3jR3+tJqSyiNB7kae83rU3X0 rIfKIZGEJlDQ+H/CFZbKDT+NBE+h1rdbGyQYuaqTo9rA+YrlcrLLJSQKOgygn1IDoYuam6+2a7RAb apwcf4yxWslgAWP512gW+cWvUD18ThZDpZjjkeGjM9HKGW3/LHsgPRZkL5G/bnSq3P4S4xj5+7Ik5 ULc1tJxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTfnc-0000000CpQp-13Zc; Fri, 03 Jan 2025 11:25:04 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTfg0-0000000CoCR-0IBf; Fri, 03 Jan 2025 11:17:13 +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=/MH/1XbuHmmzMIpU0/jitxqDYSfeHmJOlhMeOQiQWSQ=; b=kyq2ffionUdzxezwxw1n7SSUNJ QOwJve95yZcDFYj/8AbI4Cd7R27VoBHYCihpPknn1P/j1BxO3KEhCfgxJqhvq0TnDSeEOzj3Ps0uh zHmXaY0gXRIM9i/eJtzcnExq8UkRkzCESa+xUsBtpWvg7x7gJALYXj1t8eHTgWxUdlMPzinWZeX7G cJARELl9wB4lXw1v7OAaH+hyFepu73JhFPIMuxmjWQ39FAw/ZJHwPRBEuZHOvrPH9XijDcPAm+QBz sr8R3d8+C0vbT6YLCbMOodxu7X5mr9qbkCvtWOcMjJ4r8iBbqV0myf5LRi4BWRNrGhHc466Pv5EPn IAOHlwDA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:39002 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.96) (envelope-from ) id 1tTffn-00031h-2c; Fri, 03 Jan 2025 11:16:59 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1tTffk-007Roi-JM; Fri, 03 Jan 2025 11:16:56 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexander Couzens , Alexandre Torgue , Andrew Lunn , AngeloGioacchino Del Regno , Daniel Golle , "David S. Miller" , Eric Dumazet , Ioana Ciornei , Jakub Kicinski , Jose Abreu , Jose Abreu , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Matthias Brugger , Maxime Chevallier , Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 6/6] net: pcs: xpcs: make xpcs_get_interfaces() static MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Fri, 03 Jan 2025 11:16:56 +0000 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250103_031712_110254_6AAB3ED0 X-CRM114-Status: UNSURE ( 9.82 ) 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 xpcs_get_interfaces() should no longer be used outside of the XPCS code, so make it static. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn --- drivers/net/pcs/pcs-xpcs.c | 3 +-- include/linux/pcs/pcs-xpcs.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c index cf41dc5e74e8..c06b66f40022 100644 --- a/drivers/net/pcs/pcs-xpcs.c +++ b/drivers/net/pcs/pcs-xpcs.c @@ -594,14 +594,13 @@ static unsigned int xpcs_inband_caps(struct phylink_pcs *pcs, } } -void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces) +static void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces) { const struct dw_xpcs_compat *compat; for (compat = xpcs->desc->compat; compat->supported; compat++) __set_bit(compat->interface, interfaces); } -EXPORT_SYMBOL_GPL(xpcs_get_interfaces); int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable) { diff --git a/include/linux/pcs/pcs-xpcs.h b/include/linux/pcs/pcs-xpcs.h index b5b5d17998b8..733f4ddd2ef1 100644 --- a/include/linux/pcs/pcs-xpcs.h +++ b/include/linux/pcs/pcs-xpcs.h @@ -50,7 +50,6 @@ struct dw_xpcs; struct phylink_pcs *xpcs_to_phylink_pcs(struct dw_xpcs *xpcs); int xpcs_get_an_mode(struct dw_xpcs *xpcs, phy_interface_t interface); -void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces); int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable); struct dw_xpcs *xpcs_create_mdiodev(struct mii_bus *bus, int addr);