diff options
author | Stefan Chulski <stefanc@marvell.com> | 2021-02-11 16:13:19 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-02-12 03:05:05 +0100 |
commit | 7867299cde34e9c2d2c676f2a384a9d5853b914d (patch) | |
tree | e1f36a4e900b4ba4818db0aefa6dd3006eda1314 /drivers/net/ethernet/marvell/mvpp2 | |
parent | Merge branch 'am65-cpsw-nuss-switchdev-driver' (diff) | |
download | linux-7867299cde34e9c2d2c676f2a384a9d5853b914d.tar.xz linux-7867299cde34e9c2d2c676f2a384a9d5853b914d.zip |
net: mvpp2: fix interrupt mask/unmask skip condition
The condition should be skipped if CPU ID equal to nthreads.
The patch doesn't fix any actual issue since
nthreads = min_t(unsigned int, num_present_cpus(), MVPP2_MAX_THREADS).
On all current Armada platforms, the number of CPU's is
less than MVPP2_MAX_THREADS.
Fixes: e531f76757eb ("net: mvpp2: handle cases where more CPUs are available than s/w threads")
Reported-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Stefan Chulski <stefanc@marvell.com>
Reviewed-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell/mvpp2')
-rw-r--r-- | drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index 422d0fba2e22..e88272f8b600 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -1409,7 +1409,7 @@ static void mvpp2_interrupts_unmask(void *arg) u32 val, thread; /* If the thread isn't used, don't do anything */ - if (cpu > port->priv->nthreads) + if (cpu >= port->priv->nthreads) return; thread = mvpp2_cpu_to_thread(port->priv, cpu); @@ -2595,7 +2595,7 @@ static void mvpp2_txq_sent_counter_clear(void *arg) int queue; /* If the thread isn't used, don't do anything */ - if (smp_processor_id() > port->priv->nthreads) + if (smp_processor_id() >= port->priv->nthreads) return; for (queue = 0; queue < port->ntxqs; queue++) { |