From patchwork Thu Dec 5 13:54:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Machon X-Patchwork-Id: 13895415 X-Patchwork-Delegate: kuba@kernel.org Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (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 3655B219A93; Thu, 5 Dec 2024 13:55:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733406954; cv=none; b=CD5+4/IMWfWD+ZtBPammufQXMawxqQb+X5SmkFMwUtF7NNKe6W49YlGCEflsKnWqueYC3DhAQYSq8FtxT9Al+oZ4LavG4mX7UOCs9YYBHwZC/EymyeEdprwUitA5eK1SxQ4LNp+GW6Q0ywLUlB/9gw8/j04X24Ybxk3vcrlsaBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733406954; c=relaxed/simple; bh=c4dJ53RsJySMsz7kMEWZUjeKgAty07fq1ceZcGKda+M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=OI0moIjzFSMasexFFRWwZF5ehIrIlfoc+XP+l49a0X11CfMud1TqzNLthMlakxiotyieK8fT40HwGLm4Qe4AUC1sA1+TqntO9xk60S3WBvv4i+PVGpCO7kfQTTta+7gyhKBrYa8Vxg87PNeqnJYtpbqFcVHfGX/Z7ChW967LjlE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=sEbxZhc6; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="sEbxZhc6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1733406952; x=1764942952; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=c4dJ53RsJySMsz7kMEWZUjeKgAty07fq1ceZcGKda+M=; b=sEbxZhc62R3XFd1jNxnGgJD5anz62yDsaqcjY9vCn04YdKyh+ny74yKv Ca/DRg+4G2zoP2O6FbpeNFvvuvlbXjP880nM6FzZcKJTCLKo2qX/fRTgC MEURiiU+zG6HTbNPfmsYsuuMaPM1d5dhe6sgVzME+TkZJ3Gxw3/v6Y0NQ Nnj2/dc0IONMZ1EQHETa+KniN1JdNtPdpnZAbA7AqtM47MkXxGloD1VUh 7kDHrPwmfqTOuDl9dk/uD29NBeIIB8GjgKYdCmQIARMo7nafbFh6ZMaJy XqwjXDdQu0whzz0X6yIspfKukZXwu918jWItnZ6kGRvzVGIsQR+t/mbcx A==; X-CSE-ConnectionGUID: k5kzCLZDRxuQzU38z46vlQ== X-CSE-MsgGUID: nnMupwmrTm2jsX1ZWvZfWA== X-IronPort-AV: E=Sophos;i="6.12,210,1728975600"; d="scan'208";a="266373258" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 05 Dec 2024 06:55:50 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 5 Dec 2024 06:55:22 -0700 Received: from DEN-DL-M70577.microchip.com (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 5 Dec 2024 06:55:19 -0700 From: Daniel Machon Date: Thu, 5 Dec 2024 14:54:24 +0100 Subject: [PATCH net 1/5] net: lan969x: fix cyclic dependency reported by depmod Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241205-sparx5-lan969x-misc-fixes-v1-1-575ff3d0b022@microchip.com> References: <20241205-sparx5-lan969x-misc-fixes-v1-0-575ff3d0b022@microchip.com> In-Reply-To: <20241205-sparx5-lan969x-misc-fixes-v1-0-575ff3d0b022@microchip.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , , Richard Cochran , Bjarni Jonasson , , , , , CC: Calvin Owens , Muhammad Usama Anjum , , , X-Mailer: b4 0.14-dev X-Patchwork-Delegate: kuba@kernel.org Depmod reports a cyclic dependency between modules sparx5-switch.ko and lan969x-switch.ko: depmod: ERROR: Cycle detected: lan969x_switch -> sparx5_switch -> lan969x_switch depmod: ERROR: Found 2 modules in dependency cycles! make[2]: *** [scripts/Makefile.modinst:132: depmod] Error 1 make: *** [Makefile:224: __sub-make] Error 2 This makes sense, as they both require symbols from each other. Fix this by compiling lan969x support into the sparx5-switch.ko module. In order to do this, in a sensible way, we move the lan969x/ dir into the sparx5/ dir and do some code cleanup of code that is no longer required. After this patch, depmod will no longer complain, as lan969x support is compiled into the sparx5-swicth.ko module, and can no longer be compiled as a standalone module. Fixes: 98a01119608d ("net: sparx5: add compatible string for lan969x") Signed-off-by: Daniel Machon --- MAINTAINERS | 2 +- drivers/net/ethernet/microchip/Kconfig | 1 - drivers/net/ethernet/microchip/Makefile | 1 - drivers/net/ethernet/microchip/lan969x/Kconfig | 5 ----- drivers/net/ethernet/microchip/lan969x/Makefile | 13 ------------- drivers/net/ethernet/microchip/sparx5/Kconfig | 6 ++++++ drivers/net/ethernet/microchip/sparx5/Makefile | 6 ++++++ .../net/ethernet/microchip/{ => sparx5}/lan969x/lan969x.c | 5 ----- .../net/ethernet/microchip/{ => sparx5}/lan969x/lan969x.h | 0 .../microchip/{ => sparx5}/lan969x/lan969x_calendar.c | 0 .../ethernet/microchip/{ => sparx5}/lan969x/lan969x_regs.c | 0 .../microchip/{ => sparx5}/lan969x/lan969x_vcap_ag_api.c | 0 .../microchip/{ => sparx5}/lan969x/lan969x_vcap_impl.c | 0 drivers/net/ethernet/microchip/sparx5/sparx5_calendar.c | 2 -- drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 4 ++-- drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c | 1 - 16 files changed, 15 insertions(+), 31 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 0456a33ef657..991a3c8f2e77 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15270,7 +15270,7 @@ M: Daniel Machon M: UNGLinuxDriver@microchip.com L: netdev@vger.kernel.org S: Maintained -F: drivers/net/ethernet/microchip/lan969x/* +F: drivers/net/ethernet/microchip/sparx5/lan969x/* MICROCHIP LCDFB DRIVER M: Nicolas Ferre diff --git a/drivers/net/ethernet/microchip/Kconfig b/drivers/net/ethernet/microchip/Kconfig index 73832fb2bc32..ee046468652c 100644 --- a/drivers/net/ethernet/microchip/Kconfig +++ b/drivers/net/ethernet/microchip/Kconfig @@ -59,7 +59,6 @@ config LAN743X source "drivers/net/ethernet/microchip/lan865x/Kconfig" source "drivers/net/ethernet/microchip/lan966x/Kconfig" -source "drivers/net/ethernet/microchip/lan969x/Kconfig" source "drivers/net/ethernet/microchip/sparx5/Kconfig" source "drivers/net/ethernet/microchip/vcap/Kconfig" source "drivers/net/ethernet/microchip/fdma/Kconfig" diff --git a/drivers/net/ethernet/microchip/Makefile b/drivers/net/ethernet/microchip/Makefile index 7770df82200f..3c65baed9fd8 100644 --- a/drivers/net/ethernet/microchip/Makefile +++ b/drivers/net/ethernet/microchip/Makefile @@ -11,7 +11,6 @@ lan743x-objs := lan743x_main.o lan743x_ethtool.o lan743x_ptp.o obj-$(CONFIG_LAN865X) += lan865x/ obj-$(CONFIG_LAN966X_SWITCH) += lan966x/ -obj-$(CONFIG_LAN969X_SWITCH) += lan969x/ obj-$(CONFIG_SPARX5_SWITCH) += sparx5/ obj-$(CONFIG_VCAP) += vcap/ obj-$(CONFIG_FDMA) += fdma/ diff --git a/drivers/net/ethernet/microchip/lan969x/Kconfig b/drivers/net/ethernet/microchip/lan969x/Kconfig deleted file mode 100644 index c5c6122ae2ec..000000000000 --- a/drivers/net/ethernet/microchip/lan969x/Kconfig +++ /dev/null @@ -1,5 +0,0 @@ -config LAN969X_SWITCH - bool "Lan969x switch driver" - depends on SPARX5_SWITCH - help - This driver supports the lan969x family of network switch devices. diff --git a/drivers/net/ethernet/microchip/lan969x/Makefile b/drivers/net/ethernet/microchip/lan969x/Makefile deleted file mode 100644 index 316405cbbc71..000000000000 --- a/drivers/net/ethernet/microchip/lan969x/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -# -# Makefile for the Microchip lan969x network device drivers. -# - -obj-$(CONFIG_SPARX5_SWITCH) += lan969x-switch.o - -lan969x-switch-y := lan969x_regs.o lan969x.o lan969x_calendar.o \ - lan969x_vcap_ag_api.o lan969x_vcap_impl.o - -# Provide include files -ccflags-y += -I$(srctree)/drivers/net/ethernet/microchip/fdma -ccflags-y += -I$(srctree)/drivers/net/ethernet/microchip/vcap diff --git a/drivers/net/ethernet/microchip/sparx5/Kconfig b/drivers/net/ethernet/microchip/sparx5/Kconfig index 3f04992eace6..35b057c9d0cb 100644 --- a/drivers/net/ethernet/microchip/sparx5/Kconfig +++ b/drivers/net/ethernet/microchip/sparx5/Kconfig @@ -24,3 +24,9 @@ config SPARX5_DCB DSCP and PCP. If unsure, set to Y. + +config LAN969X_SWITCH + bool "Lan969x switch driver" + depends on SPARX5_SWITCH + help + This driver supports the lan969x family of network switch devices. diff --git a/drivers/net/ethernet/microchip/sparx5/Makefile b/drivers/net/ethernet/microchip/sparx5/Makefile index 3435ca86dd70..4bf2a885a9da 100644 --- a/drivers/net/ethernet/microchip/sparx5/Makefile +++ b/drivers/net/ethernet/microchip/sparx5/Makefile @@ -16,6 +16,12 @@ sparx5-switch-y := sparx5_main.o sparx5_packet.o \ sparx5-switch-$(CONFIG_SPARX5_DCB) += sparx5_dcb.o sparx5-switch-$(CONFIG_DEBUG_FS) += sparx5_vcap_debugfs.o +sparx5-switch-$(CONFIG_LAN969X_SWITCH) += lan969x/lan969x_regs.o \ + lan969x/lan969x.o \ + lan969x/lan969x_calendar.o \ + lan969x/lan969x_vcap_ag_api.o \ + lan969x/lan969x_vcap_impl.o + # Provide include files ccflags-y += -I$(srctree)/drivers/net/ethernet/microchip/vcap ccflags-y += -I$(srctree)/drivers/net/ethernet/microchip/fdma diff --git a/drivers/net/ethernet/microchip/lan969x/lan969x.c b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c similarity index 98% rename from drivers/net/ethernet/microchip/lan969x/lan969x.c rename to drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c index ac37d0f74ee3..67463d41d10e 100644 --- a/drivers/net/ethernet/microchip/lan969x/lan969x.c +++ b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c @@ -346,8 +346,3 @@ const struct sparx5_match_data lan969x_desc = { .consts = &lan969x_consts, .ops = &lan969x_ops, }; -EXPORT_SYMBOL_GPL(lan969x_desc); - -MODULE_DESCRIPTION("Microchip lan969x switch driver"); -MODULE_AUTHOR("Daniel Machon "); -MODULE_LICENSE("Dual MIT/GPL"); diff --git a/drivers/net/ethernet/microchip/lan969x/lan969x.h b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.h similarity index 100% rename from drivers/net/ethernet/microchip/lan969x/lan969x.h rename to drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.h diff --git a/drivers/net/ethernet/microchip/lan969x/lan969x_calendar.c b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_calendar.c similarity index 100% rename from drivers/net/ethernet/microchip/lan969x/lan969x_calendar.c rename to drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_calendar.c diff --git a/drivers/net/ethernet/microchip/lan969x/lan969x_regs.c b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_regs.c similarity index 100% rename from drivers/net/ethernet/microchip/lan969x/lan969x_regs.c rename to drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_regs.c diff --git a/drivers/net/ethernet/microchip/lan969x/lan969x_vcap_ag_api.c b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_vcap_ag_api.c similarity index 100% rename from drivers/net/ethernet/microchip/lan969x/lan969x_vcap_ag_api.c rename to drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_vcap_ag_api.c diff --git a/drivers/net/ethernet/microchip/lan969x/lan969x_vcap_impl.c b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_vcap_impl.c similarity index 100% rename from drivers/net/ethernet/microchip/lan969x/lan969x_vcap_impl.c rename to drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_vcap_impl.c diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_calendar.c b/drivers/net/ethernet/microchip/sparx5/sparx5_calendar.c index 5fe941c66c17..5c46d81de530 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_calendar.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_calendar.c @@ -98,7 +98,6 @@ u32 sparx5_cal_speed_to_value(enum sparx5_cal_bw speed) default: return 0; } } -EXPORT_SYMBOL_GPL(sparx5_cal_speed_to_value); static u32 sparx5_bandwidth_to_calendar(u32 bw) { @@ -150,7 +149,6 @@ enum sparx5_cal_bw sparx5_get_port_cal_speed(struct sparx5 *sparx5, u32 portno) return SPX5_CAL_SPEED_NONE; return sparx5_bandwidth_to_calendar(port->conf.bandwidth); } -EXPORT_SYMBOL_GPL(sparx5_get_port_cal_speed); /* Auto configure the QSYS calendar based on port configuration */ int sparx5_config_auto_calendar(struct sparx5 *sparx5) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c index 2f1013f870fb..2b58fcb9422e 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c @@ -24,7 +24,7 @@ #include #include -#include "../lan969x/lan969x.h" /* for lan969x match data */ +#include "lan969x/lan969x.h" /* for lan969x match data */ #include "sparx5_main_regs.h" #include "sparx5_main.h" @@ -1093,7 +1093,7 @@ static const struct sparx5_match_data sparx5_desc = { static const struct of_device_id mchp_sparx5_match[] = { { .compatible = "microchip,sparx5-switch", .data = &sparx5_desc }, -#if IS_ENABLED(CONFIG_LAN969X_SWITCH) +#ifdef CONFIG_LAN969X_SWITCH { .compatible = "microchip,lan9691-switch", .data = &lan969x_desc }, #endif { } diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c b/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c index 1c2903700a9c..2f168700f63c 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c @@ -303,7 +303,6 @@ void sparx5_get_hwtimestamp(struct sparx5 *sparx5, spin_unlock_irqrestore(&sparx5->ptp_clock_lock, flags); } -EXPORT_SYMBOL_GPL(sparx5_get_hwtimestamp); irqreturn_t sparx5_ptp_irq_handler(int irq, void *args) { From patchwork Thu Dec 5 13:54:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Machon X-Patchwork-Id: 13895411 X-Patchwork-Delegate: kuba@kernel.org Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (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 6E155219A9A; Thu, 5 Dec 2024 13:55:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733406943; cv=none; b=D/hJnBVb4jFDPYU4XDO6IhvaFXsEpqVDZ50Q4p7HYgxj9toqvGLR/Otr/GBi0x9AFoGsDhDQM0dtRiEkaNEpC2nsp0PcZ35l/IF9SD/fVzZ7FF8Bs2BmyfA4zsIUmyiON68VHLvFjSyybAnbVBWkcz7B3+gT5WhdncTRsFlMaqw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733406943; c=relaxed/simple; bh=PGYbsklcZxbQKe46gCtSJ/T9MPciNf2YV+Mvvz1GowY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=nDBG7JWp/psj3ra7VoOBYwTS8rxNIJVAt+nSu6QJTY3/mF82BrhaeGunWBkaTsNjbYMyGMF1uKCCKe0B1bOr2rhe0expdzuzaIpFIh4jwlg39VX3/PEuDfG7ZB3P7nU6OLTIw0wBlOxDCEPIlcyfOtaG5c05SdqdqFDuPZg8qis= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=O0HsD87X; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="O0HsD87X" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1733406941; x=1764942941; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=PGYbsklcZxbQKe46gCtSJ/T9MPciNf2YV+Mvvz1GowY=; b=O0HsD87XFlR+ycE0TS1/EDL0m6F739Sn5xGtntf2RPwMzhi+0AD9FMAv aDW3D3VO1MA3nrjemOTFrcMTkBQAFWsboq+3HxWn5RHV2ZNnKXSXzRIjQ g5qNW6TQPXg/0pLub1cFF6R+w1RMLGznAFFJwwvXhqHz2hTY1XVyG7OMK 0KexHOGxLQUPuQcq3umIvf1iDLmfwd8A1bEkLO8meud/IPSi9A+DOkmNL fIIlwBPVv7vZujI9uNdTp9QF6c+Kr4oxeZVLUsNQLyMq+xVQpBTVufXpB 6SynNWTBzek1vYhP76Mx6pcIS8VMpUPp/IodYNhZdr4SrRFGosNmmtWQp Q==; X-CSE-ConnectionGUID: 7ioOcpSzQfuJnUZ0WQ6I1Q== X-CSE-MsgGUID: qF9MfwCwSdCrE3fz2fX5Pw== X-IronPort-AV: E=Sophos;i="6.12,210,1728975600"; d="scan'208";a="34869386" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 05 Dec 2024 06:55:34 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 5 Dec 2024 06:55:26 -0700 Received: from DEN-DL-M70577.microchip.com (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 5 Dec 2024 06:55:22 -0700 From: Daniel Machon Date: Thu, 5 Dec 2024 14:54:25 +0100 Subject: [PATCH net 2/5] net: lan969x: fix the use of spin_lock in PTP handler Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241205-sparx5-lan969x-misc-fixes-v1-2-575ff3d0b022@microchip.com> References: <20241205-sparx5-lan969x-misc-fixes-v1-0-575ff3d0b022@microchip.com> In-Reply-To: <20241205-sparx5-lan969x-misc-fixes-v1-0-575ff3d0b022@microchip.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , , Richard Cochran , Bjarni Jonasson , , , , , CC: Calvin Owens , Muhammad Usama Anjum , , , X-Mailer: b4 0.14-dev X-Patchwork-Delegate: kuba@kernel.org We are mixing the use of spin_lock() and spin_lock_irqsave() functions in the PTP handler of lan969x. Fix this by correctly using the _irqsave variants. Fixes: 24fe83541755 ("net: lan969x: add PTP handler function") Signed-off-by: Daniel Machon [1]: https://lore.kernel.org/netdev/20241024-sparx5-lan969x-switch-driver-2-v2-10-a0b5fae88a0f@microchip.com/ --- drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c index 67463d41d10e..c2afa2176b08 100644 --- a/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c +++ b/drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c @@ -273,9 +273,9 @@ static irqreturn_t lan969x_ptp_irq_handler(int irq, void *args) if (WARN_ON(!skb_match)) continue; - spin_lock(&sparx5->ptp_ts_id_lock); + spin_lock_irqsave(&sparx5->ptp_ts_id_lock, flags); sparx5->ptp_skbs--; - spin_unlock(&sparx5->ptp_ts_id_lock); + spin_unlock_irqrestore(&sparx5->ptp_ts_id_lock, flags); /* Get the h/w timestamp */ sparx5_get_hwtimestamp(sparx5, &ts, delay); From patchwork Thu Dec 5 13:54:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Machon X-Patchwork-Id: 13895412 X-Patchwork-Delegate: kuba@kernel.org Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (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 64959219A70; Thu, 5 Dec 2024 13:55:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733406945; cv=none; b=a41EyIJWpd7x4jc1yAsGus9RxAUIY8y8SENIg9qcGe8T61m7aX3MlWtzesq1UExQeKMPqckHky5rIYRMSYt3Dkv25WbEPVC/qM/Gc695pDnIM7vgvgyi/bR+vv1u/GCpjf9remU+SlEeCIPAx724ie3DRq2gVsUG+W3LBMGxls4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733406945; c=relaxed/simple; bh=k2uyYdC8wALllRKsK0v7WW1DX6DY5ZwM7HHpcSIknjU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=bMUbs1WEczEfbyKeh4Fp4wwAEC/ujMnbbuIy+rNnZTdxcwUeqDa89fiWQFwa76Ll38jHyt/vdIT6sJ26lA19ITMVOwUst6YRhxR34YQNmKi92BTV/h0nQegPuzRJjHtzq07zsv7Ykqt7KEqXk5XBbtKvkojehnrkdeUbRcRQo+M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=RkRHYQoq; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="RkRHYQoq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1733406943; x=1764942943; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=k2uyYdC8wALllRKsK0v7WW1DX6DY5ZwM7HHpcSIknjU=; b=RkRHYQoqWRFIW9sjV8TPcrgnv1xmvT7XLgmiq2uERE4cvr1upDeMm1Yi D/eEuUtRwyVVkAEB9YtSXQJ7QDjFVlRx48s7O+Sxn/4Wp9vFolWqrGs5S +c4C4iFjB+4FxAxU3wYfEzQjPitanOXyx4Pzk3SrIu6NI+Mu1sBI/y1Y2 Me/bbO98UBZFNVIoJz41mv7C15hbyugfrN9A4bAkbL4CVegAAl1bHyId2 2xy5Qmlzwb3Rl4W0y/n8Hsbr2rytZdUxJrPOPOK/jvOGHp/4sKlf1t8Ls y0eUgUnPhZ71joqknq9bPEfJNn7hzaG+LV5Wpdfstc4FdDPsHW0OLMbTZ Q==; X-CSE-ConnectionGUID: 7ioOcpSzQfuJnUZ0WQ6I1Q== X-CSE-MsgGUID: 1CMFdT0eRHyhGeZ9reiYPQ== X-IronPort-AV: E=Sophos;i="6.12,210,1728975600"; d="scan'208";a="34869390" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 05 Dec 2024 06:55:34 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 5 Dec 2024 06:55:29 -0700 Received: from DEN-DL-M70577.microchip.com (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 5 Dec 2024 06:55:26 -0700 From: Daniel Machon Date: Thu, 5 Dec 2024 14:54:26 +0100 Subject: [PATCH net 3/5] net: sparx5: fix FDMA performance issue Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241205-sparx5-lan969x-misc-fixes-v1-3-575ff3d0b022@microchip.com> References: <20241205-sparx5-lan969x-misc-fixes-v1-0-575ff3d0b022@microchip.com> In-Reply-To: <20241205-sparx5-lan969x-misc-fixes-v1-0-575ff3d0b022@microchip.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , , Richard Cochran , Bjarni Jonasson , , , , , CC: Calvin Owens , Muhammad Usama Anjum , , , X-Mailer: b4 0.14-dev X-Patchwork-Delegate: kuba@kernel.org The FDMA handler is responsible for scheduling a NAPI poll, which will eventually fetch RX packets from the FDMA queue. Currently, the FDMA handler is run in a threaded context. For some reason, this kills performance. Admittedly, I did not do a thorough investigation to see exactly what causes the issue, however, I noticed that in the other driver utilizing the same FDMA engine, we run the FDMA handler in hard IRQ context. Fix this performance issue, by running the FDMA handler in hard IRQ context, not deferring any work to a thread. Prior to this change, the RX UDP performance was: Interval Transfer Bitrate Jitter 0.00-10.20 sec 44.6 MBytes 36.7 Mbits/sec 0.027 ms After this change, the rx UDP performance is: Interval Transfer Bitrate Jitter 0.00-9.12 sec 1.01 GBytes 953 Mbits/sec 0.020 ms Fixes: 10615907e9b5 ("net: sparx5: switchdev: adding frame DMA functionality") Signed-off-by: Daniel Machon --- drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c index 2b58fcb9422e..f61aa15beab7 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c @@ -780,12 +780,11 @@ static int sparx5_start(struct sparx5 *sparx5) err = -ENXIO; if (sparx5->fdma_irq >= 0 && is_sparx5(sparx5)) { if (GCB_CHIP_ID_REV_ID_GET(sparx5->chip_id) > 0) - err = devm_request_threaded_irq(sparx5->dev, - sparx5->fdma_irq, - NULL, - sparx5_fdma_handler, - IRQF_ONESHOT, - "sparx5-fdma", sparx5); + err = devm_request_irq(sparx5->dev, + sparx5->fdma_irq, + sparx5_fdma_handler, + 0, + "sparx5-fdma", sparx5); if (!err) err = sparx5_fdma_start(sparx5); if (err) From patchwork Thu Dec 5 13:54:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Machon X-Patchwork-Id: 13895413 X-Patchwork-Delegate: kuba@kernel.org Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (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 0F48D21A42A; Thu, 5 Dec 2024 13:55:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733406945; cv=none; b=BtTOVmnRRRueHkjmlMZ6TUhdNfSP0lkRyrcM6PSBX2Hzj63NGYqDh61oQulcBmokcrf8wPfekdcSVRllCSmiBOweL5ZoEMhk0fSZG0eGcQSxr9gjiHzJ49QDZKFqpYU6kbLMJL+2+0L+alJZ0eESh52D7MceJNpkCiozFKGOdVg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733406945; c=relaxed/simple; bh=0oKgcrkZi8Q7zAmrkKmMg4EAU89Jf7N07xhOp2/GiHA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=NN/k8+1Di8ZIKr7Zq3EkydezTDyHryAtwpltQqThBujRyDJQ6mCLl3kNIylLoLosfykX8X2gN9l/HeCv42f12QCbCoyHhI3k4hQ6/VebMbd7tnnr2R3uTTSZ/OjPf73o6ihqeJ73XVeDeZ/Z+9m2AaWQ253iVK/iV5ZYVSijNjc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=Y47SDJ6l; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="Y47SDJ6l" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1733406944; x=1764942944; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=0oKgcrkZi8Q7zAmrkKmMg4EAU89Jf7N07xhOp2/GiHA=; b=Y47SDJ6lsU+y3czO7ZaHKnKdMrShQicJZjpsaPedZlNLlsqUEhAk1wx7 jxnhrUQ7F+0AelUMnvLydIF9C7pfsOZ/EGwr8sA7oXe7x5WkMfF1xCOoJ fxNaqKt231afrqiiroXU9gVYspGUxPk95z49Pkb4bPQ9P75+B+tt46f/Y aGvCtAU3aHCIs6+ouAXEgP3h1php1S9P3+c0yL57HjtX0BP4726LK2pJu ePyOCoomGxodWYi4zFCNiNH8YYiFFOHBl5ui+3nGEKQ4iIwmTSkUGnT+S epgTxqytPUlK20/MLDL7A+BPYvRJOaVFKNqLrCnV4vAv3y9rrfZTMK37m A==; X-CSE-ConnectionGUID: 7ioOcpSzQfuJnUZ0WQ6I1Q== X-CSE-MsgGUID: 6MGhBgw7Qlie2uWE/2VadQ== X-IronPort-AV: E=Sophos;i="6.12,210,1728975600"; d="scan'208";a="34869392" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 05 Dec 2024 06:55:35 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 5 Dec 2024 06:55:33 -0700 Received: from DEN-DL-M70577.microchip.com (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 5 Dec 2024 06:55:29 -0700 From: Daniel Machon Date: Thu, 5 Dec 2024 14:54:27 +0100 Subject: [PATCH net 4/5] net: sparx5: fix default value of monitor ports Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241205-sparx5-lan969x-misc-fixes-v1-4-575ff3d0b022@microchip.com> References: <20241205-sparx5-lan969x-misc-fixes-v1-0-575ff3d0b022@microchip.com> In-Reply-To: <20241205-sparx5-lan969x-misc-fixes-v1-0-575ff3d0b022@microchip.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , , Richard Cochran , Bjarni Jonasson , , , , , CC: Calvin Owens , Muhammad Usama Anjum , , , X-Mailer: b4 0.14-dev X-Patchwork-Delegate: kuba@kernel.org When doing port mirroring, the physical port to send the frame to, is written to the FRMC_PORT_VAL field of the QFWD_FRAME_COPY_CFG register. This field is 7 bits wide on sparx5 and 6 bits wide on lan969x, and has a default value of 65 and 30, respectively (the number of front ports). On mirror deletion, we set the default value of the monitor port to 65 for this field, in case no more ports exists for the mirror. Needless to say, this will not fit the 6 bits on lan969x. Fix this by correctly using the n_ports constant instead. Fixes: 3f9e46347a46 ("net: sparx5: use SPX5_CONST for constants which already have a symbol") Signed-off-by: Daniel Machon --- drivers/net/ethernet/microchip/sparx5/sparx5_mirror.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_mirror.c b/drivers/net/ethernet/microchip/sparx5/sparx5_mirror.c index 9806729e9c62..76097761fa97 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_mirror.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_mirror.c @@ -12,7 +12,6 @@ #define SPX5_MIRROR_DISABLED 0 #define SPX5_MIRROR_EGRESS 1 #define SPX5_MIRROR_INGRESS 2 -#define SPX5_MIRROR_MONITOR_PORT_DEFAULT 65 #define SPX5_QFWD_MP_OFFSET 9 /* Mirror port offset in the QFWD register */ /* Convert from bool ingress/egress to mirror direction */ @@ -200,7 +199,7 @@ void sparx5_mirror_del(struct sparx5_mall_entry *entry) sparx5_mirror_monitor_set(sparx5, mirror_idx, - SPX5_MIRROR_MONITOR_PORT_DEFAULT); + sparx5->data->consts->n_ports); } void sparx5_mirror_stats(struct sparx5_mall_entry *entry, From patchwork Thu Dec 5 13:54:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Machon X-Patchwork-Id: 13895416 X-Patchwork-Delegate: kuba@kernel.org Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (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 D593D21A447; Thu, 5 Dec 2024 13:56:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.154.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733406969; cv=none; b=INI/NEQ5hoGCboOgXx98rPFuiWd7JI+iqDGncyJs3ZM3FqLq0eJCL8GICQPCaEu7ImkclIOILKTZTQlZDwzZdH6dCzEAFr2Ghc1LvY80VDAp2UCvvLmUvgw+8eYM7vk34L77y3jIx5qE4gTBu7lwH677qgtnIn7jMyHBJthRdKM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733406969; c=relaxed/simple; bh=6GvfB7edygOjof5RC098NRUa57MLKSj4Kl9eAHtIq4U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=RxmOza+mmj2JgsXdhnNvt0oitjFBPq6Vz/LqNEvY70AyrHndU23mUpX80w4iUsN2MJiglUm3EOC81EZcKPq+3FaxapP7hMs4bAJNEnw9CctusV6GI3y0kqJ3yrtk65eHKddb/M1oE/5pWKLAo7eAm9/BVm7W32vjFQpczZ4FOGI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=ZaM/17IJ; arc=none smtp.client-ip=68.232.154.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="ZaM/17IJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1733406967; x=1764942967; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=6GvfB7edygOjof5RC098NRUa57MLKSj4Kl9eAHtIq4U=; b=ZaM/17IJbtTWHByr8AaGUn/wUWJxqlTZHs3q6aS3PAcmTC3KdKnlGYQH idoBKhF1XccWVbYYLvRJO/QsabwYgQ+XSBYguPZkmgOPyR/FWEUJtSbs2 +Xa8Wf1d09Bfj8u3KyvByz3Cm0vPs67xbPZSHyX15VhSmQMF+F0gOKle3 7JK+Pygr9aOA4Z0vLVv9MPDSGv1CHiKroScOUi4Ki8/J2hWggTQwIbksw J5Am4a8e8eC0o6jgP+8qNVFbAu1/HNQNK+xkN8N1T6+XaCbaQj/btVfKx EPwpvnrTZnI/l4eYPpXPt/j/CqKKpRby3yYosJzM7qxBHhKXa1L8M19re Q==; X-CSE-ConnectionGUID: qy+UA5uVS7igPsVfubi4eA== X-CSE-MsgGUID: JzRvWx8tQKavjYXcv/wEYw== X-IronPort-AV: E=Sophos;i="6.12,210,1728975600"; d="scan'208";a="202626300" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 05 Dec 2024 06:56:06 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 5 Dec 2024 06:55:36 -0700 Received: from DEN-DL-M70577.microchip.com (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Thu, 5 Dec 2024 06:55:33 -0700 From: Daniel Machon Date: Thu, 5 Dec 2024 14:54:28 +0100 Subject: [PATCH net 5/5] net: sparx5: fix the maximum frame length register Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241205-sparx5-lan969x-misc-fixes-v1-5-575ff3d0b022@microchip.com> References: <20241205-sparx5-lan969x-misc-fixes-v1-0-575ff3d0b022@microchip.com> In-Reply-To: <20241205-sparx5-lan969x-misc-fixes-v1-0-575ff3d0b022@microchip.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , , Richard Cochran , Bjarni Jonasson , , , , , CC: Calvin Owens , Muhammad Usama Anjum , , , X-Mailer: b4 0.14-dev X-Patchwork-Delegate: kuba@kernel.org On port initialization, we configure the maximum frame length accepted by the receive module associated with the port. This value is currently written to the MAX_LEN field of the DEV10G_MAC_ENA_CFG register, when in fact, it should be written to the DEV10G_MAC_MAXLEN_CFG register. Fix this. Fixes: 946e7fd5053a ("net: sparx5: add port module support") Signed-off-by: Daniel Machon --- drivers/net/ethernet/microchip/sparx5/sparx5_port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_port.c b/drivers/net/ethernet/microchip/sparx5/sparx5_port.c index 1401761c6251..f9d1a6bb9bff 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_port.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_port.c @@ -1151,7 +1151,7 @@ int sparx5_port_init(struct sparx5 *sparx5, spx5_inst_rmw(DEV10G_MAC_MAXLEN_CFG_MAX_LEN_SET(ETH_MAXLEN), DEV10G_MAC_MAXLEN_CFG_MAX_LEN, devinst, - DEV10G_MAC_ENA_CFG(0)); + DEV10G_MAC_MAXLEN_CFG(0)); /* Handle Signal Detect in 10G PCS */ spx5_inst_wr(PCS10G_BR_PCS_SD_CFG_SD_POL_SET(sd_pol) |