Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp5404621rwj; Wed, 21 Dec 2022 02:06:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXu4Rg09qe9Rqf0mjVgXKAkSWIunSRJswPHIqKbClgqDlX0NKAMXQaN2to/ZEAjtmlxf8RFo X-Received: by 2002:a05:6a00:48:b0:56b:6c05:3da6 with SMTP id i8-20020a056a00004800b0056b6c053da6mr2209769pfk.8.1671617164283; Wed, 21 Dec 2022 02:06:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671617164; cv=none; d=google.com; s=arc-20160816; b=vX1dZofabXOQHJWj1Gd9TkgA/r85q+WUq9+cLLFHxcbWbLvd/qE1uSlYhtv7Y8WjSx HJ4KiXIz2sfRThU6JC1JUzbeHoqCY4pnUcQnqyvMDOKBJHnIbR3V0uRvoZsCXZtvo9Iw wXLBk7VUOfBuFDREzaqjXfrjSJS2DVjCQ4xH4itPwPYJF8Ee8Q6ZUvwW2GcrMWD5VG2w 5/1z6vM2xldMUdt6e4/x4tQIJPNrHz6n11fgqmsV9KwxpPlBQHuecaS9ryCBDCDvElaq tzUE3WZQfKi+F857atG5pur1MocrkwdPCkoPveT/xRU/UqKqwY5BuZMyk4OvJFZuAXB0 kjDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1CQ4wLHNIEJcPji5BTY+GQPEdPhGnK+rB0tadaYS4So=; b=OR7EQjcKWMIY4MoEHaxSNZFqAIjAOANaPAJ7AVJJSJHwUwqKro/CJiT2J0kS4kLSSC MQe2eTtsh6ZDEj/BRHEY4pTvCKdGOOaKI7W8u0t8fURLL6/26WZZXsWv6Ior/dfQ5DdP +HHawThglX3NkS1v/jK+jypL3QYfSxCtNnu4bx+9rOa/TX+qQbiRcE0RF2WslWqIMY9E MgWSL4SbMSqbeBP8Q5pYOvEjCztBcuKYbunpr7hpGmcz8ca7AHCIVKlihMzkUsJh5e9x 8trV6TY0J9lQyO4foDPuymPB1BYhlUzr+oXMs6U/s3cEMcVbbIUMPVcnXcKC4IctVoyq lE6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ik8SCtyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c124-20020a621c82000000b00557c5641be2si15118485pfc.248.2022.12.21.02.05.54; Wed, 21 Dec 2022 02:06:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=ik8SCtyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234586AbiLUJ3V (ORCPT + 69 others); Wed, 21 Dec 2022 04:29:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234489AbiLUJ24 (ORCPT ); Wed, 21 Dec 2022 04:28:56 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3481921888; Wed, 21 Dec 2022 01:28:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1671614935; x=1703150935; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=3WKvHVDNb03Jat865yIQb6SOcxCvC//LGxrFtZRCdxA=; b=ik8SCtyhafgY0cAUORZ1yXAnW+rbMUdXh3ZC/f7msrp0gf15wDswnd+C FVCGmAjlIA/6uVAP5LpBR1AapP0GYrFIIigygDeNT+XF3V3seb+rT/okw Kjd0PKb3lxHWpHpgDZf0sAA2nWUYy/cbU8DV6xjwmloWjKRaxe/UX27pw xeIWw3r/w/z7/Mp8ou8AZvXFbwjFWoFot0kMTELwJqH1AVdlHoxKEWGtZ xEiLeTjVaw2biFYjJZya8PVEOQvL7OcTuMErEFx9w7UeMsrok6pJItKzx Fg2pKOj68k4vX19g8kALoyjWdlsgVVJewyW0yxROADya+rQCbtiySCCUT A==; X-IronPort-AV: E=Sophos;i="5.96,262,1665471600"; d="scan'208";a="193885296" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 21 Dec 2022 02:28:53 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 21 Dec 2022 02:28:53 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Wed, 21 Dec 2022 02:28:51 -0700 From: Horatiu Vultur To: , CC: , , , , , , Horatiu Vultur Subject: [PATCH net] net: lan966x: Fix configuration of the PCS Date: Wed, 21 Dec 2022 10:33:15 +0100 Message-ID: <20221221093315.939133-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the PCS was taken out of reset, we were changing by mistake also the speed to 100 Mbit. But in case the link was going down, the link up routine was setting correctly the link speed. If the link was not getting down then the speed was forced to run at 100 even if the speed was something else. On lan966x, to set the speed link to 1G or 2.5G a value of 1 needs to be written in DEV_CLOCK_CFG_LINK_SPEED. This is similar to the procedure in lan966x_port_init. The issue was reproduced using 1000base-x sfp module using the commands: ip link set dev eth2 up ip link addr add 10.97.10.2/24 dev eth2 ethtool -s eth2 speed 1000 autoneg off Fixes: d28d6d2e37d1 ("net: lan966x: add port module support") Signed-off-by: Horatiu Vultur --- drivers/net/ethernet/microchip/lan966x/lan966x_port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_port.c b/drivers/net/ethernet/microchip/lan966x/lan966x_port.c index 1a61c6cdb0779..0050fcb988b75 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_port.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_port.c @@ -381,7 +381,7 @@ int lan966x_port_pcs_set(struct lan966x_port *port, } /* Take PCS out of reset */ - lan_rmw(DEV_CLOCK_CFG_LINK_SPEED_SET(2) | + lan_rmw(DEV_CLOCK_CFG_LINK_SPEED_SET(LAN966X_SPEED_1000) | DEV_CLOCK_CFG_PCS_RX_RST_SET(0) | DEV_CLOCK_CFG_PCS_TX_RST_SET(0), DEV_CLOCK_CFG_LINK_SPEED | -- 2.38.0