public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] ARM: Make CPU_DCACHE_DISABLE depend on !SMP
Date: Thu, 08 Jan 2015 09:33:05 +0100	[thread overview]
Message-ID: <2868984.6iP3luxIAM@wuerfel> (raw)
In-Reply-To: <1420683088-1856-1-git-send-email-f.fainelli@gmail.com>

On Wednesday 07 January 2015 18:11:28 Florian Fainelli wrote:
> Enabling CPU_DCACHE_DISABLE on a SMP capable system will prevent the
> kernel from booting because of the following ldrex instruction in
> arch_spin_lock:
> 
> (gdb) x/10i $pc
> => 0xc053cfa8 <_raw_spin_lock+4>:       ldrex   r3, [r0]
>    0xc053cfac <_raw_spin_lock+8>:       add     r2, r3, #65536  ; 0x10000
> 
> which is taken by the very first printk call:
> 
>     at /home/fainelli/work/linux/arch/arm/include/asm/spinlock.h:65
>     fmt=0xc0637650 "\001\066Booting Linux on physical CPU 0x%x\n", args=<incomplete type>)
>     at kernel/printk/printk.c:1525
>     fmt=0xc05370f4 <printk+52> "\024\320\215\342\004\340\235\344\020\320\215\342\036\377/\341\017") at kernel/printk/printk.c:1688
> 
> ldrex requires exclusive monitor(s) (local or global) which are no longer
> working when the Data cache is disabled in CP15 and will just hang the CPU
> there.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

We stumbled on this a while back when Kaixu was trying to fix allmodconfig
builds to run on real hardware, but never submitted it in the end when
Russell didn't like some of the other parts required for that to work.

This one clearly makes sense independently.

> diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
> index 03823e784f63..09245fd1e900 100644
> --- a/arch/arm/mm/Kconfig
> +++ b/arch/arm/mm/Kconfig
> @@ -738,7 +738,7 @@ config CPU_ICACHE_DISABLE
>  
>  config CPU_DCACHE_DISABLE
>  	bool "Disable D-Cache (C-bit)"
> -	depends on CPU_CP15
> +	depends on CPU_CP15 && !SMP
>  	help
>  	  Say Y here to disable the processor data cache. Unless
>  	  you have a reason not to or are unsure, say N.
> 

  reply	other threads:[~2015-01-08  8:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08  2:11 [RFC] ARM: Make CPU_DCACHE_DISABLE depend on !SMP Florian Fainelli
2015-01-08  8:33 ` Arnd Bergmann [this message]
2015-01-08 11:52   ` Russell King - ARM Linux
2015-01-08 15:53     ` Florian Fainelli
2015-01-08 21:54       ` Gregory Fong
2015-01-08 22:10         ` Arnd Bergmann
2015-01-08 22:13           ` Russell King - ARM Linux
2015-01-08 22:25             ` Florian Fainelli
2015-01-09 16:16               ` Russell King - ARM Linux
2015-01-09 18:35                 ` Florian Fainelli
2015-01-08 22:11         ` Gregory Fong
2015-01-09 17:57 ` Rabin Vincent

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=2868984.6iP3luxIAM@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.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