From patchwork Wed Jan 30 16:40:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 2068711 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 3B77D3FD2B for ; Wed, 30 Jan 2013 16:43:32 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U0aic-0005TH-KV; Wed, 30 Jan 2013 16:41:02 +0000 Received: from service88.mimecast.com ([195.130.217.12]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1U0aiX-0005Qj-Vp for linux-arm-kernel@lists.infradead.org; Wed, 30 Jan 2013 16:40:59 +0000 Received: from emea-cam-gw1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) (Using TLS) by service88.mimecast.com; Wed, 30 Jan 2013 16:40:53 +0000 Received: from [10.1.193.144] (10.1.2.13) by emea-cam-gw1.Emea.Arm.com (10.1.248.203) with Microsoft SMTP Server id 8.2.254.0; Wed, 30 Jan 2013 16:40:50 +0000 Message-ID: <51094D12.60304@arm.com> Date: Wed, 30 Jan 2013 16:40:50 +0000 From: Punit Agrawal User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: Lorenzo Pieralisi Subject: Re: Commit 384a290283fde63ba8dc671fca5420111cdac19a seems to break 11MPCore boot References: <51093B0B.7010708@arm.com> <20130130160405.GC20593@e102568-lin.cambridge.arm.com> In-Reply-To: <20130130160405.GC20593@e102568-lin.cambridge.arm.com> X-MC-Unique: 113013016405302302 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130130_114058_390809_2803ED23 X-CRM114-Status: GOOD ( 30.16 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [195.130.217.12 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Nicolas Pitre , Will Deacon , Pawel Moll , "linux-arm-kernel@lists.infradead.org >> \"linux-arm-kernel@lists.infradead.org\"" , Steve Capper X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hi Lorenzo, On 30/01/13 16:04, Lorenzo Pieralisi wrote: > On Wed, Jan 30, 2013 at 03:23:55PM +0000, Punit Agrawal wrote: >> Hi Nicolas, >> >> I was trying to boot 3.8-rc5 on Realview EB 11MPCore using realview-smp_defconfig as a starting point but the kernel failed to progress past the log below (config attached). >> >> Pawel suggested I try reverting 384a290283fde63ba8dc671fca5420111cdac19a - "ARM: gic: use a private mapping for CPU target interfaces" that you've authored. With this commit reverted the kernel boots. >> >> I am not quite sure why the commit breaks 11MPCore but Pawel (cc'd) might be able to shed light on that. > > I *think* it is because in the ARM11MPcore GIC > > dist_base + GIC_DIST_TARGET > > is RAZ for IT0-IT28. To give it a go you should change code in > > gic_cpu_init() > > and read (GIC_DIST_TARGET + 0x1c) (where IT29 starts) > > if I am not mistaken, since that will return the GIC CPU IF ID of the > reading CPU. With the following changes the kernel boots up further - $ git diff * Clear our mask from the other map entries in case they're But doesn't go all the way to init. Bytes transferred = 2350832 (23def0 hex) ## Booting kernel from Legacy Image at 00007fc0 ... Image Name: Linux-3.8.0-rc5-dirty Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 2350768 Bytes = 2.2 MB Load Address: 00008000 Entry Point: 00008000 Loading Kernel Image ... OK OK Starting kernel ... Uncompressing Linux... done, booting the kernel. Booting Linux on physical CPU 0x0 Linux version 3.8.0-rc5-dirty (punagr01@e102309-lin) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #34 SMP Wed Jan 30 16:28:02 GMT 2013 CPU: ARMv6-compatible processor [410fb020] revision 0 (ARMv7), cr=00c5387d CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache Machine: ARM-RealView EB Ignoring unrecognised tag 0x00000000 bootconsole [earlycon0] enabled Memory policy: ECC disabled, Data cache writealloc sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms PERCPU: Embedded 8 pages/cpu @c070b000 s9920 r8192 d14656 u32768 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024 Kernel command line: root=/dev/nfs ip=dhcp console=ttyAMA0 nfsroot=10.1.193.144:/work/filesystems/11MPCore earlyprintk PID hash table entries: 1024 (order: 0, 4096 bytes) Dentry cache hash table entries: 32768 (order: 5, 131072 bytes) Inode-cache hash table entries: 16384 (order: 4, 65536 bytes) __ex_table already sorted, skipping sort Memory: 256MB = 256MB total Memory: 254596k/254596k available, 7548k reserved, 0K highmem Virtual kernel memory layout: vector : 0xffff0000 - 0xffff1000 ( 4 kB) fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB) vmalloc : 0xd0800000 - 0xff000000 ( 744 MB) lowmem : 0xc0000000 - 0xd0000000 ( 256 MB) modules : 0xbf000000 - 0xc0000000 ( 16 MB) .text : 0xc0008000 - 0xc0457d78 (4416 kB) .init : 0xc0458000 - 0xc048d6c0 ( 214 kB) .data : 0xc048e000 - 0xc04c8db0 ( 236 kB) .bss : 0xc04c8db0 - 0xc05076e8 ( 251 kB) Hierarchical RCU implementation. NR_IRQS:128 cpu: 0, cpu_mask: 0x00000001 ------------[ cut here ]------------ WARNING: at arch/arm/common/gic.c:741 gic_init_bases+0x118/0x2ac() Cannot allocate irq_descs @ IRQ96, assuming pre-allocated Modules linked in: [] (unwind_backtrace+0x0/0xfc) from [] (dump_stack+0x20/0x24) [] (dump_stack+0x20/0x24) from [] (warn_slowpath_common+0x5c/0x74) [] (warn_slowpath_common+0x5c/0x74) from [] (warn_slowpath_fmt+0x40/0x48) [] (warn_slowpath_fmt+0x40/0x48) from [] (gic_init_bases+0x118/0x2ac) [] (gic_init_bases+0x118/0x2ac) from [] (gic_init_irq+0x78/0xc4) [] (gic_init_irq+0x78/0xc4) from [] (init_IRQ+0x1c/0x24) [] (init_IRQ+0x1c/0x24) from [] (start_kernel+0x198/0x29c) [] (start_kernel+0x198/0x29c) from [<00008078>] (0x8078) ---[ end trace 1b75b31a2719ed1c ]--- ------------[ cut here ]------------ WARNING: at kernel/irq/irqdomain.c:234 irq_domain_add_legacy+0x84/0x144() Modules linked in: [] (unwind_backtrace+0x0/0xfc) from [] (dump_stack+0x20/0x24) [] (dump_stack+0x20/0x24) from [] (warn_slowpath_common+0x5c/0x74) [] (warn_slowpath_common+0x5c/0x74) from [] (warn_slowpath_null+0x2c/0x34) [] (warn_slowpath_null+0x2c/0x34) from [] (irq_domain_add_legacy+0x84/0x144) [] (irq_domain_add_legacy+0x84/0x144) from [] (gic_init_bases+0x138/0x2ac) [] (gic_init_bases+0x138/0x2ac) from [] (gic_init_irq+0x78/0xc4) [] (gic_init_irq+0x78/0xc4) from [] (init_IRQ+0x1c/0x24) [] (init_IRQ+0x1c/0x24) from [] (start_kernel+0x198/0x29c) [] (start_kernel+0x198/0x29c) from [<00008078>] (0x8078) ---[ end trace 1b75b31a2719ed1d ]--- ------------[ cut here ]------------ WARNING: at arch/arm/common/gic.c:746 gic_init_bases+0x150/0x2ac() Modules linked in: [] (unwind_backtrace+0x0/0xfc) from [] (dump_stack+0x20/0x24) [] (dump_stack+0x20/0x24) from [] (warn_slowpath_common+0x5c/0x74) [] (warn_slowpath_common+0x5c/0x74) from [] (warn_slowpath_null+0x2c/0x34) [] (warn_slowpath_null+0x2c/0x34) from [] (gic_init_bases+0x150/0x2ac) [] (gic_init_bases+0x150/0x2ac) from [] (gic_init_irq+0x78/0xc4) [] (gic_init_irq+0x78/0xc4) from [] (init_IRQ+0x1c/0x24) [] (init_IRQ+0x1c/0x24) from [] (start_kernel+0x198/0x29c) [] (start_kernel+0x198/0x29c) from [<00008078>] (0x8078) ---[ end trace 1b75b31a2719ed1e ]--- Console: colour dummy device 80x30 Calibrating delay loop... 80.69 BogoMIPS (lpj=403456) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 512 CPU: Testing write buffer coherency: ok ftrace: allocating 12715 entries in 38 pages smp_twd: clock not found: -2 Calibrating local timer... 104.75MHz. Setting up static identity map for 0x32d900 - 0x32d95c CPU1: Booted secondary processor cpu: 1, cpu_mask: 0x00000002 CPU2: Booted secondary processor cpu: 2, cpu_mask: 0x00000004 CPU3: Booted secondary processor cpu: 3, cpu_mask: 0x00000008 Brought up 4 CPUs SMP: Total of 4 processors activated (330.75 BogoMIPS). NET: Registered protocol family 16 DMA: preallocated 256 KiB pool for atomic coherent allocations L2x0 series cache controller enabled l2x0: 8 ways, CACHE_ID 0x00000080, AUX_CTRL 0x00790fff, Cache size: 1048576 B Serial: AMBA PL011 UART driver dev:uart0: ttyAMA0 at MMIO 0x10009000 (irq = 36) is a PL011 rev2 console [ttyAMA0] enabled, bootconsole disabled console [ttyAMA0] enabled, bootconsole disabled dev:uart1: ttyAMA1 at MMIO 0x1000a000 (irq = 37) is a PL011 rev2 dev:uart2: ttyAMA2 at MMIO 0x1000b000 (irq = 0) is a PL011 rev2 fpga:uart3: ttyAMA3 at MMIO 0x1000c000 (irq = 0) is a PL011 rev2 bio: create slab at 0 ssp-pl022 dev:ssp0: ARM PL022 driver, device ID: 0x00041022 pl022: mapped registers from 0x1000d000 to d0876000 ssp-pl022 dev:ssp0: probe - cannot get IRQ (-22) ssp-pl022: probe of dev:ssp0 failed with error -22 Advanced Linux Sound Architecture Driver Initialized. Switching to clocksource timer3 NET: Registered protocol family 2 TCP established hash table entries: 2048 (order: 2, 16384 bytes) TCP bind hash table entries: 2048 (order: 2, 16384 bytes) TCP: Hash tables configured (established 2048 bind 2048) TCP: reno registered UDP hash table entries: 256 (order: 1, 8192 bytes) UDP-Lite hash table entries: 256 (order: 1, 8192 bytes) NET: Registered protocol family 1 RPC: Registered named UNIX socket transport module. RPC: Registered udp transport module. RPC: Registered tcp transport module. RPC: Registered tcp NFSv4.1 backchannel transport module. msgmni has been set to 497 io scheduler noop registered io scheduler deadline registered (default) clcd-pl11x dev:clcd: PL111 rev0 at 0x10020000 > > Just guessing, hope it helps, > > Lorenzo > >> >> I'd be happy to test a fix as I have the board on my desk for a bit. >> >> Thanks, >> >> Punit -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c index 36ae03a..68f6368 100644 --- a/arch/arm/common/gic.c +++ b/arch/arm/common/gic.c @@ -400,8 +400,11 @@ static void __cpuinit gic_cpu_init(struct gic_chip_data *gic) * Get what the GIC says our CPU mask is. */ BUG_ON(cpu >= NR_GIC_CPU_IF); - cpu_mask = readl_relaxed(dist_base + GIC_DIST_TARGET + 0); + cpu_mask = readl_relaxed(dist_base + GIC_DIST_TARGET + 0x1c); + cpu_mask = (cpu_mask & 0xff00) >> 8; + gic_cpu_map[cpu] = cpu_mask; + printk(KERN_INFO "cpu: %d, cpu_mask: 0x%08x\n", cpu, cpu_mask); /*