Skip to contentSkip to conversation

ARM: socfpga: L2 cache init

BUG Steffen Trumtrar 4 participants 18 messages Feb 6, 2015 – Mar 9, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi!

I have run into a bug on the Socfpga platform. My boards sometimes fail to boot when I have the commit

commit 8b5c18f05621394eb108d3fbc9bf98b05e8162db
Author: Russell King <[email protected]>
Date: Mon Apr 28 15:55:59 2014 +0100

ARM: l2c: socfpga: convert to generic l2c OF initialisation

Remove the explicit call to l2x0_of_init(), converting to the generic infrastructure instead.

in my tree. I don't really understand why this would change anything, but I can reproduce the problem with the following ktest.pl tests:

TEST_START ITERATE 20
TEST_TYPE = boot
CHECKOUT = v3.19-rc7
BUILD_TYPE = socfpga_defconfig
POST_BUILD =
BUILD_NOCLEAN = 1

TEST_START ITERATE 20
TEST_TYPE = boot
CHECKOUT = v3.19-rc7
PRE_BUILD = git revert --no-edit 8b5c18f05621394eb108d3fbc9bf98b05e8162db BUILD_TYPE = socfpga_defconfig
POST_BUILD =
BUILD_NOCLEAN = 1

The first test fails in 3-6 cases and the second one is always successful. Failing means: I don't see anything. From my understanding the generic l2x0_of_init runs before console_init(), so that is why I don't see any messages from the kernel at all, even with earlyprintk.
The bug can be reproduced on a Sockit, Socrates and a custom board. So, it all looks like a common socfpga problem, that should be reproducable on other boards as well.

Help for understanding and fixing the problem is much appreciated.

Thanks,
Steffen Trumtrar

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#1 lore raw
Quoted 7 lines · Steffen Trumtrar

I have run into a bug on the Socfpga platform. My boards sometimes fail to boot when I have the commit

commit 8b5c18f05621394eb108d3fbc9bf98b05e8162db
Author: Russell King <[email protected]>
Date: Mon Apr 28 15:55:59 2014 +0100

Quoted 7 lines

ARM: l2c: socfpga: convert to generic l2c OF initialisation

Remove the explicit call to l2x0_of_init(), converting to the generic infrastructure instead.

That should only result in the L2 cache being turned on earlier (before the secondary CPUs come up.) I wonder if there's a bug in the secondary CPU code which is being tickled by it.

What we need is some information on the failure - and as you've noticed, the failure occurs before the console is initialised. There's two solutions to that:

1. Enable early printk support (and hope that works)
2. Enable DEBUG_LL support, selecting the DEBUG_SOCFPGA_UART option, and add:

{ extern void printascii(const char *); printascii(text); }

after the vscnprintf() in kernel/printk/printk.c.

(I've always used method 2, since that existed long before early printk support was merged - so I've never used method 1 myself.)

Thanks.

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
#2 lore raw

Hi!

Quoted 20 lines · Russell King - ARM Linux
Quoted 7 lines · Steffen Trumtrar

I have run into a bug on the Socfpga platform. My boards sometimes fail to boot when I have the commit

commit 8b5c18f05621394eb108d3fbc9bf98b05e8162db
Author: Russell King <[email protected]>
Date: Mon Apr 28 15:55:59 2014 +0100

Quoted 7 lines

ARM: l2c: socfpga: convert to generic l2c OF initialisation

Remove the explicit call to l2x0_of_init(), converting to the generic infrastructure instead.

That should only result in the L2 cache being turned on earlier (before the secondary CPUs come up.) I wonder if there's a bug in the secondary CPU code which is being tickled by it.

Quoted 5 lines

What we need is some information on the failure - and as you've noticed, the failure occurs before the console is initialised. There's two solutions to that:

1. Enable early printk support (and hope that works)

Thanks. I actually got it working. Seems I had forgotten something in the config. So, the bootlog now prints

Uncompressing Linux... done, booting the kernel.

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Linux version 3.19.0-rc7-test-00001-g7c10eb5fb252 (str at dude) (gcc version 4.9.2 (OSELAS.Toolchain-2014.12.0) ) #163 SMP PREEMPT Mon Feb 9 16:35:27 CET 2015
[    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Terasic SoCkit
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] BUG: mapping for 0xfffec000 at 0xfffec000 out of vmalloc space
Early printk initialized
[    0.000000] PERCPU: Embedded 10 pages/cpu @bf7d4000 s11456 r8192 d21312 u40960
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk  ip=dhcp root=/dev/nfs nfsroot=/home/str/nfsroot/sockit,v3,tcp
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 1032636K/1048576K available (4716K kernel code, 222K rwdata, 1412K rodata, 276K init, 127K bss, 15940K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc0800000 - 0xff000000   (1000 MB)
[    0.000000]     lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
[    0.000000]     modules : 0x7f000000 - 0x80000000   (  16 MB)
[    0.000000]       .text : 0x80008000 - 0x806044d8   (6130 kB)
[    0.000000]       .init : 0x80605000 - 0x8064a000   ( 276 kB)
[    0.000000]       .data : 0x8064a000 - 0x80681a14   ( 223 kB)
[    0.000000]        .bss : 0x80681a14 - 0x806a161c   ( 128 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000] L2C-310 cache controller enabled, 8 ways, 512 kB
[    0.000000] L2C-310: CACHE_ID 0x410030c9, AUX_CTRL 0x46060001
[    0.000013] sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 42949672950ns
[    0.008119] Console: colour dummy device 80x30
[    0.012670] Calibrating delay loop... 1594.16 BogoMIPS (lpj=7970816)
[    0.052740] pid_max: default: 32768 minimum: 301
[    0.057509] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.064195] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.071877] CPU: Testing write buffer coherency: ok
[    0.077012] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.082841] Setting up static identity map for 0x47cc10 - 0x47cc68
[    1.139876] CPU1: failed to come online
[    1.143808] Brought up 1 CPUs
[    1.146851] SMP: Total of 1 processors activated (1594.16 BogoMIPS).

It looks like there actually is something wrong with the SMP setup. The SoC is a Cortex-A9 dual core and normally both CPUs are started. Maybe it has something to do with

	BUG: mapping for 0xfffec000 at 0xfffec000 out of vmalloc space

0xfffec000 is the SCU base address.

Regards,
Steffen

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#3 lore raw

Hi Steffen,

Quoted 82 lines · Steffen Trumtrar

Hi!

Quoted 20 lines · Russell King - ARM Linux
Quoted 7 lines · Steffen Trumtrar

I have run into a bug on the Socfpga platform. My boards sometimes fail to boot when I have the commit

commit 8b5c18f05621394eb108d3fbc9bf98b05e8162db
Author: Russell King <[email protected]>
Date: Mon Apr 28 15:55:59 2014 +0100

Quoted 7 lines

ARM: l2c: socfpga: convert to generic l2c OF initialisation

Remove the explicit call to l2x0_of_init(), converting to the generic infrastructure instead.

That should only result in the L2 cache being turned on earlier (before the secondary CPUs come up.) I wonder if there's a bug in the secondary CPU code which is being tickled by it.

Quoted 5 lines

What we need is some information on the failure - and as you've noticed, the failure occurs before the console is initialised. There's two solutions to that:

1. Enable early printk support (and hope that works)

Thanks. I actually got it working. Seems I had forgotten something in the config. So, the bootlog now prints

Uncompressing Linux... done, booting the kernel.

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Linux version 3.19.0-rc7-test-00001-g7c10eb5fb252 (str at dude) (gcc version 4.9.2 (OSELAS.Toolchain-2014.12.0) ) #163 SMP PREEMPT Mon Feb 9 16:35:27 CET 2015
[    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Terasic SoCkit
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] BUG: mapping for 0xfffec000 at 0xfffec000 out of vmalloc space
Early printk initialized
[    0.000000] PERCPU: Embedded 10 pages/cpu @bf7d4000 s11456 r8192 d21312 u40960
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk  ip=dhcp root=/dev/nfs nfsroot=/home/str/nfsroot/sockit,v3,tcp
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 1032636K/1048576K available (4716K kernel code, 222K rwdata, 1412K rodata, 276K init, 127K bss, 15940K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc0800000 - 0xff000000   (1000 MB)
[    0.000000]     lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
[    0.000000]     modules : 0x7f000000 - 0x80000000   (  16 MB)
[    0.000000]       .text : 0x80008000 - 0x806044d8   (6130 kB)
[    0.000000]       .init : 0x80605000 - 0x8064a000   ( 276 kB)
[    0.000000]       .data : 0x8064a000 - 0x80681a14   ( 223 kB)
[    0.000000]        .bss : 0x80681a14 - 0x806a161c   ( 128 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000] L2C-310 cache controller enabled, 8 ways, 512 kB
[    0.000000] L2C-310: CACHE_ID 0x410030c9, AUX_CTRL 0x46060001
[    0.000013] sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 42949672950ns
[    0.008119] Console: colour dummy device 80x30
[    0.012670] Calibrating delay loop... 1594.16 BogoMIPS (lpj=7970816)
[    0.052740] pid_max: default: 32768 minimum: 301
[    0.057509] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.064195] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.071877] CPU: Testing write buffer coherency: ok
[    0.077012] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.082841] Setting up static identity map for 0x47cc10 - 0x47cc68
[    1.139876] CPU1: failed to come online
[    1.143808] Brought up 1 CPUs
[    1.146851] SMP: Total of 1 processors activated (1594.16 BogoMIPS).
Quoted 8 lines

It looks like there actually is something wrong with the SMP setup. The SoC is a Cortex-A9 dual core and normally both CPUs are started. Maybe it has something to do with

	BUG: mapping for 0xfffec000 at 0xfffec000 out of vmalloc space

0xfffec000 is the SCU base address.

This printout has been there for quite a while. The fix should be to remove the static define SOCFPGA_SCU_VIRT_BASE. I have a patch for this queue up but haven't had a chance to send it yet.

I was able to recreate this error(only 1 CPU coming online), when I build for socfpga_defconfig. But I cannot seem to recreate it if I build for multi_v7_defconfig, both CPUs come up just fine.

Would it be possible for you to run your test with multi_v7_defconfig?

Thanks,
Dinh

#4 lore raw

Hi Dinh!

Quoted 89 lines · Dinh Nguyen

Hi Steffen,

Quoted 86 lines · Steffen Trumtrar

Hi!

Quoted 20 lines · Russell King - ARM Linux
Quoted 7 lines · Steffen Trumtrar

I have run into a bug on the Socfpga platform. My boards sometimes fail to boot when I have the commit

commit 8b5c18f05621394eb108d3fbc9bf98b05e8162db
Author: Russell King <[email protected]>
Date: Mon Apr 28 15:55:59 2014 +0100

Quoted 7 lines

ARM: l2c: socfpga: convert to generic l2c OF initialisation

Remove the explicit call to l2x0_of_init(), converting to the generic infrastructure instead.

That should only result in the L2 cache being turned on earlier (before the secondary CPUs come up.) I wonder if there's a bug in the secondary CPU code which is being tickled by it.

Quoted 5 lines

What we need is some information on the failure - and as you've noticed, the failure occurs before the console is initialised. There's two solutions to that:

1. Enable early printk support (and hope that works)

Thanks. I actually got it working. Seems I had forgotten something in the config. So, the bootlog now prints

Uncompressing Linux... done, booting the kernel.

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Linux version 3.19.0-rc7-test-00001-g7c10eb5fb252 (str at dude) (gcc version 4.9.2 (OSELAS.Toolchain-2014.12.0) ) #163 SMP PREEMPT Mon Feb 9 16:35:27 CET 2015
[    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Terasic SoCkit
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] BUG: mapping for 0xfffec000 at 0xfffec000 out of vmalloc space
Early printk initialized
[    0.000000] PERCPU: Embedded 10 pages/cpu @bf7d4000 s11456 r8192 d21312 u40960
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk  ip=dhcp root=/dev/nfs nfsroot=/home/str/nfsroot/sockit,v3,tcp
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 1032636K/1048576K available (4716K kernel code, 222K rwdata, 1412K rodata, 276K init, 127K bss, 15940K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc0800000 - 0xff000000   (1000 MB)
[    0.000000]     lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
[    0.000000]     modules : 0x7f000000 - 0x80000000   (  16 MB)
[    0.000000]       .text : 0x80008000 - 0x806044d8   (6130 kB)
[    0.000000]       .init : 0x80605000 - 0x8064a000   ( 276 kB)
[    0.000000]       .data : 0x8064a000 - 0x80681a14   ( 223 kB)
[    0.000000]        .bss : 0x80681a14 - 0x806a161c   ( 128 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000] L2C-310 cache controller enabled, 8 ways, 512 kB
[    0.000000] L2C-310: CACHE_ID 0x410030c9, AUX_CTRL 0x46060001
[    0.000013] sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 42949672950ns
[    0.008119] Console: colour dummy device 80x30
[    0.012670] Calibrating delay loop... 1594.16 BogoMIPS (lpj=7970816)
[    0.052740] pid_max: default: 32768 minimum: 301
[    0.057509] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.064195] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.071877] CPU: Testing write buffer coherency: ok
[    0.077012] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.082841] Setting up static identity map for 0x47cc10 - 0x47cc68
[    1.139876] CPU1: failed to come online
[    1.143808] Brought up 1 CPUs
[    1.146851] SMP: Total of 1 processors activated (1594.16 BogoMIPS).

It looks like there actually is something wrong with the SMP setup. The SoC is a Cortex-A9 dual core and normally both CPUs are started. Maybe it has something to do with

Quoted 9 lines
Quoted 4 lines
	BUG: mapping for 0xfffec000 at 0xfffec000 out of vmalloc space

0xfffec000 is the SCU base address.

This printout has been there for quite a while. The fix should be to remove the static define SOCFPGA_SCU_VIRT_BASE. I have a patch for this queue up but haven't had a chance to send it yet.

Cool.

Quoted 4 lines

I was able to recreate this error(only 1 CPU coming online), when I build for socfpga_defconfig. But I cannot seem to recreate it if I build for multi_v7_defconfig, both CPUs come up just fine.

Interessting.

Quoted 1 line

Would it be possible for you to run your test with multi_v7_defconfig?

No problem. Will do and get back with the result.

Regards,
Steffen

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#5 lore raw
Quoted 109 lines · Steffen Trumtrar

Hi Dinh!

Quoted 89 lines · Dinh Nguyen

Hi Steffen,

Quoted 86 lines · Steffen Trumtrar

Hi!

Quoted 20 lines · Russell King - ARM Linux
Quoted 7 lines · Steffen Trumtrar

I have run into a bug on the Socfpga platform. My boards sometimes fail to boot when I have the commit

commit 8b5c18f05621394eb108d3fbc9bf98b05e8162db
Author: Russell King <[email protected]>
Date: Mon Apr 28 15:55:59 2014 +0100

Quoted 7 lines

ARM: l2c: socfpga: convert to generic l2c OF initialisation

Remove the explicit call to l2x0_of_init(), converting to the generic infrastructure instead.

That should only result in the L2 cache being turned on earlier (before the secondary CPUs come up.) I wonder if there's a bug in the secondary CPU code which is being tickled by it.

Quoted 5 lines

What we need is some information on the failure - and as you've noticed, the failure occurs before the console is initialised. There's two solutions to that:

1. Enable early printk support (and hope that works)

Thanks. I actually got it working. Seems I had forgotten something in the config. So, the bootlog now prints

Uncompressing Linux... done, booting the kernel.

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Linux version 3.19.0-rc7-test-00001-g7c10eb5fb252 (str at dude) (gcc version 4.9.2 (OSELAS.Toolchain-2014.12.0) ) #163 SMP PREEMPT Mon Feb 9 16:35:27 CET 2015
[    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Terasic SoCkit
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] BUG: mapping for 0xfffec000 at 0xfffec000 out of vmalloc space
Early printk initialized
[    0.000000] PERCPU: Embedded 10 pages/cpu @bf7d4000 s11456 r8192 d21312 u40960
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk  ip=dhcp root=/dev/nfs nfsroot=/home/str/nfsroot/sockit,v3,tcp
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 1032636K/1048576K available (4716K kernel code, 222K rwdata, 1412K rodata, 276K init, 127K bss, 15940K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc0800000 - 0xff000000   (1000 MB)
[    0.000000]     lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
[    0.000000]     modules : 0x7f000000 - 0x80000000   (  16 MB)
[    0.000000]       .text : 0x80008000 - 0x806044d8   (6130 kB)
[    0.000000]       .init : 0x80605000 - 0x8064a000   ( 276 kB)
[    0.000000]       .data : 0x8064a000 - 0x80681a14   ( 223 kB)
[    0.000000]        .bss : 0x80681a14 - 0x806a161c   ( 128 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000] L2C-310 cache controller enabled, 8 ways, 512 kB
[    0.000000] L2C-310: CACHE_ID 0x410030c9, AUX_CTRL 0x46060001
[    0.000013] sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 42949672950ns
[    0.008119] Console: colour dummy device 80x30
[    0.012670] Calibrating delay loop... 1594.16 BogoMIPS (lpj=7970816)
[    0.052740] pid_max: default: 32768 minimum: 301
[    0.057509] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.064195] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.071877] CPU: Testing write buffer coherency: ok
[    0.077012] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.082841] Setting up static identity map for 0x47cc10 - 0x47cc68
[    1.139876] CPU1: failed to come online
[    1.143808] Brought up 1 CPUs
[    1.146851] SMP: Total of 1 processors activated (1594.16 BogoMIPS).

It looks like there actually is something wrong with the SMP setup. The SoC is a Cortex-A9 dual core and normally both CPUs are started. Maybe it has something to do with

Quoted 9 lines
Quoted 4 lines
	BUG: mapping for 0xfffec000 at 0xfffec000 out of vmalloc space

0xfffec000 is the SCU base address.

This printout has been there for quite a while. The fix should be to remove the static define SOCFPGA_SCU_VIRT_BASE. I have a patch for this queue up but haven't had a chance to send it yet.

Cool.

Quoted 4 lines

I was able to recreate this error(only 1 CPU coming online), when I build for socfpga_defconfig. But I cannot seem to recreate it if I build for multi_v7_defconfig, both CPUs come up just fine.

Quoted 6 lines

Interessting.

Quoted 1 line

Would it be possible for you to run your test with multi_v7_defconfig?

No problem. Will do and get back with the result.

Doesn't seem to make such a big difference for me. It still sometimes doesn't boot. (I can't give any statistics, because ktest.pl is sadly not very reliable in finding all successful/failed boots and I'm to lazy to count)

Regards,
Steffen

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#6 lore raw

Hi Steffen,

Quoted 114 lines · Steffen Trumtrar
Quoted 113 lines · Steffen Trumtrar

Hi Dinh!

Quoted 89 lines · Dinh Nguyen

Hi Steffen,

Quoted 86 lines · Steffen Trumtrar

Hi!

Quoted 20 lines · Russell King - ARM Linux
Quoted 7 lines · Steffen Trumtrar

I have run into a bug on the Socfpga platform. My boards sometimes fail to boot when I have the commit

commit 8b5c18f05621394eb108d3fbc9bf98b05e8162db
Author: Russell King <[email protected]>
Date: Mon Apr 28 15:55:59 2014 +0100

Quoted 7 lines

ARM: l2c: socfpga: convert to generic l2c OF initialisation

Remove the explicit call to l2x0_of_init(), converting to the generic infrastructure instead.

That should only result in the L2 cache being turned on earlier (before the secondary CPUs come up.) I wonder if there's a bug in the secondary CPU code which is being tickled by it.

Quoted 5 lines

What we need is some information on the failure - and as you've noticed, the failure occurs before the console is initialised. There's two solutions to that:

1. Enable early printk support (and hope that works)

Thanks. I actually got it working. Seems I had forgotten something in the config. So, the bootlog now prints

Uncompressing Linux... done, booting the kernel.

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Linux version 3.19.0-rc7-test-00001-g7c10eb5fb252 (str at dude) (gcc version 4.9.2 (OSELAS.Toolchain-2014.12.0) ) #163 SMP PREEMPT Mon Feb 9 16:35:27 CET 2015
[    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Terasic SoCkit
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] BUG: mapping for 0xfffec000 at 0xfffec000 out of vmalloc space
Early printk initialized
[    0.000000] PERCPU: Embedded 10 pages/cpu @bf7d4000 s11456 r8192 d21312 u40960
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk  ip=dhcp root=/dev/nfs nfsroot=/home/str/nfsroot/sockit,v3,tcp
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 1032636K/1048576K available (4716K kernel code, 222K rwdata, 1412K rodata, 276K init, 127K bss, 15940K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc0800000 - 0xff000000   (1000 MB)
[    0.000000]     lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
[    0.000000]     modules : 0x7f000000 - 0x80000000   (  16 MB)
[    0.000000]       .text : 0x80008000 - 0x806044d8   (6130 kB)
[    0.000000]       .init : 0x80605000 - 0x8064a000   ( 276 kB)
[    0.000000]       .data : 0x8064a000 - 0x80681a14   ( 223 kB)
[    0.000000]        .bss : 0x80681a14 - 0x806a161c   ( 128 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000] L2C-310 cache controller enabled, 8 ways, 512 kB
[    0.000000] L2C-310: CACHE_ID 0x410030c9, AUX_CTRL 0x46060001
[    0.000013] sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 42949672950ns
[    0.008119] Console: colour dummy device 80x30
[    0.012670] Calibrating delay loop... 1594.16 BogoMIPS (lpj=7970816)
[    0.052740] pid_max: default: 32768 minimum: 301
[    0.057509] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.064195] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.071877] CPU: Testing write buffer coherency: ok
[    0.077012] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.082841] Setting up static identity map for 0x47cc10 - 0x47cc68
[    1.139876] CPU1: failed to come online
[    1.143808] Brought up 1 CPUs
[    1.146851] SMP: Total of 1 processors activated (1594.16 BogoMIPS).

It looks like there actually is something wrong with the SMP setup. The SoC is a Cortex-A9 dual core and normally both CPUs are started. Maybe it has something to do with

Quoted 9 lines
Quoted 4 lines
	BUG: mapping for 0xfffec000 at 0xfffec000 out of vmalloc space

0xfffec000 is the SCU base address.

This printout has been there for quite a while. The fix should be to remove the static define SOCFPGA_SCU_VIRT_BASE. I have a patch for this queue up but haven't had a chance to send it yet.

Cool.

Quoted 4 lines

I was able to recreate this error(only 1 CPU coming online), when I build for socfpga_defconfig. But I cannot seem to recreate it if I build for multi_v7_defconfig, both CPUs come up just fine.

Interessting.

Quoted 1 line

Would it be possible for you to run your test with multi_v7_defconfig?

Quoted 8 lines
Quoted 2 lines

No problem. Will do and get back with the result.

Doesn't seem to make such a big difference for me. It still sometimes doesn't boot. (I can't give any statistics, because ktest.pl is sadly not very reliable in finding all successful/failed boots and I'm to lazy to count)

Yes, after a while I can reproduce it with both socfpga_defconfig and multi_v7_defconfig. Just seems that the failure is easier to reproduce with socfpga_defconfig.

Like Russell said, it seems that enabling the L2 before bringing up the secondary CPU is triggering a bug somewhere.

I'm digging around.

Thanks,
Dinh

#7 lore raw

Hi Dinh,

Quoted 126 lines · Dinh Nguyen

Hi Steffen,

Quoted 114 lines · Steffen Trumtrar
Quoted 113 lines · Steffen Trumtrar

Hi Dinh!

Quoted 89 lines · Dinh Nguyen

Hi Steffen,

Quoted 86 lines · Steffen Trumtrar

Hi!

Quoted 20 lines · Russell King - ARM Linux
Quoted 7 lines · Steffen Trumtrar

I have run into a bug on the Socfpga platform. My boards sometimes fail to boot when I have the commit

commit 8b5c18f05621394eb108d3fbc9bf98b05e8162db
Author: Russell King <[email protected]>
Date: Mon Apr 28 15:55:59 2014 +0100

Quoted 7 lines

ARM: l2c: socfpga: convert to generic l2c OF initialisation

Remove the explicit call to l2x0_of_init(), converting to the generic infrastructure instead.

That should only result in the L2 cache being turned on earlier (before the secondary CPUs come up.) I wonder if there's a bug in the secondary CPU code which is being tickled by it.

Quoted 5 lines

What we need is some information on the failure - and as you've noticed, the failure occurs before the console is initialised. There's two solutions to that:

1. Enable early printk support (and hope that works)

Thanks. I actually got it working. Seems I had forgotten something in the config. So, the bootlog now prints

Uncompressing Linux... done, booting the kernel.

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Linux version 3.19.0-rc7-test-00001-g7c10eb5fb252 (str at dude) (gcc version 4.9.2 (OSELAS.Toolchain-2014.12.0) ) #163 SMP PREEMPT Mon Feb 9 16:35:27 CET 2015
[    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Terasic SoCkit
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] BUG: mapping for 0xfffec000 at 0xfffec000 out of vmalloc space
Early printk initialized
[    0.000000] PERCPU: Embedded 10 pages/cpu @bf7d4000 s11456 r8192 d21312 u40960
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk  ip=dhcp root=/dev/nfs nfsroot=/home/str/nfsroot/sockit,v3,tcp
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 1032636K/1048576K available (4716K kernel code, 222K rwdata, 1412K rodata, 276K init, 127K bss, 15940K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc0800000 - 0xff000000   (1000 MB)
[    0.000000]     lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
[    0.000000]     modules : 0x7f000000 - 0x80000000   (  16 MB)
[    0.000000]       .text : 0x80008000 - 0x806044d8   (6130 kB)
[    0.000000]       .init : 0x80605000 - 0x8064a000   ( 276 kB)
[    0.000000]       .data : 0x8064a000 - 0x80681a14   ( 223 kB)
[    0.000000]        .bss : 0x80681a14 - 0x806a161c   ( 128 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000] L2C-310 cache controller enabled, 8 ways, 512 kB
[    0.000000] L2C-310: CACHE_ID 0x410030c9, AUX_CTRL 0x46060001
[    0.000013] sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 42949672950ns
[    0.008119] Console: colour dummy device 80x30
[    0.012670] Calibrating delay loop... 1594.16 BogoMIPS (lpj=7970816)
[    0.052740] pid_max: default: 32768 minimum: 301
[    0.057509] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.064195] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.071877] CPU: Testing write buffer coherency: ok
[    0.077012] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.082841] Setting up static identity map for 0x47cc10 - 0x47cc68
[    1.139876] CPU1: failed to come online
[    1.143808] Brought up 1 CPUs
[    1.146851] SMP: Total of 1 processors activated (1594.16 BogoMIPS).

It looks like there actually is something wrong with the SMP setup. The SoC is a Cortex-A9 dual core and normally both CPUs are started. Maybe it has something to do with

Quoted 9 lines
Quoted 4 lines
	BUG: mapping for 0xfffec000 at 0xfffec000 out of vmalloc space

0xfffec000 is the SCU base address.

This printout has been there for quite a while. The fix should be to remove the static define SOCFPGA_SCU_VIRT_BASE. I have a patch for this queue up but haven't had a chance to send it yet.

Cool.

Quoted 4 lines

I was able to recreate this error(only 1 CPU coming online), when I build for socfpga_defconfig. But I cannot seem to recreate it if I build for multi_v7_defconfig, both CPUs come up just fine.

Interessting.

Quoted 1 line

Would it be possible for you to run your test with multi_v7_defconfig?

Quoted 8 lines
Quoted 2 lines

No problem. Will do and get back with the result.

Doesn't seem to make such a big difference for me. It still sometimes doesn't boot. (I can't give any statistics, because ktest.pl is sadly not very reliable in finding all successful/failed boots and I'm to lazy to count)

Quoted 4 lines

Yes, after a while I can reproduce it with both socfpga_defconfig and multi_v7_defconfig. Just seems that the failure is easier to reproduce with socfpga_defconfig.

That is "good". At least it shows, that there is a common bug for SoCFPGA and not only in my setup.

Quoted 3 lines

Like Russell said, it seems that enabling the L2 before bringing up the secondary CPU is triggering a bug somewhere.

Yes, seems very likely that Russell is right.

Quoted 2 lines

I'm digging around.

Great.

Thanks,
Steffen

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#8 lore raw
Quoted 134 lines · Steffen Trumtrar

Hi Dinh,

Quoted 126 lines · Dinh Nguyen

Hi Steffen,

Quoted 114 lines · Steffen Trumtrar
Quoted 113 lines · Steffen Trumtrar

Hi Dinh!

Quoted 89 lines · Dinh Nguyen

Hi Steffen,

Quoted 86 lines · Steffen Trumtrar

Hi!

Quoted 20 lines · Russell King - ARM Linux
Quoted 7 lines · Steffen Trumtrar

I have run into a bug on the Socfpga platform. My boards sometimes fail to boot when I have the commit

commit 8b5c18f05621394eb108d3fbc9bf98b05e8162db
Author: Russell King <[email protected]>
Date: Mon Apr 28 15:55:59 2014 +0100

Quoted 7 lines

ARM: l2c: socfpga: convert to generic l2c OF initialisation

Remove the explicit call to l2x0_of_init(), converting to the generic infrastructure instead.

That should only result in the L2 cache being turned on earlier (before the secondary CPUs come up.) I wonder if there's a bug in the secondary CPU code which is being tickled by it.

Quoted 5 lines

What we need is some information on the failure - and as you've noticed, the failure occurs before the console is initialised. There's two solutions to that:

1. Enable early printk support (and hope that works)

Thanks. I actually got it working. Seems I had forgotten something in the config. So, the bootlog now prints

Uncompressing Linux... done, booting the kernel.

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Linux version 3.19.0-rc7-test-00001-g7c10eb5fb252 (str at dude) (gcc version 4.9.2 (OSELAS.Toolchain-2014.12.0) ) #163 SMP PREEMPT Mon Feb 9 16:35:27 CET 2015
[    0.000000] CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine model: Terasic SoCkit
[    0.000000] bootconsole [earlycon0] enabled
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] BUG: mapping for 0xfffec000 at 0xfffec000 out of vmalloc space
Early printk initialized
[    0.000000] PERCPU: Embedded 10 pages/cpu @bf7d4000 s11456 r8192 d21312 u40960
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 260096
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk  ip=dhcp root=/dev/nfs nfsroot=/home/str/nfsroot/sockit,v3,tcp
[    0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Memory: 1032636K/1048576K available (4716K kernel code, 222K rwdata, 1412K rodata, 276K init, 127K bss, 15940K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc0800000 - 0xff000000   (1000 MB)
[    0.000000]     lowmem  : 0x80000000 - 0xc0000000   (1024 MB)
[    0.000000]     modules : 0x7f000000 - 0x80000000   (  16 MB)
[    0.000000]       .text : 0x80008000 - 0x806044d8   (6130 kB)
[    0.000000]       .init : 0x80605000 - 0x8064a000   ( 276 kB)
[    0.000000]       .data : 0x8064a000 - 0x80681a14   ( 223 kB)
[    0.000000]        .bss : 0x80681a14 - 0x806a161c   ( 128 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] L2C-310 enabling early BRESP for Cortex-A9
[    0.000000] L2C-310 full line of zeros enabled for Cortex-A9
[    0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled
[    0.000000] L2C-310 cache controller enabled, 8 ways, 512 kB
[    0.000000] L2C-310: CACHE_ID 0x410030c9, AUX_CTRL 0x46060001
[    0.000013] sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 42949672950ns
[    0.008119] Console: colour dummy device 80x30
[    0.012670] Calibrating delay loop... 1594.16 BogoMIPS (lpj=7970816)
[    0.052740] pid_max: default: 32768 minimum: 301
[    0.057509] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.064195] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.071877] CPU: Testing write buffer coherency: ok
[    0.077012] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.082841] Setting up static identity map for 0x47cc10 - 0x47cc68
[    1.139876] CPU1: failed to come online
[    1.143808] Brought up 1 CPUs
[    1.146851] SMP: Total of 1 processors activated (1594.16 BogoMIPS).

It looks like there actually is something wrong with the SMP setup. The SoC is a Cortex-A9 dual core and normally both CPUs are started. Maybe it has something to do with

Quoted 9 lines
Quoted 4 lines
 BUG: mapping for 0xfffec000 at 0xfffec000 out of vmalloc space

0xfffec000 is the SCU base address.

This printout has been there for quite a while. The fix should be to remove the static define SOCFPGA_SCU_VIRT_BASE. I have a patch for this queue up but haven't had a chance to send it yet.

Cool.

Quoted 4 lines

I was able to recreate this error(only 1 CPU coming online), when I build for socfpga_defconfig. But I cannot seem to recreate it if I build for multi_v7_defconfig, both CPUs come up just fine.

Interessting.

Quoted 1 line

Would it be possible for you to run your test with multi_v7_defconfig?

Quoted 8 lines
Quoted 2 lines

No problem. Will do and get back with the result.

Doesn't seem to make such a big difference for me. It still sometimes doesn't boot. (I can't give any statistics, because ktest.pl is sadly not very reliable in finding all successful/failed boots and I'm to lazy to count)

Quoted 4 lines

Yes, after a while I can reproduce it with both socfpga_defconfig and multi_v7_defconfig. Just seems that the failure is easier to reproduce with socfpga_defconfig.

Quoted 8 lines

That is "good". At least it shows, that there is a common bug for SoCFPGA and not only in my setup.

Quoted 3 lines

Like Russell said, it seems that enabling the L2 before bringing up the secondary CPU is triggering a bug somewhere.

Yes, seems very likely that Russell is right.

The bug doesn't happen if I disable the L2. Digging more...

Dinh

#9 lore raw
Quoted 5 lines · Dinh Nguyen
Quoted 1 line · Steffen Trumtrar

Yes, seems very likely that Russell is right.

The bug doesn't happen if I disable the L2. Digging more...

What ensures that the value written to socfpga_cpu1start_addr (by of_property_read_u32() in socfpga_sysmgr_init(), called at .init_irq time) is visible to the secondary CPU?

Quoted 1 line

From what I can see, the physical address written there is not

guaranteed to be flushed from all levels of cache.

The flush_cache_all() in socfpga_boot_secondary() won't do the job - that won't touch the L2C-310.

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
#10 lore raw
Quoted 10 lines · Russell King - ARM Linux
Quoted 5 lines · Dinh Nguyen
Quoted 1 line · Steffen Trumtrar

Yes, seems very likely that Russell is right.

The bug doesn't happen if I disable the L2. Digging more...

What ensures that the value written to socfpga_cpu1start_addr (by of_property_read_u32() in socfpga_sysmgr_init(), called at .init_irq time) is visible to the secondary CPU?

Yes, I was able use a JTAG debugger and can see that the secondary CPU is not seeing socfpga_cpu1start_addr correctly when the error occurs.

Quoted 7 lines

From what I can see, the physical address written there is not guaranteed to be flushed from all levels of cache.

The flush_cache_all() in socfpga_boot_secondary() won't do the job - that won't touch the L2C-310.

Do you have a recommendation on what should be done?

Thanks,
Dinh

#11 lore raw
Quoted 9 lines · Dinh Nguyen
Quoted 7 lines · Russell King - ARM Linux
Quoted 5 lines · Dinh Nguyen
Quoted 1 line · Steffen Trumtrar

Yes, seems very likely that Russell is right.

The bug doesn't happen if I disable the L2. Digging more...

Quoted 8 lines
Quoted 3 lines

What ensures that the value written to socfpga_cpu1start_addr (by of_property_read_u32() in socfpga_sysmgr_init(), called at .init_irq time) is visible to the secondary CPU?

Yes, I was able use a JTAG debugger and can see that the secondary CPU is not seeing socfpga_cpu1start_addr correctly when the error occurs.

\o/ very good. That sounds like the bug can be fixed soon.

Thanks,
Steffen

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#12 lore raw
In reply to Dinh Nguyen
Quoted 1 line · Dinh Nguyen

Do you have a recommendation on what should be done?

Please try this:

 arch/arm/mach-socfpga/socfpga.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-socfpga/socfpga.c +5 -0
index 383d61e138af..f5e597c207b9 100644
@@ -23,6 +23,7 @@
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/cacheflush.h>
 
 #include "core.h"
 
@@ -73,6 +74,10 @@ void __init socfpga_sysmgr_init(void)
 			(u32 *) &socfpga_cpu1start_addr))
 		pr_err("SMP: Need cpu1-start-addr in device tree.\n");
 
+	/* Ensure that socfpga_cpu1start_addr is visible to other CPUs */
+	smp_wmb();
+	sync_cache_w(&socfpga_cpu1start_addr);
+
 	sys_manager_base_addr = of_iomap(np, 0);
 
 	np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");
Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
Tested-by
#13 lore raw
Quoted 23 lines · Russell King - ARM Linux
Quoted 1 line · Dinh Nguyen

Do you have a recommendation on what should be done?

Please try this:

 arch/arm/mach-socfpga/socfpga.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-socfpga/socfpga.c +1 -0
index 383d61e138af..f5e597c207b9 100644
@@ -23,6 +23,7 @@
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/cacheflush.h>
 
 #include "core.h"
 
@@ -73,6 +74,10 @@ void __init socfpga_sysmgr_init(void)
                        (u32 *) &socfpga_cpu1start_addr))
                pr_err("SMP: Need cpu1-start-addr in device tree.\n");

arch/arm/mach-socfpga/socfpga.c void __init socfpga_sysmgr_init(void)

Quoted 10 lines
arch/arm/mach-socfpga/socfpga.c +4 -1
 
+       /* Ensure that socfpga_cpu1start_addr is visible to other CPUs */
+       smp_wmb();
+       sync_cache_w(&socfpga_cpu1start_addr);
+
        sys_manager_base_addr = of_iomap(np, 0);
 
        np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");
 
--

Thanks Russell! I have been able to run the test for > 30 minutes now with both cores coming up just fine.

Do you mind taking this patch for 4.0-rc? If so,

Steffen, if you don't mind, do you want to test on your setup as well?

Thanks,
Dinh

#14 lore raw
Quoted 32 lines · Dinh Nguyen
Quoted 30 lines · Russell King - ARM Linux
Quoted 1 line · Dinh Nguyen

Do you have a recommendation on what should be done?

Please try this:

 arch/arm/mach-socfpga/socfpga.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-socfpga/socfpga.c +5 -0
index 383d61e138af..f5e597c207b9 100644
@@ -23,6 +23,7 @@
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/cacheflush.h>
 
 #include "core.h"
 
@@ -73,6 +74,10 @@ void __init socfpga_sysmgr_init(void)
                        (u32 *) &socfpga_cpu1start_addr))
                pr_err("SMP: Need cpu1-start-addr in device tree.\n");
 
+       /* Ensure that socfpga_cpu1start_addr is visible to other CPUs */
+       smp_wmb();
+       sync_cache_w(&socfpga_cpu1start_addr);
+
        sys_manager_base_addr = of_iomap(np, 0);
 
Quoted 8 lines

arch/arm/mach-socfpga/socfpga.c void __init socfpga_sysmgr_init(void)

Quoted 3 lines
arch/arm/mach-socfpga/socfpga.c +0 -1
        np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");
 
--

Thanks Russell! I have been able to run the test for > 30 minutes now with both cores coming up just fine.

\o/ That sounds very good.

Quoted 6 lines

Do you mind taking this patch for 4.0-rc? If so,

Steffen, if you don't mind, do you want to test on your setup as well?

Yes, of course. Let's see how fast I can get my test running again, my Sockit is at the Embedded World ATM :-(

Thanks,
Steffen

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
author Tested-by
#15 lore raw
In reply to Dinh Nguyen
Quoted 40 lines · Dinh Nguyen
Quoted 23 lines · Russell King - ARM Linux
Quoted 1 line · Dinh Nguyen

Do you have a recommendation on what should be done?

Please try this:

 arch/arm/mach-socfpga/socfpga.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-socfpga/socfpga.c +1 -0
index 383d61e138af..f5e597c207b9 100644
@@ -23,6 +23,7 @@
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/cacheflush.h>
 
 #include "core.h"
 
@@ -73,6 +74,10 @@ void __init socfpga_sysmgr_init(void)
                        (u32 *) &socfpga_cpu1start_addr))
                pr_err("SMP: Need cpu1-start-addr in device tree.\n");

arch/arm/mach-socfpga/socfpga.c void __init socfpga_sysmgr_init(void)

Quoted 10 lines
arch/arm/mach-socfpga/socfpga.c +4 -1
 
+       /* Ensure that socfpga_cpu1start_addr is visible to other CPUs */
+       smp_wmb();
+       sync_cache_w(&socfpga_cpu1start_addr);
+
        sys_manager_base_addr = of_iomap(np, 0);
 
        np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");
 
--

Thanks Russell! I have been able to run the test for > 30 minutes now with both cores coming up just fine.

Quoted 5 lines

Do you mind taking this patch for 4.0-rc? If so,

Steffen, if you don't mind, do you want to test on your setup as well?

Looks good for me, too:

Thanks,
Steffen

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#16 lore raw
Quoted 43 lines · Steffen Trumtrar
Quoted 42 lines · Dinh Nguyen
Quoted 23 lines · Russell King - ARM Linux
Quoted 1 line · Dinh Nguyen

Do you have a recommendation on what should be done?

Please try this:

 arch/arm/mach-socfpga/socfpga.c | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/mach-socfpga/socfpga.c +1 -0
index 383d61e138af..f5e597c207b9 100644
@@ -23,6 +23,7 @@
 #include <asm/hardware/cache-l2x0.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/cacheflush.h>
 
 #include "core.h"
 
@@ -73,6 +74,10 @@ void __init socfpga_sysmgr_init(void)
                        (u32 *) &socfpga_cpu1start_addr))
                pr_err("SMP: Need cpu1-start-addr in device tree.\n");

arch/arm/mach-socfpga/socfpga.c void __init socfpga_sysmgr_init(void)

Quoted 10 lines
arch/arm/mach-socfpga/socfpga.c +4 -1
 
+       /* Ensure that socfpga_cpu1start_addr is visible to other CPUs */
+       smp_wmb();
+       sync_cache_w(&socfpga_cpu1start_addr);
+
        sys_manager_base_addr = of_iomap(np, 0);
 
        np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");
 
--

Thanks Russell! I have been able to run the test for > 30 minutes now with both cores coming up just fine.

Do you mind taking this patch for 4.0-rc? If so,

Quoted 8 lines
Quoted 3 lines

Steffen, if you don't mind, do you want to test on your setup as well?

Looks good for me, too:

Steffen, thanks for testing.

Russell, if you don't mind, I'll take this patch through my tree as I have a couple of other fixes for 4.0-rc as well.

Thanks,
Dinh

#17 lore raw
Quoted 10 lines · Dinh Nguyen
Quoted 4 lines · Steffen Trumtrar

Looks good for me, too:

Steffen, thanks for testing.

Russell, if you don't mind, I'll take this patch through my tree as I have a couple of other fixes for 4.0-rc as well.

That's fine, especially as I've been recovering post-op.

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.