Commit 7867299c authored by Stefan Chulski's avatar Stefan Chulski Committed by David S. Miller

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: e531f767 ("net: mvpp2: handle cases where more CPUs are available than s/w threads")
Reported-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarStefan Chulski <stefanc@marvell.com>
Reviewed-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f79bebad
...@@ -1409,7 +1409,7 @@ static void mvpp2_interrupts_unmask(void *arg) ...@@ -1409,7 +1409,7 @@ static void mvpp2_interrupts_unmask(void *arg)
u32 val, thread; u32 val, thread;
/* If the thread isn't used, don't do anything */ /* If the thread isn't used, don't do anything */
if (cpu > port->priv->nthreads) if (cpu >= port->priv->nthreads)
return; return;
thread = mvpp2_cpu_to_thread(port->priv, cpu); thread = mvpp2_cpu_to_thread(port->priv, cpu);
...@@ -2595,7 +2595,7 @@ static void mvpp2_txq_sent_counter_clear(void *arg) ...@@ -2595,7 +2595,7 @@ static void mvpp2_txq_sent_counter_clear(void *arg)
int queue; int queue;
/* If the thread isn't used, don't do anything */ /* 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; return;
for (queue = 0; queue < port->ntxqs; queue++) { for (queue = 0; queue < port->ntxqs; queue++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment