From: Guenter Roeck <linux@roeck-us.net>
To: Linus Walleij <linusw@kernel.org>, soc@kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: integrator: Fix early initialization
Date: Tue, 5 May 2026 14:14:37 -0700 [thread overview]
Message-ID: <02b810ab-12b8-4d44-91c2-ce6bf8ad894f@roeck-us.net> (raw)
In-Reply-To: <20260505-integrator-fixes-v1-1-56ab9aac59db@kernel.org>
On 5/5/26 12:15, Linus Walleij wrote:
> From: Guenter Roeck <linux@roeck-us.net>
>
> Starting with commit bdb249fce9ad4 ("ARM: integrator: read counter using
> syscon/regmap"), intcp_init_early calls syscon_regmap_lookup_by_compatible
> which in turn calls of_syscon_register. This function allocates memory.
> Since the memory management code has not been initialized at that time,
> the call always fails. It either returns -ENOMEM or crashes as follows.
>
> Unable to handle kernel NULL pointer dereference at virtual address 0000000c when read
> [0000000c] *pgd=00000000
> Internal error: Oops: 5 [#1] ARM
> Modules linked in:
> CPU: 0 UID: 0 PID: 0 Comm: swapper Not tainted 6.15.0-rc5-00026-g5fcc9bf84ee5 #1 PREEMPT
> Hardware name: ARM Integrator/CP (Device Tree)
> PC is at __kmalloc_cache_noprof+0xec/0x39c
> LR is at __kmalloc_cache_noprof+0x34/0x39c
> ...
> Call trace:
> __kmalloc_cache_noprof from of_syscon_register+0x7c/0x310
> of_syscon_register from device_node_get_regmap+0xa4/0xb0
> device_node_get_regmap from intcp_init_early+0xc/0x40
> intcp_init_early from start_kernel+0x60/0x688
> start_kernel from 0x0
>
> The crash is seen due to a dereferenced pointer which is not supposed to be
> NULL but is NULL if the memory management subsystem has not been
> initialized. The crash is not seen with all versions of gcc. Some versions
> such as gcc 9.x apparently do not dereference the pointer, presumably if
> tracing is disabled. The problem has been reproduced with gcc 10.x, 11.x,
> and 13.x. Either case, if the crash is not seen, the call to
> syscon_regmap_lookup_by_compatible returns -ENOMEM, and
> sched_clock_register is never called.
>
> Fix the problem by moving the early initialization code into the standard
> machine initialization code.
>
> Fixes: bdb249fce9ad4 ("ARM: integrator: read counter using syscon/regmap")
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> Link: https://lore.kernel.org/20250518164118.3859567-1-linux@roeck-us.net
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> Hi SoC folks, please apply this directly for fixes.
> Got stuck on a sideways branch for way too long.
I actually stopped testing the integratorcp qemu emulation
because it no longer works reliably, not even with gcc 9.x,
since the timer-sp804 patches were applied.
Given that apparently no one but me ever hit that problem,
I wonder if it is time to remove support for that machine entirely.
Guenter
next prev parent reply other threads:[~2026-05-05 21:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-05 19:15 [PATCH] ARM: integrator: Fix early initialization Linus Walleij
2026-05-05 21:14 ` Guenter Roeck [this message]
2026-05-05 21:25 ` Linus Walleij
-- strict thread matches above, loose matches on Subject: below --
2025-05-18 16:41 Guenter Roeck
2025-05-18 17:47 ` Russell King (Oracle)
2025-05-18 19:09 ` Guenter Roeck
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=02b810ab-12b8-4d44-91c2-ce6bf8ad894f@roeck-us.net \
--to=linux@roeck-us.net \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=soc@kernel.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