From patchwork Wed Nov 10 04:10:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12611337 X-Patchwork-Delegate: kuba@kernel.org 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27784C433EF for ; Wed, 10 Nov 2021 04:10:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F1D2A6117A for ; Wed, 10 Nov 2021 04:10:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230265AbhKJENB (ORCPT ); Tue, 9 Nov 2021 23:13:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:53550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230221AbhKJENB (ORCPT ); Tue, 9 Nov 2021 23:13:01 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 64AC261175; Wed, 10 Nov 2021 04:10:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636517414; bh=lGWXUPNYIop3Kr0Hyv5xk+Yma0Bq3F+ZWD02gZT6s9M=; h=From:To:Cc:Subject:Date:From; b=rXnxQpM08iAGGY5v4FYLJVA4YeRjagf9ceTaHWNZfbodJBu4Cr16hFoP9PlaQ7B+K jw5rlWr68kqB+IiSaLCAogTMWMSmjuJkyt5hNULUeCigHMqUeDl4+Le+sLZbSKtCBY 445iXeS0x3Iu+hslNNnbr4f+/3xAvfusfPXqlTWDA2OE8oPGPrsbdO/fDBwtBOu127 IrLYAj9sZuX8DP58exQsdrqT2TxU1o9+OTUgUKlQkmzmQtvcyefzd9RJ0s4iYr5lBQ KrRVQiYe7k74yjGVIB2XLaUTZMXYETfmmM1bAemdHKJdhix9eEcGiVrkOrR+Dpg/Cp xZlBcbpiO+qag== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org, Andrew Lunn Cc: Jakub Kicinski , David Miller , Russell King , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH net 1/3] net: dsa: mv88e6xxx: Fix forcing speed & duplex when changing to 2500base-x mode Date: Wed, 10 Nov 2021 05:10:08 +0100 Message-Id: <20211110041010.2402-1-kabel@kernel.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Commit 64d47d50be7a ("net: dsa: mv88e6xxx: configure interface settings in mac_config") removed forcing of speed and duplex from mv88e6xxx_mac_config(), where the link is forced down, and left it only in mv88e6xxx_mac_link_up(), by which time link is unforced. It seems that in 2500base-x (at least on 88E6190), if the link is not forced down, the forcing of new settings for speed and duplex doesn't take. Fix this by forcing link down. Fixes: 64d47d50be7a ("net: dsa: mv88e6xxx: configure interface settings in mac_config") Signed-off-by: Marek BehĂșn --- drivers/net/dsa/mv88e6xxx/chip.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index f00cbf5753b9..ddb13cecb3ac 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -785,12 +785,17 @@ static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port, if ((!mv88e6xxx_phy_is_internal(ds, port) && !mv88e6xxx_port_ppu_updates(chip, port)) || mode == MLO_AN_FIXED) { - /* FIXME: for an automedia port, should we force the link - * down here - what if the link comes up due to "other" media - * while we're bringing the port up, how is the exclusivity - * handled in the Marvell hardware? E.g. port 2 on 88E6390 - * shared between internal PHY and Serdes. + /* FIXME: we need to force the link down here, otherwise the + * forcing of link speed and duplex by .port_set_speed_duplex() + * doesn't work for some modes. + * But what if the link comes up due to "other" media while + * we're bringing the port up, how is the exclusivity handled in + * the Marvell hardware? E.g. port 2 on 88E6390 shared between + * internal PHY and Serdes. */ + if (ops->port_sync_link) + err = ops->port_sync_link(chip, port, mode, false); + err = mv88e6xxx_serdes_pcs_link_up(chip, port, mode, speed, duplex); if (err)