From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] irqchip: gicv3-its: fix ITS CPU init
Date: Fri, 09 Jan 2015 16:10:30 +0000 [thread overview]
Message-ID: <54AFFD76.7060401@arm.com> (raw)
In-Reply-To: <1420818645-2349-1-git-send-email-vladimir.murzin@arm.com>
Hi Vladimir,
On 09/01/15 15:50, Vladimir Murzin wrote:
> We skip initialisation of ITS in case the device-tree has no
> corresponding description, but we are still accessing to ITS bits while
> setting CPU interface what leads to the kernel panic:
>
> ITS: No ITS available, not enabling LPIs
> CPU0: found redistributor 0 region 0:0x000000002f100000
> Unable to handle kernel NULL pointer dereference at virtual address 00000000
> pgd = ffffffc0007fb000
> [00000000] *pgd=00000000fc407003, *pud=00000000fc407003, *pmd=00000000fc408003, *pte=006000002f000707
> Internal error: Oops: 96000005 [#1] PREEMPT SMP
> Modules linked in:
> CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.19.0-rc2+ #318
> Hardware name: FVP Base (DT)
> task: ffffffc00077edb0 ti: ffffffc00076c000 task.ti: ffffffc00076c000
> PC is at its_cpu_init+0x2c/0x320
> LR is at gic_cpu_init+0x168/0x1bc
>
> It happens in gic_rdists_supports_plpis() because gic_rdists is NULL.
> The gic_rdists is set to non-NULL only when ITS node is presented in
> the device-tree.
>
> Fix this by moving the call to gic_rdists_supports_plpis() inside the
> !list_empty(&its_nodes) block, because it is that list that guards the
> validity of the rest of the information in this driver.
>
> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
Looks good to me.
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
M.
> ---
> drivers/irqchip/irq-gic-v3-its.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
> index 86e4684..128a12b 100644
> --- a/drivers/irqchip/irq-gic-v3-its.c
> +++ b/drivers/irqchip/irq-gic-v3-its.c
> @@ -1382,12 +1382,11 @@ static bool gic_rdists_supports_plpis(void)
>
> int its_cpu_init(void)
> {
> - if (!gic_rdists_supports_plpis()) {
> - pr_info("CPU%d: LPIs not supported\n", smp_processor_id());
> - return -ENXIO;
> - }
> -
> if (!list_empty(&its_nodes)) {
> + if (!gic_rdists_supports_plpis()) {
> + pr_info("CPU%d: LPIs not supported\n", smp_processor_id());
> + return -ENXIO;
> + }
> its_cpu_init_lpis();
> its_cpu_init_collection();
> }
>
--
Jazz is not dead. It just smells funny...
next prev parent reply other threads:[~2015-01-09 16:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-09 15:50 [PATCH] irqchip: gicv3-its: fix ITS CPU init Vladimir Murzin
2015-01-09 16:10 ` Marc Zyngier [this message]
2015-01-23 10:03 ` Vladimir Murzin
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=54AFFD76.7060401@arm.com \
--to=marc.zyngier@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.