All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stuart Menefy <stuart.menefy@st.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [regression] in linux-next: sh_mobile_ceu_camera broken by	"ARM:
Date: Tue, 10 Aug 2010 14:07:09 +0000	[thread overview]
Message-ID: <4C615D0D.2080600@st.com> (raw)
In-Reply-To: <20100808220035.GD23623@n2100.arm.linux.org.uk>

On 08/08/10 23:00, Russell King - ARM Linux wrote:
> On Sun, Aug 08, 2010 at 05:45:26PM +0200, Arnd Hannemann wrote:
>> Hi Russell,
>>
>> your commit 309caa9cc6ff39d261264ec4ff10e29489afc8f8
>> ARM: Prohibit ioremap() on kernel managed RAM
>>
>> lets drivers/base/dma-coherent.c::dma_declare_coherent_memory()
>> fail for the sh_mobile_ceu_camera driver (see backtrace below).
>> I think, other configurations (i.MX31 users of the mx3_camera driver:
>> pcm037 and mx31moboard) will have the same problem.
>>
>> Since I have no idea how to fix this, I post this regression report here...
> 
> Me neither!  However, reverting the commit isn't the answer.
> 
> ARM shmobile platforms are ARM architecture V6 or V7, both of which have
> the architectural restriction that multiple mappings of the same physical
> address space must have the same memory type and cache attributes.  We
> know that some ARMv7 systems do bad things when multiple different
> mappings exist - and as they're using ARM's own Cortex CPU designs, and
> I doubt shmobile is any different in that...
> 
> So, basically going forward with the advent of VIPT caches on ARM, any
> kernel interface which allows system RAM to be remapped with different
> attributes from the lowmem mapping is bad news - that means (eg) using
> vmap() with a non-PGPROT_KERNEL pgprot has become illegal.  Certainly
> using ioremap() on mapped system RAM on VIPT has become illegal, and
> that's what has now been prevented.
> 
> It's actually a restriction which x86 gained some time ago, which I
> stupidly continued to permit on ARM.  Now that our hardware has gained
> the same restriction, we're now going to be into the same learning
> curve...

Doesn't dma_alloc_coherent() suffer from the same problems? Pages are
allocated using alloc_pages, and in the non-coherent case will be
mapped uncached into consistent mapping region, creating a second
mapping with different attributes.

Stuart

WARNING: multiple messages have this Message-ID (diff)
From: stuart.menefy@st.com (Stuart Menefy)
To: linux-arm-kernel@lists.infradead.org
Subject: [regression] in linux-next: sh_mobile_ceu_camera broken by	"ARM: Prohibit ioremap() on kernel managed RAM"
Date: Tue, 10 Aug 2010 15:07:09 +0100	[thread overview]
Message-ID: <4C615D0D.2080600@st.com> (raw)
In-Reply-To: <20100808220035.GD23623@n2100.arm.linux.org.uk>

On 08/08/10 23:00, Russell King - ARM Linux wrote:
> On Sun, Aug 08, 2010 at 05:45:26PM +0200, Arnd Hannemann wrote:
>> Hi Russell,
>>
>> your commit 309caa9cc6ff39d261264ec4ff10e29489afc8f8
>> ARM: Prohibit ioremap() on kernel managed RAM
>>
>> lets drivers/base/dma-coherent.c::dma_declare_coherent_memory()
>> fail for the sh_mobile_ceu_camera driver (see backtrace below).
>> I think, other configurations (i.MX31 users of the mx3_camera driver:
>> pcm037 and mx31moboard) will have the same problem.
>>
>> Since I have no idea how to fix this, I post this regression report here...
> 
> Me neither!  However, reverting the commit isn't the answer.
> 
> ARM shmobile platforms are ARM architecture V6 or V7, both of which have
> the architectural restriction that multiple mappings of the same physical
> address space must have the same memory type and cache attributes.  We
> know that some ARMv7 systems do bad things when multiple different
> mappings exist - and as they're using ARM's own Cortex CPU designs, and
> I doubt shmobile is any different in that...
> 
> So, basically going forward with the advent of VIPT caches on ARM, any
> kernel interface which allows system RAM to be remapped with different
> attributes from the lowmem mapping is bad news - that means (eg) using
> vmap() with a non-PGPROT_KERNEL pgprot has become illegal.  Certainly
> using ioremap() on mapped system RAM on VIPT has become illegal, and
> that's what has now been prevented.
> 
> It's actually a restriction which x86 gained some time ago, which I
> stupidly continued to permit on ARM.  Now that our hardware has gained
> the same restriction, we're now going to be into the same learning
> curve...

Doesn't dma_alloc_coherent() suffer from the same problems? Pages are
allocated using alloc_pages, and in the non-coherent case will be
mapped uncached into consistent mapping region, creating a second
mapping with different attributes.

Stuart

  reply	other threads:[~2010-08-10 14:07 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-08 15:45 [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Arnd Hannemann
2010-08-08 15:45 ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel managed RAM" Arnd Hannemann
2010-08-08 22:00 ` [regression] in linux-next: sh_mobile_ceu_camera broken by Russell King - ARM Linux
2010-08-08 22:00   ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel managed RAM" Russell King - ARM Linux
2010-08-10 14:07   ` Stuart Menefy [this message]
2010-08-10 14:07     ` Stuart Menefy
2010-08-10 16:36     ` [regression] in linux-next: sh_mobile_ceu_camera broken by Russell King - ARM Linux
2010-08-10 16:36       ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel managed RAM" Russell King - ARM Linux
2010-08-10  8:45 ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel ma Philippe Rétornaz
2010-08-10  8:45   ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel managed RAM" Philippe Rétornaz
2010-08-10  9:27   ` [regression] in linux-next: sh_mobile_ceu_camera broken by Russell King - ARM Linux
2010-08-10  9:27     ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel managed RAM" Russell King - ARM Linux
2010-08-10 19:55     ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Guennadi Liakhovetski
2010-08-10 19:55       ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel managed RAM" Guennadi Liakhovetski
2010-08-10 21:26       ` [regression] in linux-next: sh_mobile_ceu_camera broken by Russell King - ARM Linux
2010-08-10 21:26         ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel managed RAM" Russell King - ARM Linux
2010-08-13 10:52         ` [regression] in linux-next: sh_mobile_ceu_camera broken by hisao munakata
2010-08-13 10:52           ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel managed RAM" hisao munakata
2010-08-18 19:23         ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Guennadi Liakhovetski
2010-08-18 19:23           ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel managed RAM" Guennadi Liakhovetski
2010-08-18 19:41           ` [regression] in linux-next: sh_mobile_ceu_camera broken by Russell King - ARM Linux
2010-08-18 19:41             ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel managed RAM" Russell King - ARM Linux
2010-08-18 20:31             ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Guennadi Liakhovetski
2010-08-18 20:31               ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel managed RAM" Guennadi Liakhovetski
2010-08-18 21:44               ` [regression] in linux-next: sh_mobile_ceu_camera broken by Russell King - ARM Linux
2010-08-18 21:44                 ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel managed RAM" Russell King - ARM Linux
2010-08-18 21:47               ` [regression] in linux-next: sh_mobile_ceu_camera broken by Russell King - ARM Linux
2010-08-18 21:47                 ` [regression] in linux-next: sh_mobile_ceu_camera broken by "ARM: Prohibit ioremap() on kernel managed RAM" Russell King - ARM Linux

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=4C615D0D.2080600@st.com \
    --to=stuart.menefy@st.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.