public inbox for linux-mips@vger.kernel.org
 help / color / mirror / Atom feed
From: "Álvaro Fernández Rojas" <noltari@gmail.com>
To: jonas.gorski@gmail.com, Florian Fainelli <f.fainelli@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Marc Zyngier <maz@kernel.org>,
	bcm-kernel-feedback-list@broadcom.com,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Álvaro Fernández Rojas" <noltari@gmail.com>
Subject: [PATCH] irqchip/bcm-6345-l1: fix SMP support
Date: Mon, 22 Feb 2021 21:13:32 +0100	[thread overview]
Message-ID: <20210222201332.30253-1-noltari@gmail.com> (raw)

Some BCM6358 devices start with Core #1 instead of Core #0.
Apart from that, SMP is restricted to 1 CPU since BCM6358 has a shared TLB,
which makes it impossible for the current SMP support to start both CPUs.

The problem is that smp_processor_id() returns 0 and then cpu_logical_map()
converts that to 1, which accesses an uninitialized position of intc->cpus[],
resulting in a kernel panic.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
 drivers/irqchip/irq-bcm6345-l1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-bcm6345-l1.c b/drivers/irqchip/irq-bcm6345-l1.c
index e3483789f4df..b2173ce4743d 100644
--- a/drivers/irqchip/irq-bcm6345-l1.c
+++ b/drivers/irqchip/irq-bcm6345-l1.c
@@ -121,7 +121,7 @@ static void bcm6345_l1_irq_handle(struct irq_desc *desc)
 	unsigned int idx;
 
 #ifdef CONFIG_SMP
-	cpu = intc->cpus[cpu_logical_map(smp_processor_id())];
+	cpu = intc->cpus[smp_processor_id()];
 #else
 	cpu = intc->cpus[0];
 #endif
-- 
2.20.1


             reply	other threads:[~2021-02-22 20:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22 20:13 Álvaro Fernández Rojas [this message]
2021-02-22 21:00 ` [PATCH] irqchip/bcm-6345-l1: fix SMP support Florian Fainelli
2021-02-23 12:30   ` Álvaro Fernández Rojas

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=20210222201332.30253-1-noltari@gmail.com \
    --to=noltari@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=f.fainelli@gmail.com \
    --cc=jonas.gorski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.de \
    /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