]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: skip VLAN restore when VLAN hash ops are missing
authorMichal Piekos <michal.piekos@mmpsystems.pl>
Sat, 28 Mar 2026 08:55:51 +0000 (09:55 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 1 Apr 2026 02:45:26 +0000 (19:45 -0700)
stmmac_vlan_restore() unconditionally calls stmmac_vlan_update() when
NETIF_F_VLAN_FEATURES is set. On platforms where priv->hw->vlan (or
->update_vlan_hash) is not provided, stmmac_update_vlan_hash() returns
-EINVAL via stmmac_do_void_callback(), resulting in a spurious
"Failed to restore VLANs" error even when no VLAN filtering is in use.

Remove not needed comment.
Remove not used return value from stmmac_vlan_restore().

Tested on Orange Pi Zero 3.

Fixes: bd7ad51253a7 ("net: stmmac: Fix VLAN HW state restore")
Signed-off-by: Michal Piekos <michal.piekos@mmpsystems.pl>
Link: https://patch.msgid.link/20260328-vlan-restore-error-v4-1-f88624c530dc@mmpsystems.pl
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 6827c99bde8c22db42b363d2d36ad6f26075ed50..13d3cac056bea5c3bbb120f81599f32e0f8a65d1 100644 (file)
@@ -156,7 +156,7 @@ static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue);
 static void stmmac_flush_tx_descriptors(struct stmmac_priv *priv, int queue);
 static void stmmac_set_dma_operation_mode(struct stmmac_priv *priv, u32 txmode,
                                          u32 rxmode, u32 chan);
-static int stmmac_vlan_restore(struct stmmac_priv *priv);
+static void stmmac_vlan_restore(struct stmmac_priv *priv);
 
 #ifdef CONFIG_DEBUG_FS
 static const struct net_device_ops stmmac_netdev_ops;
@@ -6859,21 +6859,15 @@ del_vlan_error:
        return ret;
 }
 
-static int stmmac_vlan_restore(struct stmmac_priv *priv)
+static void stmmac_vlan_restore(struct stmmac_priv *priv)
 {
-       int ret;
-
        if (!(priv->dev->features & NETIF_F_VLAN_FEATURES))
-               return 0;
+               return;
 
        if (priv->hw->num_vlan)
                stmmac_restore_hw_vlan_rx_fltr(priv, priv->dev, priv->hw);
 
-       ret = stmmac_vlan_update(priv, priv->num_double_vlans);
-       if (ret)
-               netdev_err(priv->dev, "Failed to restore VLANs\n");
-
-       return ret;
+       stmmac_vlan_update(priv, priv->num_double_vlans);
 }
 
 static int stmmac_bpf(struct net_device *dev, struct netdev_bpf *bpf)