Skip to contentSkip to conversation

net: airoha: Stop TX queues on error path in airoha_dev_open

PATCH Superseded Wayen Yan 3 participants 3 messages Jun 16 – Jun 18

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Wayen Yan

author
#0 lore raw

PATCH 1/1 net: airoha: Stop TX queues on error path in airoha_dev_open

In airoha_dev_open(), if airoha_set_vip_for_gdm_port() fails after netif_tx_start_all_queues() has been called, the TX queues remain started while the device configuration is incomplete. This leaves the device in an inconsistent state where packets could be transmitted before the VIP/IFC port configuration is complete.

Add netif_tx_stop_all_queues() call on the error path to properly roll back the TX queue state.

Fixes 20bf7d07c956 ("net: airoha: add QDMA support for Airoha EN7581 Ethernet")
---
 drivers/net/ethernet/airoha/airoha_eth.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/airoha/airoha_eth.c +3 -1
index 31cdb11cd7..cf9c366907 100644
@@ -1715,8 +1715,10 @@ static int airoha_dev_open(struct net_device *dev)
 
 	netif_tx_start_all_queues(dev);
 	err = airoha_set_vip_for_gdm_port(port, true);
-	if (err)
+	if (err) {
+		netif_tx_stop_all_queues(dev);
 		return err;
+	}
 
 	if (netdev_uses_dsa(dev))
 		airoha_fe_set(qdma->eth, REG_GDM_INGRESS_CFG(port->id),
Signature · 1 line
2.51.0
maintainer
#1 lore raw
Quoted 5 lines · On Tue, 16 Jun 2026 18:50:39 +0800 Wayen Yan wrote:

In airoha_dev_open(), if airoha_set_vip_for_gdm_port() fails after netif_tx_start_all_queues() has been called, the TX queues remain started while the device configuration is incomplete. This leaves the device in an inconsistent state where packets could be transmitted before the VIP/IFC port configuration is complete.

Not sure if this was superseded by another posting but FWIW this posting did not apply.

maintainer
#2 lore raw
Quoted 9 lines · On Tue, 16 Jun 2026 18:50:39 +0800 Wayen Yan wrote:
Quoted 5 lines

In airoha_dev_open(), if airoha_set_vip_for_gdm_port() fails after netif_tx_start_all_queues() has been called, the TX queues remain started while the device configuration is incomplete. This leaves the device in an inconsistent state where packets could be transmitted before the VIP/IFC port configuration is complete.

Not sure if this was superseded by another posting but FWIW this posting did not apply.

I think we do not need this patch.

Regards,
Lorenzo