Skip to contentSkip to conversation

Proposed: Patch to fix boot on PA6T

PATCH Darren Stevens 5 participants 8 messages Jun 26, 2016 – Jun 29, 2016 PowerPC

lore
Share & tools
lore
#0 lore raw

Hello All,

commit d6a9996e84ac4beb7713e9485f4563e100a9b03e powerpc/mm: vmalloc abstraction in preparation for radix

This commit introduced variables for some linux kernel addresses that had
before
been constants, unfortunately this stopped PaSemi PA6T systems(*) from
booting as
they call ioremap to map SoC registers before the mmu is initialised. The
attached
patch adds a hard-coded init of pci_io_base to the pas_init_early()
function which
which allows the kernel to boot normally.

The value will be harmlessly set again once pci starts up.

(*) At the moment this has only been tested on an AmigaOneX1000, but I
expect PaSemi
reference systems to have been affected in the same way.

Kind regards
Darren

arch/powerpc/platforms/pasemi/setup.c +5 -0
index d71b2c7..6b8d2ab 100644
@@ -61,6 +61,7 @@ static struct mce_regs mce_regs[MAX_MCE_REGS];
 static int num_mce_regs;
 static int nmi_virq = NO_IRQ;
 
+extern unsigned long pci_io_base;
 
 static void pas_restart(char *cmd)
 {
@@ -341,6 +342,10 @@ out:
 
 static void __init pas_init_early(void)
 {
+	/* Initialise the IO pointer so we don't crash on boot */
+
+	pci_io_base = (H_KERN_VIRT_START + (H_KERN_VIRT_SIZE >> 1));
+
 	iommu_init_early_pasemi();
 }
 
#1 lore raw

Hi Darren,

Fantastic news! I'll test your patch with the RC5 tomorrow. Excellent work! W= ell done!

- Christian

Sent from my iPhone

Quoted 8 lines · Darren Stevens

=20
Hello All,
=20
commit d6a9996e84ac4beb7713e9485f4563e100a9b03e
powerpc/mm: vmalloc abstraction in preparation for radix
=20
This commit introduced variables for some linux kernel addresses that h=

ad

Quoted 4 lines

before
been constants, unfortunately this stopped PaSemi PA6T systems(*) from
booting as
they call ioremap to map SoC registers before the mmu is initialised. T=

he

Quoted 14 lines

attached
patch adds a hard-coded init of pci_io_base to the pas_init_early()
function which
which allows the kernel to boot normally.
=20
The value will be harmlessly set again once pci starts up.
=20
(*) At the moment this has only been tested on an AmigaOneX1000, but I
expect PaSemi
reference systems to have been affected in the same way.
=20
Kind regards
Darren
<pa6t-bootfix.patch>

#2 lore raw
In reply to Darren Stevens
Quoted 9 lines · Darren Stevens

    commit d6a9996e84ac4beb7713e9485f4563e100a9b03e powerpc/mm: vmalloc abstraction in preparation for radix

    This commit introduced variables for some linux kernel addresses that had before been constants, unfortunately this stopped PaSemi PA6T systems(*) from booting as they call ioremap to map SoC registers before the mmu is initialised. The attached patch adds a hard-coded init of pci_io_base to the pas_init_early() function which which allows the kernel to boot normally.

Tell me more, when is that mapping done ? I'm changing things so that platform probe is called much later so that might have an impact.

What consumes pci_io_base before it's been initialized ?

Quoted 5 lines

    The value will be harmlessly set again once pci starts up.

    (*) At the moment this has only been tested on an AmigaOneX1000, but I expect PaSemi
    reference systems to have been affected in the same way.

#4 lore raw
In reply to Darren Stevens

Hi Darren,

Quoted 11 lines · Darren Stevens

Hello All,

commit d6a9996e84ac4beb7713e9485f4563e100a9b03e powerpc/mm: vmalloc abstraction in preparation for radix

This commit introduced variables for some linux kernel addresses that had before been constants, unfortunately this stopped PaSemi PA6T systems(*) from booting as they call ioremap to map SoC registers before the mmu is initialised. The attached patch adds a hard-coded init of pci_io_base to the pas_init_early() function which which allows the kernel to boot normally.

Quoted 7 lines

The value will be harmlessly set again once pci starts up.

(*) At the moment this has only been tested on an AmigaOneX1000, but I expect PaSemi reference systems to have been affected in the same way.

Kind regards
Darren

I can't merge this because you didn't sign it off.

See section 11 of:

https://www.kernel.org/doc/Documentation/SubmittingPatches

cheers

#6 lore raw
In reply to Darren Stevens
Quoted 36 lines · Darren Stevens

Hello All,

commit d6a9996e84ac4beb7713e9485f4563e100a9b03e powerpc/mm: vmalloc abstraction in preparation for radix

This commit introduced variables for some linux kernel addresses that had
before
been constants, unfortunately this stopped PaSemi PA6T systems(*) from
booting as
they call ioremap to map SoC registers before the mmu is initialised. The
attached
patch adds a hard-coded init of pci_io_base to the pas_init_early()
function which
which allows the kernel to boot normally.

The value will be harmlessly set again once pci starts up.

(*) At the moment this has only been tested on an AmigaOneX1000, but I
expect PaSemi
reference systems to have been affected in the same way.

Kind regards
Darren

arch/powerpc/platforms/pasemi/setup.c +1 -0
index d71b2c7..6b8d2ab 100644
@@ -61,6 +61,7 @@ static struct mce_regs mce_regs[MAX_MCE_REGS];
 static int num_mce_regs;
 static int nmi_virq = NO_IRQ;
 
+extern unsigned long pci_io_base;
 
 static void pas_restart(char *cmd)
 {

arch/powerpc/platforms/pasemi/setup.c out: · line 351

Quoted 10 lines
arch/powerpc/platforms/pasemi/setup.c +4 -0
@@ -341,6 +342,10 @@ out:
 
 static void __init pas_init_early(void)
 {
+	/* Initialise the IO pointer so we don't crash on boot */
+
+	pci_io_base = (H_KERN_VIRT_START + (H_KERN_VIRT_SIZE >> 1));
+
 	iommu_init_early_pasemi();
 }
 

Another option is to init it along with rest of the variables as done in hash__early_init_mmu(void)/radix__early_init_mmu(void)

-aneesh

#3 lore raw
In reply to Benjamin Herrenschmidt

Hello Benjamin

Quoted 4 lines · Benjamin Herrenschmidt

Tell me more, when is that mapping done ? I'm changing things so that platform probe is called much later so that might have an impact.

What consumes pci_io_base before it's been initialized ?

pas_pci_init() is the culprit. Following on from Aneesh's suggestion an improved patch will follow shoertly.

Regards
Darren

#7 lore raw
In reply to Aneesh Kumar K.V

Hello Aneesh

Quoted 2 lines · Aneesh Kumar K.V

Another option is to init it along with rest of the variables as done in hash__early_init_mmu(void)/radix__early_init_mmu(void)

*FACEPALM* Why didn't I think of that! I've made this change and seems to work
- obviously I can't test on a Radix system though, as I don't have access to one.

Patch comming shortly

Regards
Darren