mirror of
https://github.com/torvalds/linux.git
synced 2026-10-08 11:36:02 +02:00
net: bcmgenet: initialize u64 stats seq counter for all queues
bcmgenet_gstrings_stats statically defines ethtool statistics for queues
0 through GENET_MAX_MQ_CNT (4). However, bcmgenet_probe() only initialized
the u64_stats_sync seq counter up to priv->hw_params->rx_queues and
priv->hw_params->tx_queues.
Since priv->hw_params->rx_queues is 0 across all hardware versions (and
priv->hw_params->tx_queues is 0 on GENET V1), rings 1..4 have uninitialized
u64_stats_sync structures. When ethtool -S is run on 32-bit kernels,
bcmgenet_get_ethtool_stats() reads stats from rx_rings[1..4], causing
lockdep warnings due to the uninitialized sequence counters.
Initialize the sequence counters for all GENET_MAX_MQ_CNT + 1 queues.
Fixes: ffc2c8c4a7 ("net: bcmgenet: Initialize u64 stats seq counter")
Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20260921220021.281418-3-florian.fainelli@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
0e2bec77ea
commit
3aeaa609fd
|
|
@ -4135,10 +4135,10 @@ static int bcmgenet_probe(struct platform_device *pdev)
|
|||
priv->rx_rings[i].rx_max_coalesced_frames = 1;
|
||||
|
||||
/* Initialize u64 stats seq counter for 32bit machines */
|
||||
for (i = 0; i <= priv->hw_params->rx_queues; i++)
|
||||
for (i = 0; i <= GENET_MAX_MQ_CNT; i++) {
|
||||
u64_stats_init(&priv->rx_rings[i].stats64.syncp);
|
||||
for (i = 0; i <= priv->hw_params->tx_queues; i++)
|
||||
u64_stats_init(&priv->tx_rings[i].stats64.syncp);
|
||||
}
|
||||
|
||||
/* libphy will determine the link state */
|
||||
netif_carrier_off(dev);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user