Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v2 0/4] net: sparx5: misc fixes for sparx5 and lan969x
@ 2026-05-06  7:25 Daniel Machon
  2026-05-06  7:25 ` [PATCH net v2 1/4] net: sparx5: defer VCAP debugfs creation until after netdev registration Daniel Machon
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Daniel Machon @ 2026-05-06  7:25 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Steen Hegelund, UNGLinuxDriver,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt,
	Bjarni Jonasson, Lars Povlsen, Philipp Zabel, kees
  Cc: linux-kernel, netdev, linux-arm-kernel, Steen Hegelund,
	linux-rt-devel, Andrew Lunn

This series fixes various issues in the sparx5 driver, which also
serves lan969x.

Details are in the individual commit descriptions.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
---
Changes in v2:
- Rework patch #2 to use ndo_set_rx_mode_async (Jakub)
- Link to v1: https://lore.kernel.org/r/20260504-misc-fixes-sparx5-lan969x-v1-0-6604306b5743@microchip.com

---
Daniel Machon (4):
      net: sparx5: defer VCAP debugfs creation until after netdev registration
      net: sparx5: fix sleep in atomic context in MAC table access
      net: sparx5: fix wrong chip ids for TSN SKUs
      net: sparx5: configure serdes for 1000BASE-X in sparx5_port_init()

 drivers/net/ethernet/microchip/sparx5/Makefile     |  3 ++-
 .../net/ethernet/microchip/sparx5/sparx5_debugfs.c | 26 ++++++++++++++++++++++
 .../net/ethernet/microchip/sparx5/sparx5_main.c    |  4 ++--
 .../net/ethernet/microchip/sparx5/sparx5_main.h    | 17 +++++++++-----
 .../net/ethernet/microchip/sparx5/sparx5_netdev.c  |  8 ++++---
 .../net/ethernet/microchip/sparx5/sparx5_port.c    |  3 ++-
 .../ethernet/microchip/sparx5/sparx5_vcap_impl.c   |  6 -----
 7 files changed, 49 insertions(+), 18 deletions(-)
---
base-commit: 98878ed91b68a3150126fccef125ee7b1bb86ab2
change-id: 20260428-misc-fixes-sparx5-lan969x-bc2961a570fb

Best regards,
-- 
Daniel Machon <daniel.machon@microchip.com>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH net v2 1/4] net: sparx5: defer VCAP debugfs creation until after netdev registration
  2026-05-06  7:25 [PATCH net v2 0/4] net: sparx5: misc fixes for sparx5 and lan969x Daniel Machon
@ 2026-05-06  7:25 ` Daniel Machon
  2026-05-07 16:08   ` Jakub Kicinski
  2026-05-06  7:25 ` [PATCH net v2 2/4] net: sparx5: fix sleep in atomic context in MAC table access Daniel Machon
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Daniel Machon @ 2026-05-06  7:25 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Steen Hegelund, UNGLinuxDriver,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt,
	Bjarni Jonasson, Lars Povlsen, Philipp Zabel, kees
  Cc: linux-kernel, netdev, linux-arm-kernel, Steen Hegelund,
	linux-rt-devel

Commit 3a95973e7c79 ("net: sparx5: move VCAP initialization to probe")
moved sparx5_vcap_init() ahead of sparx5_register_netdevs() in probe.
The VCAP init path ends by calling vcap_port_debugfs() for every port,
which uses netdev_name(ndev) as the debugfs file name. At that point
the netdevs have only been allocated, not registered, so dev->name
still holds the "eth%d" template and netdev_name() returns
"(unnamed net_device)". Every port tries to create the same file under
vcaps/, producing a flood of warnings at boot:

  debugfs: '(unnamed net_device)' already exists in 'vcaps'
  debugfs: '(unnamed net_device)' already exists in 'vcaps'
  ...

Move the debugfs setup into a new sparx5_debugfs() helper in
sparx5_debugfs.c, invoked after sparx5_register_notifier_blocks()
succeeds so the netdev names are finalized. sparx5_vcap_init() now
only deals with VCAP state. The sparx5/ debugfs root is created in
the new helper as well.

Fixes: 3a95973e7c79 ("net: sparx5: move VCAP initialization to probe")
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
---
 drivers/net/ethernet/microchip/sparx5/Makefile     |  3 ++-
 .../net/ethernet/microchip/sparx5/sparx5_debugfs.c | 26 ++++++++++++++++++++++
 .../net/ethernet/microchip/sparx5/sparx5_main.c    |  4 ++--
 .../net/ethernet/microchip/sparx5/sparx5_main.h    |  7 ++++++
 .../ethernet/microchip/sparx5/sparx5_vcap_impl.c   |  6 -----
 5 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/microchip/sparx5/Makefile b/drivers/net/ethernet/microchip/sparx5/Makefile
index d447f9e84d92..eb5c81527f41 100644
--- a/drivers/net/ethernet/microchip/sparx5/Makefile
+++ b/drivers/net/ethernet/microchip/sparx5/Makefile
@@ -14,7 +14,8 @@ sparx5-switch-y  := sparx5_main.o sparx5_packet.o \
  sparx5_psfp.o sparx5_mirror.o sparx5_regs.o
 
 sparx5-switch-$(CONFIG_SPARX5_DCB) += sparx5_dcb.o
-sparx5-switch-$(CONFIG_DEBUG_FS) += sparx5_vcap_debugfs.o
+sparx5-switch-$(CONFIG_DEBUG_FS) += sparx5_vcap_debugfs.o \
+				    sparx5_debugfs.o
 
 sparx5-switch-$(CONFIG_LAN969X_SWITCH) += lan969x/lan969x_regs.o \
 					  lan969x/lan969x.o \
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_debugfs.c b/drivers/net/ethernet/microchip/sparx5/sparx5_debugfs.c
new file mode 100644
index 000000000000..f6cb1eeaab80
--- /dev/null
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_debugfs.c
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-2.0+
+/* Microchip Sparx5 Switch driver debug filesystem support
+ *
+ * Copyright (c) 2026 Microchip Technology Inc. and its subsidiaries.
+ */
+
+#include <linux/debugfs.h>
+
+#include "sparx5_main.h"
+#include "vcap_api_debugfs.h"
+
+void sparx5_debugfs(struct sparx5 *sparx5)
+{
+	const struct sparx5_consts *consts = sparx5->data->consts;
+	struct vcap_control *ctrl = sparx5->vcap_ctrl;
+	struct dentry *dir;
+	int idx;
+
+	sparx5->debugfs_root = debugfs_create_dir("sparx5", NULL);
+
+	dir = vcap_debugfs(sparx5->dev, sparx5->debugfs_root, ctrl);
+	for (idx = 0; idx < consts->n_ports; ++idx)
+		if (sparx5->ports[idx])
+			vcap_port_debugfs(sparx5->dev, dir, ctrl,
+					  sparx5->ports[idx]->ndev);
+}
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
index dad713e9ddd5..bec07560e6fe 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
@@ -820,8 +820,6 @@ static int mchp_sparx5_probe(struct platform_device *pdev)
 	/* Default values, some from DT */
 	sparx5->coreclock = SPX5_CORE_CLOCK_DEFAULT;
 
-	sparx5->debugfs_root = debugfs_create_dir("sparx5", NULL);
-
 	ports = of_get_child_by_name(np, "ethernet-ports");
 	if (!ports) {
 		dev_err(sparx5->dev, "no ethernet-ports child node found\n");
@@ -1000,6 +998,8 @@ static int mchp_sparx5_probe(struct platform_device *pdev)
 		goto cleanup_netdevs;
 	}
 
+	sparx5_debugfs(sparx5);
+
 	goto cleanup_config;
 
 cleanup_netdevs:
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
index 6a745bb71b5c..d5e6644ff124 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
@@ -565,6 +565,13 @@ void sparx5_get_hwtimestamp(struct sparx5 *sparx5,
 int sparx5_vcap_init(struct sparx5 *sparx5);
 void sparx5_vcap_deinit(struct sparx5 *sparx5);
 
+/* sparx5_debugfs.c */
+#if defined(CONFIG_DEBUG_FS)
+void sparx5_debugfs(struct sparx5 *sparx5);
+#else
+static inline void sparx5_debugfs(struct sparx5 *sparx5) {}
+#endif
+
 /* sparx5_pgid.c */
 enum sparx5_pgid_type {
 	SPX5_PGID_FREE,
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c b/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c
index 95b93e46a41d..dd446b3a9f20 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c
@@ -2035,7 +2035,6 @@ int sparx5_vcap_init(struct sparx5 *sparx5)
 	const struct sparx5_vcap_inst *cfg;
 	struct vcap_control *ctrl;
 	struct vcap_admin *admin;
-	struct dentry *dir;
 	int err = 0, idx;
 
 	/* Create a VCAP control instance that owns the platform specific VCAP
@@ -2074,11 +2073,6 @@ int sparx5_vcap_init(struct sparx5 *sparx5)
 			sparx5_vcap_port_key_selection(sparx5, admin);
 		list_add_tail(&admin->list, &ctrl->list);
 	}
-	dir = vcap_debugfs(sparx5->dev, sparx5->debugfs_root, ctrl);
-	for (idx = 0; idx < consts->n_ports; ++idx)
-		if (sparx5->ports[idx])
-			vcap_port_debugfs(sparx5->dev, dir, ctrl,
-					  sparx5->ports[idx]->ndev);
 
 	return err;
 }

-- 
2.34.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH net v2 2/4] net: sparx5: fix sleep in atomic context in MAC table access
  2026-05-06  7:25 [PATCH net v2 0/4] net: sparx5: misc fixes for sparx5 and lan969x Daniel Machon
  2026-05-06  7:25 ` [PATCH net v2 1/4] net: sparx5: defer VCAP debugfs creation until after netdev registration Daniel Machon
@ 2026-05-06  7:25 ` Daniel Machon
  2026-05-07 16:05   ` Jakub Kicinski
  2026-05-06  7:25 ` [PATCH net v2 3/4] net: sparx5: fix wrong chip ids for TSN SKUs Daniel Machon
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Daniel Machon @ 2026-05-06  7:25 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Steen Hegelund, UNGLinuxDriver,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt,
	Bjarni Jonasson, Lars Povlsen, Philipp Zabel, kees
  Cc: linux-kernel, netdev, linux-arm-kernel, Steen Hegelund,
	linux-rt-devel

sparx5_set_rx_mode() runs with netif_addr_lock_bh held and iterates
dev->mc via __dev_mc_sync(), which per address calls sparx5_mc_sync() /
sparx5_mc_unsync() -> sparx5_mact_learn() / sparx5_mact_forget().  These
take sparx5->lock, a mutex, and then poll the MAC access command
register with readx_poll_timeout(). A mutex may block, which is not
allowed from atomic context.

Convert the driver to the new .ndo_set_rx_mode_async callback introduced
in commit 3554b4345d85 ("net: introduce ndo_set_rx_mode_async and
netdev_rx_mode_work"). The async callback is invoked from process
context, so the mutex and sleeping completion poll can remain.

Observed with CONFIG_PROVE_LOCKING, CONFIG_DEBUG_SPINLOCK,
CONFIG_DEBUG_MUTEXES and CONFIG_DEBUG_ATOMIC_SLEEP enabled:

  BUG: sleeping function called from invalid context at kernel/locking/mutex.c:591
  in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 217, name: ip
  preempt_count: 201, expected: 0
  Call trace:
   __might_resched+0x144/0x248
   __might_sleep+0x48/0x7c
   __mutex_lock+0x74/0x850
   mutex_lock_nested+0x24/0x30
   sparx5_mact_learn+0x78/0x100
   sparx5_mc_sync+0x40/0x54
   __hw_addr_sync_dev+0xc4/0x170
   sparx5_set_rx_mode+0x4c/0x58
   __dev_set_rx_mode+0x64/0xa4
   __dev_open+0x1ec/0x26c

Fixes: b37a1bae742f ("net: sparx5: add mactable support")
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
---
 drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c
index 1d34af78166a..1061874c9edc 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c
@@ -162,13 +162,15 @@ static int sparx5_port_stop(struct net_device *ndev)
 	return 0;
 }
 
-static void sparx5_set_rx_mode(struct net_device *dev)
+static void sparx5_set_rx_mode(struct net_device *dev,
+			       struct netdev_hw_addr_list *uc,
+			       struct netdev_hw_addr_list *mc)
 {
 	struct sparx5_port *port = netdev_priv(dev);
 	struct sparx5 *sparx5 = port->sparx5;
 
 	if (!test_bit(port->portno, sparx5->bridge_mask))
-		__dev_mc_sync(dev, sparx5_mc_sync, sparx5_mc_unsync);
+		__hw_addr_sync_dev(mc, dev, sparx5_mc_sync, sparx5_mc_unsync);
 }
 
 static int sparx5_port_get_phys_port_name(struct net_device *dev,
@@ -249,7 +251,7 @@ static const struct net_device_ops sparx5_port_netdev_ops = {
 	.ndo_open               = sparx5_port_open,
 	.ndo_stop               = sparx5_port_stop,
 	.ndo_start_xmit         = sparx5_port_xmit_impl,
-	.ndo_set_rx_mode        = sparx5_set_rx_mode,
+	.ndo_set_rx_mode_async  = sparx5_set_rx_mode,
 	.ndo_get_phys_port_name = sparx5_port_get_phys_port_name,
 	.ndo_set_mac_address    = sparx5_set_mac_address,
 	.ndo_validate_addr      = eth_validate_addr,

-- 
2.34.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH net v2 3/4] net: sparx5: fix wrong chip ids for TSN SKUs
  2026-05-06  7:25 [PATCH net v2 0/4] net: sparx5: misc fixes for sparx5 and lan969x Daniel Machon
  2026-05-06  7:25 ` [PATCH net v2 1/4] net: sparx5: defer VCAP debugfs creation until after netdev registration Daniel Machon
  2026-05-06  7:25 ` [PATCH net v2 2/4] net: sparx5: fix sleep in atomic context in MAC table access Daniel Machon
@ 2026-05-06  7:25 ` Daniel Machon
  2026-05-06  7:25 ` [PATCH net v2 4/4] net: sparx5: configure serdes for 1000BASE-X in sparx5_port_init() Daniel Machon
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Daniel Machon @ 2026-05-06  7:25 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Steen Hegelund, UNGLinuxDriver,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt,
	Bjarni Jonasson, Lars Povlsen, Philipp Zabel, kees
  Cc: linux-kernel, netdev, linux-arm-kernel, Steen Hegelund,
	linux-rt-devel, Andrew Lunn

The TSN SKUs in enum spx5_target_chiptype have incorrect IDs:

  SPX5_TARGET_CT_7546TSN    = 0x47546,
  SPX5_TARGET_CT_7549TSN    = 0x47549,
  SPX5_TARGET_CT_7552TSN    = 0x47552,
  SPX5_TARGET_CT_7556TSN    = 0x47556,
  SPX5_TARGET_CT_7558TSN    = 0x47558,

The value read back from the chip is GCB_CHIP_ID_PART_ID, which is a
GENMASK(27, 12) field, i.e. at most 16 bits wide. It can never match
these IDs, so probing a TSN part fails with a "Target not supported"
error.

Fix the enum to use the actual 16-bit part IDs returned by the
hardware: 0x0546, 0x0549, 0x0552, 0x0556 and 0x0558.

Reported-by: Andrew Lunn <andrew@lunn.ch>
Fixes: 3cfa11bac9bb ("net: sparx5: add the basic sparx5 driver")
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
---
 drivers/net/ethernet/microchip/sparx5/sparx5_main.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
index d5e6644ff124..078e02627394 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.h
@@ -31,11 +31,11 @@ enum spx5_target_chiptype {
 	SPX5_TARGET_CT_7552       = 0x7552,  /* SparX-5-128 Enterprise */
 	SPX5_TARGET_CT_7556       = 0x7556,  /* SparX-5-160 Enterprise */
 	SPX5_TARGET_CT_7558       = 0x7558,  /* SparX-5-200 Enterprise */
-	SPX5_TARGET_CT_7546TSN    = 0x47546, /* SparX-5-64i Industrial */
-	SPX5_TARGET_CT_7549TSN    = 0x47549, /* SparX-5-90i Industrial */
-	SPX5_TARGET_CT_7552TSN    = 0x47552, /* SparX-5-128i Industrial */
-	SPX5_TARGET_CT_7556TSN    = 0x47556, /* SparX-5-160i Industrial */
-	SPX5_TARGET_CT_7558TSN    = 0x47558, /* SparX-5-200i Industrial */
+	SPX5_TARGET_CT_7546TSN    = 0x0546,  /* SparX-5-64i Industrial */
+	SPX5_TARGET_CT_7549TSN    = 0x0549,  /* SparX-5-90i Industrial */
+	SPX5_TARGET_CT_7552TSN    = 0x0552,  /* SparX-5-128i Industrial */
+	SPX5_TARGET_CT_7556TSN    = 0x0556,  /* SparX-5-160i Industrial */
+	SPX5_TARGET_CT_7558TSN    = 0x0558,  /* SparX-5-200i Industrial */
 	SPX5_TARGET_CT_LAN9694    = 0x9694,  /* lan969x-40 */
 	SPX5_TARGET_CT_LAN9691VAO = 0x9691,  /* lan969x-40-VAO */
 	SPX5_TARGET_CT_LAN9694TSN = 0x9695,  /* lan969x-40-TSN */

-- 
2.34.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH net v2 4/4] net: sparx5: configure serdes for 1000BASE-X in sparx5_port_init()
  2026-05-06  7:25 [PATCH net v2 0/4] net: sparx5: misc fixes for sparx5 and lan969x Daniel Machon
                   ` (2 preceding siblings ...)
  2026-05-06  7:25 ` [PATCH net v2 3/4] net: sparx5: fix wrong chip ids for TSN SKUs Daniel Machon
@ 2026-05-06  7:25 ` Daniel Machon
  2026-05-07 16:10 ` [PATCH net v2 0/4] net: sparx5: misc fixes for sparx5 and lan969x Jakub Kicinski
  2026-05-07 16:20 ` patchwork-bot+netdevbpf
  5 siblings, 0 replies; 12+ messages in thread
From: Daniel Machon @ 2026-05-06  7:25 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Steen Hegelund, UNGLinuxDriver,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt,
	Bjarni Jonasson, Lars Povlsen, Philipp Zabel, kees
  Cc: linux-kernel, netdev, linux-arm-kernel, Steen Hegelund,
	linux-rt-devel, Andrew Lunn

sparx5_port_init() only invokes sparx5_serdes_set() and the associated
shadow-device enable and low-speed device switch for SGMII and QSGMII.
On any port with a high-speed primary device (DEV5G/DEV10G/DEV25G)
configured for 1000BASE-X the serdes is therefore left uninitialized,
the DEV2G5 shadow is never enabled, and the port stays pointed at its
high-speed device rather than the DEV2G5. The PCS1G block looks
healthy in isolation, but no frames reach the link partner.

Add 1000BASE-X to the check so the same three steps run.

Note: the same issue might apply to 2500BASE-X, but that will,
eventually, be addressed in a separate commit.

Reported-by: Andrew Lunn <andrew@lunn.ch>
Fixes: 946e7fd5053a ("net: sparx5: add port module support")
Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
---
 drivers/net/ethernet/microchip/sparx5/sparx5_port.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_port.c b/drivers/net/ethernet/microchip/sparx5/sparx5_port.c
index 04bc8fffaf96..62c49893de3c 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_port.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_port.c
@@ -1128,7 +1128,8 @@ int sparx5_port_init(struct sparx5 *sparx5,
 		DEV2G5_PCS1G_SD_CFG(port->portno));
 
 	if (conf->portmode == PHY_INTERFACE_MODE_QSGMII ||
-	    conf->portmode == PHY_INTERFACE_MODE_SGMII) {
+	    conf->portmode == PHY_INTERFACE_MODE_SGMII ||
+	    conf->portmode == PHY_INTERFACE_MODE_1000BASEX) {
 		err = sparx5_serdes_set(sparx5, port, conf);
 		if (err)
 			return err;

-- 
2.34.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH net v2 2/4] net: sparx5: fix sleep in atomic context in MAC table access
  2026-05-06  7:25 ` [PATCH net v2 2/4] net: sparx5: fix sleep in atomic context in MAC table access Daniel Machon
@ 2026-05-07 16:05   ` Jakub Kicinski
  0 siblings, 0 replies; 12+ messages in thread
From: Jakub Kicinski @ 2026-05-07 16:05 UTC (permalink / raw)
  To: Daniel Machon
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
	Steen Hegelund, UNGLinuxDriver, Sebastian Andrzej Siewior,
	Clark Williams, Steven Rostedt, Bjarni Jonasson, Lars Povlsen,
	Philipp Zabel, kees, linux-kernel, netdev, linux-arm-kernel,
	linux-rt-devel

On Wed, 6 May 2026 09:25:37 +0200 Daniel Machon wrote:
> sparx5_set_rx_mode() runs with netif_addr_lock_bh held and iterates
> dev->mc via __dev_mc_sync(), which per address calls sparx5_mc_sync() /
> sparx5_mc_unsync() -> sparx5_mact_learn() / sparx5_mact_forget().  These
> take sparx5->lock, a mutex, and then poll the MAC access command
> register with readx_poll_timeout(). A mutex may block, which is not
> allowed from atomic context.
> 
> Convert the driver to the new .ndo_set_rx_mode_async callback introduced
> in commit 3554b4345d85 ("net: introduce ndo_set_rx_mode_async and
> netdev_rx_mode_work"). The async callback is invoked from process
> context, so the mutex and sleeping completion poll can remain.

Sashiko points out that the switchdev handlers are currently racy,
but I think that's orthogonal.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net v2 1/4] net: sparx5: defer VCAP debugfs creation until after netdev registration
  2026-05-06  7:25 ` [PATCH net v2 1/4] net: sparx5: defer VCAP debugfs creation until after netdev registration Daniel Machon
@ 2026-05-07 16:08   ` Jakub Kicinski
  2026-05-07 18:47     ` Daniel Machon
  0 siblings, 1 reply; 12+ messages in thread
From: Jakub Kicinski @ 2026-05-07 16:08 UTC (permalink / raw)
  To: Daniel Machon
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
	Steen Hegelund, UNGLinuxDriver, Sebastian Andrzej Siewior,
	Clark Williams, Steven Rostedt, Bjarni Jonasson, Lars Povlsen,
	Philipp Zabel, kees, linux-kernel, netdev, linux-arm-kernel,
	linux-rt-devel

On Wed, 6 May 2026 09:25:36 +0200 Daniel Machon wrote:
> Move the debugfs setup into a new sparx5_debugfs() helper in
> sparx5_debugfs.c, invoked after sparx5_register_notifier_blocks()
> succeeds so the netdev names are finalized. sparx5_vcap_init() now
> only deals with VCAP state. The sparx5/ debugfs root is created in
> the new helper as well.

netdev names are never final :( User can change them at any time.
The best practice is to name the debugfs file by some stable hw-related
property, bus, port number etc.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net v2 0/4] net: sparx5: misc fixes for sparx5 and lan969x
  2026-05-06  7:25 [PATCH net v2 0/4] net: sparx5: misc fixes for sparx5 and lan969x Daniel Machon
                   ` (3 preceding siblings ...)
  2026-05-06  7:25 ` [PATCH net v2 4/4] net: sparx5: configure serdes for 1000BASE-X in sparx5_port_init() Daniel Machon
@ 2026-05-07 16:10 ` Jakub Kicinski
  2026-05-07 16:20 ` patchwork-bot+netdevbpf
  5 siblings, 0 replies; 12+ messages in thread
From: Jakub Kicinski @ 2026-05-07 16:10 UTC (permalink / raw)
  To: Daniel Machon
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
	Steen Hegelund, UNGLinuxDriver, Sebastian Andrzej Siewior,
	Clark Williams, Steven Rostedt, Bjarni Jonasson, Lars Povlsen,
	Philipp Zabel, kees, linux-kernel, netdev, linux-arm-kernel,
	linux-rt-devel, Andrew Lunn

On Wed, 6 May 2026 09:25:35 +0200 Daniel Machon wrote:
>       net: sparx5: fix wrong chip ids for TSN SKUs
>       net: sparx5: configure serdes for 1000BASE-X in sparx5_port_init()

Let me grab these two already. patch 1 I think needs more work,
patch 2 is probably fine but maybe we should address the sashiko
issue in the same series


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net v2 0/4] net: sparx5: misc fixes for sparx5 and lan969x
  2026-05-06  7:25 [PATCH net v2 0/4] net: sparx5: misc fixes for sparx5 and lan969x Daniel Machon
                   ` (4 preceding siblings ...)
  2026-05-07 16:10 ` [PATCH net v2 0/4] net: sparx5: misc fixes for sparx5 and lan969x Jakub Kicinski
@ 2026-05-07 16:20 ` patchwork-bot+netdevbpf
  5 siblings, 0 replies; 12+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-05-07 16:20 UTC (permalink / raw)
  To: Daniel Machon
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, Steen.Hegelund,
	UNGLinuxDriver, bigeasy, clrkwllms, rostedt, bjarni.jonasson,
	lars.povlsen, p.zabel, kees, linux-kernel, netdev,
	linux-arm-kernel, steen.hegelund, linux-rt-devel, andrew

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 6 May 2026 09:25:35 +0200 you wrote:
> This series fixes various issues in the sparx5 driver, which also
> serves lan969x.
> 
> Details are in the individual commit descriptions.
> 
> Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
> 
> [...]

Here is the summary with links:
  - [net,v2,1/4] net: sparx5: defer VCAP debugfs creation until after netdev registration
    (no matching commit)
  - [net,v2,2/4] net: sparx5: fix sleep in atomic context in MAC table access
    (no matching commit)
  - [net,v2,3/4] net: sparx5: fix wrong chip ids for TSN SKUs
    https://git.kernel.org/netdev/net/c/b131dc93f7bf
  - [net,v2,4/4] net: sparx5: configure serdes for 1000BASE-X in sparx5_port_init()
    https://git.kernel.org/netdev/net/c/41ae14071cd7

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net v2 1/4] net: sparx5: defer VCAP debugfs creation until after netdev registration
  2026-05-07 16:08   ` Jakub Kicinski
@ 2026-05-07 18:47     ` Daniel Machon
  2026-05-08 23:22       ` Jakub Kicinski
  0 siblings, 1 reply; 12+ messages in thread
From: Daniel Machon @ 2026-05-07 18:47 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
	Steen Hegelund, UNGLinuxDriver, Sebastian Andrzej Siewior,
	Clark Williams, Steven Rostedt, Bjarni Jonasson, Lars Povlsen,
	Philipp Zabel, kees, linux-kernel, netdev, linux-arm-kernel,
	linux-rt-devel

> On Wed, 6 May 2026 09:25:36 +0200 Daniel Machon wrote:
> > Move the debugfs setup into a new sparx5_debugfs() helper in
> > sparx5_debugfs.c, invoked after sparx5_register_notifier_blocks()
> > succeeds so the netdev names are finalized. sparx5_vcap_init() now
> > only deals with VCAP state. The sparx5/ debugfs root is created in
> > the new helper as well.
> 
> netdev names are never final :( User can change them at any time.
> The best practice is to name the debugfs file by some stable hw-related
> property, bus, port number etc.

Right, but they are finalized in the sense that we have a name we can use for the
debugfs files (which we dont pre-patch).

Hmm. I think this patch fixes an actual issue, where you cannot query the
debugfs files, because a previous patch broke the ordering. I agree that the
names chosen (netdev_name()) for the files were poor, but is that really a fix
for this series? Should that not be adressed in a future patch for net-next (it
involves changing an VCAP API function that is not only used by Sparx5/lan969x,
but also lan966x.).

/Daniel


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net v2 1/4] net: sparx5: defer VCAP debugfs creation until after netdev registration
  2026-05-07 18:47     ` Daniel Machon
@ 2026-05-08 23:22       ` Jakub Kicinski
  2026-05-10 20:24         ` Daniel Machon
  0 siblings, 1 reply; 12+ messages in thread
From: Jakub Kicinski @ 2026-05-08 23:22 UTC (permalink / raw)
  To: Daniel Machon
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
	Steen Hegelund, UNGLinuxDriver, Sebastian Andrzej Siewior,
	Clark Williams, Steven Rostedt, Bjarni Jonasson, Lars Povlsen,
	Philipp Zabel, kees, linux-kernel, netdev, linux-arm-kernel,
	linux-rt-devel

On Thu, 7 May 2026 20:47:14 +0200 Daniel Machon wrote:
> > On Wed, 6 May 2026 09:25:36 +0200 Daniel Machon wrote:  
> > > Move the debugfs setup into a new sparx5_debugfs() helper in
> > > sparx5_debugfs.c, invoked after sparx5_register_notifier_blocks()
> > > succeeds so the netdev names are finalized. sparx5_vcap_init() now
> > > only deals with VCAP state. The sparx5/ debugfs root is created in
> > > the new helper as well.  
> > 
> > netdev names are never final :( User can change them at any time.
> > The best practice is to name the debugfs file by some stable hw-related
> > property, bus, port number etc.  
> 
> Right, but they are finalized in the sense that we have a name we can use for the
> debugfs files (which we dont pre-patch).
> 
> Hmm. I think this patch fixes an actual issue, where you cannot query the
> debugfs files, because a previous patch broke the ordering. I agree that the
> names chosen (netdev_name()) for the files were poor, but is that really a fix
> for this series? Should that not be adressed in a future patch for net-next (it
> involves changing an VCAP API function that is not only used by Sparx5/lan969x,
> but also lan966x.).

Dunno, if we are aiming to switch to a different naming scheme we can
just do it now, I reckon. It will not make the fix much longer.
And presumably it will alleviate the need to reshuffle the ordering.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net v2 1/4] net: sparx5: defer VCAP debugfs creation until after netdev registration
  2026-05-08 23:22       ` Jakub Kicinski
@ 2026-05-10 20:24         ` Daniel Machon
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel Machon @ 2026-05-10 20:24 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Paolo Abeni,
	Steen Hegelund, UNGLinuxDriver, Sebastian Andrzej Siewior,
	Clark Williams, Steven Rostedt, Bjarni Jonasson, Lars Povlsen,
	Philipp Zabel, kees, linux-kernel, netdev, linux-arm-kernel,
	linux-rt-devel

> On Thu, 7 May 2026 20:47:14 +0200 Daniel Machon wrote:
> > > On Wed, 6 May 2026 09:25:36 +0200 Daniel Machon wrote:
> > > > Move the debugfs setup into a new sparx5_debugfs() helper in
> > > > sparx5_debugfs.c, invoked after sparx5_register_notifier_blocks()
> > > > succeeds so the netdev names are finalized. sparx5_vcap_init() now
> > > > only deals with VCAP state. The sparx5/ debugfs root is created in
> > > > the new helper as well.
> > >
> > > netdev names are never final :( User can change them at any time.
> > > The best practice is to name the debugfs file by some stable hw-related
> > > property, bus, port number etc.
> >
> > Right, but they are finalized in the sense that we have a name we can use for the
> > debugfs files (which we dont pre-patch).
> >
> > Hmm. I think this patch fixes an actual issue, where you cannot query the
> > debugfs files, because a previous patch broke the ordering. I agree that the
> > names chosen (netdev_name()) for the files were poor, but is that really a fix
> > for this series? Should that not be adressed in a future patch for net-next (it
> > involves changing an VCAP API function that is not only used by Sparx5/lan969x,
> > but also lan966x.).
> 
> Dunno, if we are aiming to switch to a different naming scheme we can
> just do it now, I reckon. It will not make the fix much longer.
> And presumably it will alleviate the need to reshuffle the ordering.

OK, sounds good to me. I will make the changes for v3. Thanks!

/Daniel


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2026-05-10 20:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-06  7:25 [PATCH net v2 0/4] net: sparx5: misc fixes for sparx5 and lan969x Daniel Machon
2026-05-06  7:25 ` [PATCH net v2 1/4] net: sparx5: defer VCAP debugfs creation until after netdev registration Daniel Machon
2026-05-07 16:08   ` Jakub Kicinski
2026-05-07 18:47     ` Daniel Machon
2026-05-08 23:22       ` Jakub Kicinski
2026-05-10 20:24         ` Daniel Machon
2026-05-06  7:25 ` [PATCH net v2 2/4] net: sparx5: fix sleep in atomic context in MAC table access Daniel Machon
2026-05-07 16:05   ` Jakub Kicinski
2026-05-06  7:25 ` [PATCH net v2 3/4] net: sparx5: fix wrong chip ids for TSN SKUs Daniel Machon
2026-05-06  7:25 ` [PATCH net v2 4/4] net: sparx5: configure serdes for 1000BASE-X in sparx5_port_init() Daniel Machon
2026-05-07 16:10 ` [PATCH net v2 0/4] net: sparx5: misc fixes for sparx5 and lan969x Jakub Kicinski
2026-05-07 16:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox