From patchwork Wed Oct 16 09:58:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13838070 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E1AA199944 for ; Wed, 16 Oct 2024 09:58:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072710; cv=none; b=StJy1TDehCaGiRd4jeIUDylXMTTgRMZXDR2E+ONinHo0fPXoPhZE3IKQZ01I502Id1nJbHcLTXD+/ohfsnzX89B3yRc/2zwjaeISTG6AGZ/zrDUuJf+oVZgIGt3XJ8hHu+bIaRJYPmGjJSSqhuZXAQyWonWZAW71cQS/RPH2sgw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072710; c=relaxed/simple; bh=DmLPmLRaziza5ewwjphLPzMhIQDGOKj2U5ryKGjIm7A=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=pJJakPPuALd8lNvXxnKN8oJBy4tbGDrkw0klN2MdxU3i+89RkA4J4FMTZ6oeJQF2CSbGv+iQ4BQo80cxmMLUMSmW7QPz4dWrGLrFghsXVWKD7BhmkWUONrs2ULr2TSwXsfgY4cQXOpN4rZMS90j1W2UF961DdRpFMkC/uAN/lBo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=HLvg+nX1; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="HLvg+nX1" 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=qlsgT3uh8K9k1PV5YZmeebJi1rGILfxVcCKMi1nm2lU=; b=HLvg+nX1PeN8GpgroUhDTStDQW lmEDhmzSmv/ce+y6XzuKB72w/EIPUKPPK0GKbKlTqwTHlwMDF+e85Nnj4wfu571P4YgvS4qz0afOO E660b5QZcygedHQ/Kf18sdk3AZ9SH10zlPoiXd3flgjC8sX7iAzExYdFSdRMTPLJVHFa1Ti3xCxRb yvXrs5VTpYCpT6BTMT2GYEu5qAtjIJw34/0xkeEji5tjHEOBpig78eOTayxJU1oJmfmD+vHoTdyk3 owR2Cx/AFqdjZEFkd2KeO8bbAo3EsOL4CjqQKDWfri0yNY2UMvQkJ5puAfB6lM4ft0YctRAYVZA5L B+2wpIig==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:46252 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 1t10nQ-0004rT-1S; Wed, 16 Oct 2024 10:58:24 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1t10nQ-000AWQ-Db; Wed, 16 Oct 2024 10:58:24 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: "David S. Miller" , Eric Dumazet , Florian Fainelli , Jakub Kicinski , netdev@vger.kernel.org, Paolo Abeni , Vladimir Oltean Subject: [PATCH net-next v2 1/5] net: dsa: remove dsa_port_phylink_mac_select_pcs() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 16 Oct 2024 10:58:24 +0100 X-Patchwork-Delegate: kuba@kernel.org There is no longer any reason to implement the mac_select_pcs() callback in DSA. Returning ERR_PTR(-EOPNOTSUPP) is functionally equivalent to not providing the function. Signed-off-by: Russell King (Oracle) --- net/dsa/port.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/net/dsa/port.c b/net/dsa/port.c index f1e96706a701..ee0aaec4c8e0 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -1575,13 +1575,6 @@ void dsa_port_set_tag_protocol(struct dsa_port *cpu_dp, cpu_dp->tag_ops = tag_ops; } -static struct phylink_pcs * -dsa_port_phylink_mac_select_pcs(struct phylink_config *config, - phy_interface_t interface) -{ - return ERR_PTR(-EOPNOTSUPP); -} - static void dsa_port_phylink_mac_config(struct phylink_config *config, unsigned int mode, const struct phylink_link_state *state) @@ -1604,7 +1597,6 @@ static void dsa_port_phylink_mac_link_up(struct phylink_config *config, } static const struct phylink_mac_ops dsa_port_phylink_mac_ops = { - .mac_select_pcs = dsa_port_phylink_mac_select_pcs, .mac_config = dsa_port_phylink_mac_config, .mac_link_down = dsa_port_phylink_mac_link_down, .mac_link_up = dsa_port_phylink_mac_link_up, From patchwork Wed Oct 16 09:58:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13838071 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69B8420604C for ; Wed, 16 Oct 2024 09:58:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072716; cv=none; b=vGbB41F5KLjZmO3RiSK54CiYJ5APQ3Ktmg0t5Cvp30iP3rIdFWC1PYGI7pmZtYau65K+Uwr1Y0PhRP4wHWPqDNNLypSmIEyVt5eGb3G2IcM6dfThJGNvrOjNFVE3P02lY83p++5csVIYT6Xfxsprw6aKjHZ4/8Vr5NDu/30dR6s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072716; c=relaxed/simple; bh=sVSFCnQxQPuJp45EmURMFRulEMP8X4iGMkd9iB/nFDE=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=qlexHQ+qYdYBiTRjMAM+jfmtiCDMNatTr66RS98lXqCwTEQwC4oc4veUVSJTIKpr2RTAbwzC+pMMatxIWhJHrdmFd6ZgvSrxbx446NAYILUIN+XkzyoFD1JJzSNI5URIvmm7JgTYZbAwz4qWTdV9QrFG//rqXCN0ZzgmDnstJYc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=SDC5156x; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="SDC5156x" 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=LXa+zpsJI+d2DCmUR+6YHhK6bMBBML5RTKHyzEmK5XQ=; b=SDC5156xE2YbwSmb8HsaGHyV1/ cQzR6SbUAzQcV9MC7YM/Vt5QAH1RJravxGVIUfqs/A0fm8Mov7Rhys9MoQfhHtmBAvYOgOMw2gqFu 0MAnml/aIys6MXp4ykziUvWZZM+TsNegYfcgPjaxMNqkzoXNkiCCGeAHWDybTK1UZbjfw5boi8OxN DA8UwuwYmOyWMlppkeZ9vwOZvNG7fDv4MeRyzsR1OvaSYMXSC6IEQsGZ+aMbGXITrnTw5ZeDO35qJ ZMl3ylashwvG3j4Sx2g4b0ZxGmJhcS+xyNBoF3iNC/Mthy4wAhd+egDgAI9rZ4V2nDRz5yGcOAUDy n7jhBxsg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:48574 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 1t10nV-0004ri-1m; Wed, 16 Oct 2024 10:58:30 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1t10nV-000AWW-IJ; Wed, 16 Oct 2024 10:58:29 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: "David S. Miller" , Eric Dumazet , Florian Fainelli , Jakub Kicinski , netdev@vger.kernel.org, Paolo Abeni , Vladimir Oltean Subject: [PATCH net-next v2 2/5] net: dsa: mv88e6xxx: return NULL when no PCS is present Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 16 Oct 2024 10:58:29 +0100 X-Patchwork-Delegate: kuba@kernel.org Rather than returning an EOPNOTSUPP error pointer when the switch has no support for PCS, return NULL to indicate that no PCS is required. Signed-off-by: Russell King (Oracle) --- drivers/net/dsa/mv88e6xxx/chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index f68233d24f32..da19a3b05549 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -868,7 +868,7 @@ mv88e6xxx_mac_select_pcs(struct phylink_config *config, { struct dsa_port *dp = dsa_phylink_to_port(config); struct mv88e6xxx_chip *chip = dp->ds->priv; - struct phylink_pcs *pcs = ERR_PTR(-EOPNOTSUPP); + struct phylink_pcs *pcs = NULL; if (chip->info->ops->pcs_ops) pcs = chip->info->ops->pcs_ops->pcs_select(chip, dp->index, From patchwork Wed Oct 16 09:58:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13838072 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75B4720604C for ; Wed, 16 Oct 2024 09:58:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072721; cv=none; b=jWbbO3jrmRGidIKYDiIdHtjlH9t9Aw6pbPp2cnu1+pF0e4Un+p6VeIcIRtnMfb5fY3s2YLqidx/lheLtpxqpWf0fS4JRgb12Cc1IPb0Juwhh8Wz6dNF3qJFFQcScP7vmqoDyk59lu/fSQ1QE/E+vrEnNdMg4iL/4daOoo2J6DJc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072721; c=relaxed/simple; bh=3mPTj3+0lPiRrJo64ljzJXoAPoj05NdE0sE5sy60C0Y=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=GvY0/o/fSA+PQKI82UGTYhNiAuR5rIlhEmq/o+ozqlmI7u+ojyUkIp8l4XuDhGcyleIMzAGhX9bxPZcUvtfVeuYLlspC1l273l/T4KFq5G4h8duokcWKU4FfDAUVCahGkuaImLwAy1X3m0r724bavFd63QIN+wWADvOkIjwZmio= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=ISazPGXp; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="ISazPGXp" 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=jsu6yN0Veso/FpjcpusCT9cULiigOwNv6QBsOdMq/5Q=; b=ISazPGXpSrTlDsAiNBpMu348PE 8X0I5+rwLR7kM6bBkL/McmkKESDiw07hwZkCefeX1styywZIKdBNI7MyQc89ep/18tBPFdkUZ06lN /v2EwcwvFYBp/9L70TYZE9162w7CIBN9LwuUJLmGmdJmTx+Lvk5ypouVM4hr5eKJEM74jM/+3tiPm Qqr2PLtG1yJMhlV3oHQOwWwUjw3OARe5l8psxjrRpVsUbhk641qQURgxur1bEZ9DJ2wfvAbSB2Xhy nHwZndimIR8kY5mP/j0kx24KMNBnc4AE8bLnKgFB+mnzI0H6tRxN+7H+pUl1gSSC2YVncIvoHXAoG zCzngw+A==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:48576 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 1t10na-0004ru-21; Wed, 16 Oct 2024 10:58:35 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1t10na-000AWc-M6; Wed, 16 Oct 2024 10:58:34 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: "David S. Miller" , Eric Dumazet , Florian Fainelli , Jakub Kicinski , netdev@vger.kernel.org, Paolo Abeni , Vladimir Oltean Subject: [PATCH net-next v2 3/5] net: phylink: allow mac_select_pcs() to remove a PCS Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 16 Oct 2024 10:58:34 +0100 X-Patchwork-Delegate: kuba@kernel.org phylink has historically not permitted a PCS to be removed. An attempt to permit this with phylink_set_pcs() resulted in comments indicating that there was no need for this. This behaviour has been propagated forward to the mac_select_pcs() approach as it was believed from these comments that changing this would be NAK'd. However, with mac_select_pcs(), it takes more code and thus complexity to maintain this behaviour, which can - and in this case has - resulted in a bug. If mac_select_pcs() returns NULL for a particular interface type, but there is already a PCS in-use, then we skip the pcs_validate() method, but continue using the old PCS. Also, it wouldn't be expected behaviour by implementers of mac_select_pcs(). Allow this by removing this old unnecessary restriction. Signed-off-by: Russell King (Oracle) Reviewed-by: Vladimir Oltean --- drivers/net/phy/phylink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 24a3144e870a..aa1139efc7e4 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1184,7 +1184,7 @@ static void phylink_major_config(struct phylink *pl, bool restart, return; } - pcs_changed = pcs && pl->pcs != pcs; + pcs_changed = pl->pcs != pcs; } phylink_pcs_poll_stop(pl); From patchwork Wed Oct 16 09:58:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13838073 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75F2D206945 for ; Wed, 16 Oct 2024 09:58:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072725; cv=none; b=qoxd2ddRJyBgKy+JzTdwsGyOOuUA37mi9Fy3AD1xALuAmyR0bO8n+ue5aEK+sGL8uhJXLRhZ5XkWtKILJvq3i4/AFUsE874X/RHQMT536jIzbhvj9ALS9T0AragdtXBOb6rCC5Jx4SVuyZh+1CDJX/g9BXA77Mtq3j26YHrwH38= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072725; c=relaxed/simple; bh=FvdU3DWKUgbVK0XVFHzYPLnVuo12X0juTD45vbPEdxc=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=s6WW7zirBUOhmxL3H5LDj2oS9vw2EYBWl69VnBn2vdA16STJAG6PmOaqZuJUtOcSSQHpe7rBuysxmssvmLJkNX/IZx6Tr4zrVRiAj60xn04XFYIgl2O285gTq8Q1zTtC3MA8VnIAMkuT30IHut4GC0QyhQ47g1p17GN58odXaQ0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=e858bfZL; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="e858bfZL" 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=nSSQDQ5g/lLOl8168V5Cn4WsFtWFef0UUUyBDXjq6Mk=; b=e858bfZLJxPDHYL1PrYo3lNYNW iVn1cBeGb03tBfKC07tagwIqBzHYtqayOakzEDTI6D0aagi+yBsspCdk9DsstY2JGjF594Vs9+PN9 FQLx+oayk51jiPOLmECfKwqKYtkL77+8krgVaufBRZ/AcFKuCkUJWBPVt3TKy8xv35E0E8sTzKEII Wy32cm0/0b7vHKi5TY9YFF++0iLSTHVtUF63AIcGSHcVSJgE5ifCsIgVCNlT2SLgBg9qErx6RXdOS UkRVk8/+jGFxby6tRHtUmAz6+8vmOIl/LHL4rbAjcNtBm6fYLc0ad+CDt0KsCWuOPSfOfg9BC2xC5 oYPoKnlw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:59086 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 1t10nf-0004s6-2L; Wed, 16 Oct 2024 10:58:40 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1t10nf-000AWi-PR; Wed, 16 Oct 2024 10:58:39 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: "David S. Miller" , Eric Dumazet , Florian Fainelli , Jakub Kicinski , netdev@vger.kernel.org, Paolo Abeni , Vladimir Oltean Subject: [PATCH net-next v2 4/5] net: phylink: remove use of pl->pcs in phylink_validate_mac_and_pcs() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 16 Oct 2024 10:58:39 +0100 X-Patchwork-Delegate: kuba@kernel.org When the mac_select_pcs() method is not implemented, there is no way for pl->pcs to be set to a non-NULL value. This was here to support the old phylink_set_pcs() method which has been removed a few years ago. Simplify the code in phylink_validate_mac_and_pcs(). Signed-off-by: Russell King (Oracle) Reviewed-by: Vladimir Oltean --- drivers/net/phy/phylink.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index aa1139efc7e4..94f3c5fd09ed 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -649,8 +649,8 @@ static int phylink_validate_mac_and_pcs(struct phylink *pl, unsigned long *supported, struct phylink_link_state *state) { + struct phylink_pcs *pcs = NULL; unsigned long capabilities; - struct phylink_pcs *pcs; int ret; /* Get the PCS for this interface mode */ @@ -658,8 +658,6 @@ static int phylink_validate_mac_and_pcs(struct phylink *pl, pcs = pl->mac_ops->mac_select_pcs(pl->config, state->interface); if (IS_ERR(pcs)) return PTR_ERR(pcs); - } else { - pcs = pl->pcs; } if (pcs) { From patchwork Wed Oct 16 09:58:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13838074 X-Patchwork-Delegate: kuba@kernel.org Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7E92920696F for ; Wed, 16 Oct 2024 09:58:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072730; cv=none; b=C4dlWlJFL7ZAcEB+9sqB5+BWikPwj0kcRQ1QpFSNxKLMLupJs4/rTTz4JT74glNOdOwA+wpWADtu8Y4BWiWt8xOOGJOPEczUqmmt1oESMFtzQfqHipCJrhYGhQaYbQ2E+f28hzH/XhMTOEQ00rXZSw4huE6Npe49T3zWS9Bqgng= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072730; c=relaxed/simple; bh=2ds4OK9uk/a9yojh+DhQQKhmCecIcIZKEccAR1SNYvs=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=aFRGdCLBw04CnXIPd14e0Yn9TOY35t53N90A1pkgXwnrY5L6naZ5RxqNYoVNGtjfPN4wn1oJIE6Rf+Q9X7HOKt6lawSky6fGrWq8AL78usecH3m/UA796qZamrP2UjxVjq8FESEEq4RSB8fyF2tM7TRqSGa9/zX+C4Bayds8Q+Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=NPltmuQK; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="NPltmuQK" 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=bxOdeOMrMudqE5Fuk7n4O6n56Vq4jUeOIhl7EmwtXwo=; b=NPltmuQKQg9frFV0Lb568febCJ bem/oe7ek53c6cJTaZbi9kKF4/L/UUKRRD8b7k46FtdXBKQ8/5pwr7PtyWGnEZQF6Gcfomvy+3TEK FCBbCp/LHe4+i+0H4+FZYOPL3DZVV/ATMBaps58hDvkf+ouZGlgsOR7c2fE0mCwHHRBQaaG+fZ1sl xYahi8K49Ys1h7LUkJPeXfCvbKxg3tT0ZNOoAahrC8dfUkkJTxR5Z6EFiiaL9qLvEnZ7613MVrO/Z EES9UrarH7V7WkoiTYHUOHc3Q+IRZVUBRUFf1vQSekZ2MF8zyQl3v6wlppqXQapaCCrk6sEVHdcCf wEJclbcA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:59096 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 1t10nk-0004sI-2g; Wed, 16 Oct 2024 10:58:45 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1t10nk-000AWo-Sv; Wed, 16 Oct 2024 10:58:44 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: "David S. Miller" , Eric Dumazet , Florian Fainelli , Jakub Kicinski , netdev@vger.kernel.org, Paolo Abeni , Vladimir Oltean Subject: [PATCH net-next v2 5/5] net: phylink: remove "using_mac_select_pcs" Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 16 Oct 2024 10:58:44 +0100 X-Patchwork-Delegate: kuba@kernel.org With DSA's implementation of the mac_select_pcs() method removed, we can now remove the detection of mac_select_pcs() implementation. Signed-off-by: Russell King (Oracle) Reviewed-by: Vladimir Oltean --- drivers/net/phy/phylink.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 94f3c5fd09ed..b5870f8666ac 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -79,7 +79,6 @@ struct phylink { unsigned int pcs_state; bool mac_link_dropped; - bool using_mac_select_pcs; struct sfp_bus *sfp_bus; bool sfp_may_have_phy; @@ -654,7 +653,7 @@ static int phylink_validate_mac_and_pcs(struct phylink *pl, int ret; /* Get the PCS for this interface mode */ - if (pl->using_mac_select_pcs) { + if (pl->mac_ops->mac_select_pcs) { pcs = pl->mac_ops->mac_select_pcs(pl->config, state->interface); if (IS_ERR(pcs)) return PTR_ERR(pcs); @@ -1173,7 +1172,7 @@ static void phylink_major_config(struct phylink *pl, bool restart, state->interface, state->advertising); - if (pl->using_mac_select_pcs) { + if (pl->mac_ops->mac_select_pcs) { pcs = pl->mac_ops->mac_select_pcs(pl->config, state->interface); if (IS_ERR(pcs)) { phylink_err(pl, @@ -1689,7 +1688,6 @@ struct phylink *phylink_create(struct phylink_config *config, phy_interface_t iface, const struct phylink_mac_ops *mac_ops) { - bool using_mac_select_pcs = false; struct phylink *pl; int ret; @@ -1700,11 +1698,6 @@ struct phylink *phylink_create(struct phylink_config *config, return ERR_PTR(-EINVAL); } - if (mac_ops->mac_select_pcs && - mac_ops->mac_select_pcs(config, PHY_INTERFACE_MODE_NA) != - ERR_PTR(-EOPNOTSUPP)) - using_mac_select_pcs = true; - pl = kzalloc(sizeof(*pl), GFP_KERNEL); if (!pl) return ERR_PTR(-ENOMEM); @@ -1723,7 +1716,6 @@ struct phylink *phylink_create(struct phylink_config *config, return ERR_PTR(-EINVAL); } - pl->using_mac_select_pcs = using_mac_select_pcs; pl->phy_state.interface = iface; pl->link_interface = iface; if (iface == PHY_INTERFACE_MODE_MOCA)