Skip to content

Commit

Permalink
net: mvpp2: fix interrupt mask/unmask skip condition
Browse files Browse the repository at this point in the history
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: e531f76 ("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>
  • Loading branch information
Stefan Chulski authored and David S. Miller committed Feb 12, 2021
1 parent f79beba commit 7867299
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
Original file line number Diff line number Diff line change
@@ -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++) {

0 comments on commit 7867299

Please sign in to comment.