From patchwork Tue May 23 15:55:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13252599 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 6CDA4C7EE26 for ; Tue, 23 May 2023 15:56:21 +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=bhc3Moa6VVMWLxTM1IGjS3LGOrfTOOgKFoZe69AN4Dg=; b=IoM1ZFPsHUsbNj ATx8bR4Wqn/5XTFin8NeVyOCuWmzDb8Qljz26CIQJgV+6XOa6OeIez71u8o79levWwza6ze2icQDX BpSyxi5WLuj/OfNCZaDwio7kfxDE+YB2sEOzyWQ7y/DaeNBA/USIdevjXc9O7UzW4C1j3D+BFl7x8 946n/GFRtjUsrCkLJTP6cwZ3V5y7gQpkySmashlJXDuVzhPEFuLZfus5RSD3ZLkbM5b6WKXgRmwXR 01bF1xoxOPaJRvIXrNU2/e0DC0XnmpYuW3Ni3RrIbzPXM8g+b12XRalkq10bBIV4EaBv+309ovYIf xXJ0rlWr5ae9N1txvaYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q1UMi-00AiBs-1E; Tue, 23 May 2023 15:56:00 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1UMO-00Ai0V-0i for linux-arm-kernel@lists.infradead.org; Tue, 23 May 2023 15:55: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=Re/UlqW6vaDwmOO85PqS9von2XbZJGwxkkQjyPtySbM=; b=brgoOQRhSmtLV+dIIJ7laMe+jc xPKBNSMFpg1nJn/3gy3RVOjOxJMcGp2WPSdD+y4NHAUppa0bwBpnHSfo4HRWU1kWsYAANBCnR64rz Y5CfsjaA9EHoeRxQOeDiAEbhZofqSmFO6afx1ARC9rW25FiNZUEO4jQVCM7Q/9VP5SYXDGsCBwDYo 220UzZBab/W2h7BbdYe2wr3A63qmJKKdRJt+pvhdF1TtPyTidUYvbkEOcvtE94FMzH71o5vldjRPs JOIWjAvYX+XrvR2QrB1nNm2ILTOclr8seZIZwxY5ODoahms5T4BsCcBmVtP3y/L8bgapfquIMrAlz JHENwInQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:46874 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 1q1UMK-0000kX-59; Tue, 23 May 2023 16:55:36 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1q1UMJ-007FT7-HH; Tue, 23 May 2023 16:55:35 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Daniel Machon , "David S. Miller" , Eric Dumazet , Florian Fainelli , Horatiu Vultur , Ioana Ciornei , Jakub Kicinski , Lars Povlsen , linux-arm-kernel@lists.infradead.org, Madalin Bucur , Marcin Wojtas , Michal Simek , netdev@vger.kernel.org, Paolo Abeni , Radhey Shyam Pandey , Sean Anderson , Steen Hegelund , Taras Chornyi , Thomas Petazzoni , UNGLinuxDriver@microchip.com, Vladimir Oltean Subject: [PATCH RFC net-next 6/9] net: mvpp2: switch PCS driver to use phylink_pcs_neg_mode() MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 23 May 2023 16:55:35 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230523_085540_259936_5226DD22 X-CRM114-Status: GOOD ( 11.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use the newly introduced phylink_pcs_neg_mode() to configure whether inband-AN should be used. Signed-off-by: Russell King (Oracle) --- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index adc953611913..9ec806d6cd20 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -6239,6 +6239,7 @@ static int mvpp2_gmac_pcs_config(struct phylink_pcs *pcs, unsigned int mode, { struct mvpp2_port *port = mvpp2_pcs_gmac_to_port(pcs); u32 mask, val, an, old_an, changed; + unsigned int neg_mode; mask = MVPP2_GMAC_IN_BAND_AUTONEG_BYPASS | MVPP2_GMAC_IN_BAND_AUTONEG | @@ -6246,7 +6247,8 @@ static int mvpp2_gmac_pcs_config(struct phylink_pcs *pcs, unsigned int mode, MVPP2_GMAC_FLOW_CTRL_AUTONEG | MVPP2_GMAC_AN_DUPLEX_EN; - if (phylink_autoneg_inband(mode)) { + neg_mode = phylink_pcs_neg_mode(mode, interface, advertising); + if (neg_mode == PHYLINK_PCS_NEG_INBAND_ENABLED) { mask |= MVPP2_GMAC_CONFIG_MII_SPEED | MVPP2_GMAC_CONFIG_GMII_SPEED | MVPP2_GMAC_CONFIG_FULL_DUPLEX;