From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Chris Packham <Chris.Packham@alliedtelesis.co.nz>,
Christophe Leroy <christophe.leroy@c-s.fr>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>
Cc: Hamish Martin <Hamish.Martin@alliedtelesis.co.nz>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] powerpc/legacy_serial: Use early_ioremap()
Date: Tue, 20 Apr 2021 10:18:42 +0200 [thread overview]
Message-ID: <1b7cc535-7a6c-364c-11e5-11f9eef3e5d3@csgroup.eu> (raw)
In-Reply-To: <32c16eef-f426-4f7e-14aa-b9fbbbec59b8@alliedtelesis.co.nz>
Hi Chris,
Le 10/08/2020 à 04:01, Chris Packham a écrit :
>
> On 24/03/20 10:54 am, Chris Packham wrote:
>> Hi Christophe,
>>
>> On Wed, 2020-02-05 at 12:03 +0000, Christophe Leroy wrote:
>>> [ 0.000000] ioremap() called early from
>>> find_legacy_serial_ports+0x3cc/0x474. Use early_ioremap() instead
>>>
>> I was just about to dig into this error message and found you patch. I
>> applied it to a v5.5 base.
>>
>>> find_legacy_serial_ports() is called early from setup_arch(), before
>>> paging_init(). vmalloc is not available yet, ioremap shouldn't be
>>> used that early.
>>>
>>> Use early_ioremap() and switch to a regular ioremap() later.
>>>
>>> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>> On my system (Freescale T2080 SOC) this seems to cause a crash/hang in
>> early boot. Unfortunately because this is affecting the boot console I
>> don't get any earlyprintk output.
>
> I've been doing a bit more digging into why Christophe's patch didn't
> work for me. I noticed the powerpc specific early_ioremap_range()
> returns addresses around ioremap_bot. Yet the generic early_ioremap()
> uses addresses around FIXADDR_TOP. If I try the following hack I can
> make Christophe's patch work
>
> diff --git a/arch/powerpc/include/asm/fixmap.h
> b/arch/powerpc/include/asm/fixmap.h
> index 2ef155a3c821..7bc2f3f73c8b 100644
> --- a/arch/powerpc/include/asm/fixmap.h
> +++ b/arch/powerpc/include/asm/fixmap.h
> @@ -27,7 +27,7 @@
> #include <asm/kasan.h>
> #define FIXADDR_TOP (KASAN_SHADOW_START - PAGE_SIZE)
> #else
> -#define FIXADDR_TOP ((unsigned long)(-PAGE_SIZE))
> +#define FIXADDR_TOP (IOREMAP_END - PAGE_SIZE)
> #endif
>
> /*
>
> I'll admit to being out of my depth. It seems that the generic
> early_ioremap() is not quite correctly plumbed in for powerpc.
Yes that's probably true for PPC64.
I see that on PPC32 I had to implement the following changes in order to enable earlier use of
early_ioremap()
https://github.com/torvalds/linux/commit/925ac141d106b55acbe112a9272f970631a3c082
I have the problem with QEMU with the ppce500 machine. It will allow me to investigate it a bit further.
prev parent reply other threads:[~2021-04-20 8:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-05 12:03 [PATCH] powerpc/legacy_serial: Use early_ioremap() Christophe Leroy
2020-03-23 21:54 ` Chris Packham
2020-08-10 2:01 ` Chris Packham
2021-04-20 8:18 ` Christophe Leroy [this message]
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=1b7cc535-7a6c-364c-11e5-11f9eef3e5d3@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=Chris.Packham@alliedtelesis.co.nz \
--cc=Hamish.Martin@alliedtelesis.co.nz \
--cc=benh@kernel.crashing.org \
--cc=christophe.leroy@c-s.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).