Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: stmmac: skip VLAN restore when VLAN hash ops are missing

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>

authored by

Michal Piekos and committed by
Jakub Kicinski
48b3cd69 c0fd0fe7

+4 -10
+4 -10
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 156 156 static void stmmac_flush_tx_descriptors(struct stmmac_priv *priv, int queue); 157 157 static void stmmac_set_dma_operation_mode(struct stmmac_priv *priv, u32 txmode, 158 158 u32 rxmode, u32 chan); 159 - static int stmmac_vlan_restore(struct stmmac_priv *priv); 159 + static void stmmac_vlan_restore(struct stmmac_priv *priv); 160 160 161 161 #ifdef CONFIG_DEBUG_FS 162 162 static const struct net_device_ops stmmac_netdev_ops; ··· 6859 6859 return ret; 6860 6860 } 6861 6861 6862 - static int stmmac_vlan_restore(struct stmmac_priv *priv) 6862 + static void stmmac_vlan_restore(struct stmmac_priv *priv) 6863 6863 { 6864 - int ret; 6865 - 6866 6864 if (!(priv->dev->features & NETIF_F_VLAN_FEATURES)) 6867 - return 0; 6865 + return; 6868 6866 6869 6867 if (priv->hw->num_vlan) 6870 6868 stmmac_restore_hw_vlan_rx_fltr(priv, priv->dev, priv->hw); 6871 6869 6872 - ret = stmmac_vlan_update(priv, priv->num_double_vlans); 6873 - if (ret) 6874 - netdev_err(priv->dev, "Failed to restore VLANs\n"); 6875 - 6876 - return ret; 6870 + stmmac_vlan_update(priv, priv->num_double_vlans); 6877 6871 } 6878 6872 6879 6873 static int stmmac_bpf(struct net_device *dev, struct netdev_bpf *bpf)