public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: gregory.clement@free-electrons.com (Gregory CLEMENT)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/7] net: mvneta: Fix CPU_MAP registers initialisation
Date: Fri, 25 Sep 2015 18:09:35 +0200	[thread overview]
Message-ID: <1443197378-30717-5-git-send-email-gregory.clement@free-electrons.com> (raw)
In-Reply-To: <1443197378-30717-1-git-send-email-gregory.clement@free-electrons.com>

From: Maxime Ripard <maxime.ripard@free-electrons.com>

The CPU_MAP register is duplicated for each CPUs at different addresses,
each instance being at a different address.

However, the code so far was using CONFIG_NR_CPUS to initialise the CPU_MAP
registers for each registers, while the SoCs embed at most 4 CPUs.

This is especially an issue with multi_v7_defconfig, where CONFIG_NR_CPUS
is currently set to 16, resulting in writes to registers that are not
CPU_MAP.

Fixes: c5aff18204da ("net: mvneta: driver for Marvell Armada 370/XP network unit")
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: <stable@vger.kernel.org> # v3.8+
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 drivers/net/ethernet/marvell/mvneta.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index fe2299ac4f5c..ea587d964c46 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -949,7 +949,7 @@ static void mvneta_defaults_set(struct mvneta_port *pp)
 	/* Set CPU queue access map - all CPUs have access to all RX
 	 * queues and to all TX queues
 	 */
-	for (cpu = 0; cpu < CONFIG_NR_CPUS; cpu++)
+	for_each_present_cpu(cpu)
 		mvreg_write(pp, MVNETA_CPU_MAP(cpu),
 			    (MVNETA_CPU_RXQ_ACCESS_ALL_MASK |
 			     MVNETA_CPU_TXQ_ACCESS_ALL_MASK));
-- 
2.1.0

  parent reply	other threads:[~2015-09-25 16:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25 16:09 [PATCH v2 0/7] net: mvneta: Switch to per-CPU irq and make rxq_def useful Gregory CLEMENT
2015-09-25 16:09 ` [PATCH v2 1/7] genirq: Fix the documentation of request_percpu_irq Gregory CLEMENT
2015-09-25 16:09 ` [PATCH v2 2/7] irq: Export per-cpu irq allocation and de-allocation functions Gregory CLEMENT
2015-09-30 14:56   ` Thomas Petazzoni
2015-09-25 16:09 ` [PATCH v2 3/7] irqchip: armada-370-xp: Rework per-cpu interrupts handling Gregory CLEMENT
2015-09-25 16:09 ` Gregory CLEMENT [this message]
2015-09-25 16:09 ` [PATCH v2 5/7] net: mvneta: Handle per-cpu interrupts Gregory CLEMENT
2015-09-25 16:09 ` [PATCH v2 6/7] net: mvneta: Allow different queues Gregory CLEMENT
2015-09-25 16:09 ` [PATCH v2 7/7] net: mvneta: Statically assign queues to CPUs Gregory CLEMENT
2015-09-29 18:51 ` [PATCH v2 0/7] net: mvneta: Switch to per-CPU irq and make rxq_def useful David Miller
2015-09-30 14:56   ` Thomas Gleixner
2015-09-30 15:40     ` David Miller
2015-09-30 17:39       ` Thomas Gleixner
2015-09-30 14:53 ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1443197378-30717-5-git-send-email-gregory.clement@free-electrons.com \
    --to=gregory.clement@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox