mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vladimir Murzin <vladimir.murzin@arm.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	kbuild-all@01.org,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Robin Murphy <robin.murphy@arm.com>,
	sza@esh.hu
Subject: Re: [PATCH v3 5/7] ARM: NOMMU: Introduce dma operations for noMMU
Date: Wed, 19 Apr 2017 15:12:01 +0100	[thread overview]
Message-ID: <a669ed51-93a9-4e49-189c-98f2c1c6e312@arm.com> (raw)
In-Reply-To: <CAK8P3a37QAZNp9hvbM10EjMNnTsiiN-Z3u8o=883bev4Th-iOQ@mail.gmail.com>

On 19/04/17 11:10, Arnd Bergmann wrote:
> On Fri, Mar 10, 2017 at 10:23 AM, Vladimir Murzin
> <vladimir.murzin@arm.com> wrote:
>> R/M classes of cpus can have memory covered by MPU which in turn might
>> configure RAM as Normal i.e. bufferable and cacheable. It breaks
>> dma_alloc_coherent() and friends, since data can stuck in caches now
>> or be buffered.
>>
>> This patch factors out DMA support for NOMMU configuration into
>> separate entity which provides dedicated dma_ops. We have to handle
>> there several cases:
>> - configurations with MMU/MPU setup
>> - configurations without MMU/MPU setup
>> - special case for M-class, since caches and MPU there are optional
>>
>> In general we rely on default DMA area for coherent allocations or/and
>> per-device memory reserves suitable for coherent DMA, so if such
>> regions are set coherent allocations go from there.
>>
>> In case MPU/MPU was not setup we fallback to normal page allocator for
>> DMA memory allocation.
>>
>> In case we run M-class cpus, for configuration without cache support
>> (like Cortex-M3/M4) dma operations are forced to be coherent and wired
>> with dma-noop (such decision is made based on cacheid global
>> variable); however, if caches are detected there and no DMA coherent
>> region is given (either default or per-device), dma is disallowed even
>> MPU is not set - it is because M-class implement system memory map
>> which defines part of address space as Normal memory.
>>
>> Reported-by: Alexandre Torgue <alexandre.torgue@st.com>
>> Reported-by: Andras Szemzo <sza@esh.hu>
>> Tested-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
>> Tested-by: Andras Szemzo <sza@esh.hu>
>> Tested-by: Alexandre TORGUE <alexandre.torgue@st.com>
>> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
>> Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
> 
> I thought I found a couple of problems with this, but after reading more
> carefully I was wrong about all of them and I think the code is doing
> exactly the right thing. I also like the way this is split out into a separate
> set of dma_map_ops to simplify the normal MMU case.
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> 

Much appreciated!

Vladimir

  reply	other threads:[~2017-04-19 14:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10  9:23 [PATCH v3 0/7] ARM: Fix dma_alloc_coherent() and friends for NOMMU Vladimir Murzin
2017-03-10  9:23 ` [PATCH v3 1/7] dma: Take into account dma_pfn_offset Vladimir Murzin
2017-03-10  9:23 ` [PATCH v3 2/7] dma: Add simple dma_noop_mmap Vladimir Murzin
2017-03-10  9:23 ` [PATCH v3 3/7] drivers: dma-coherent: Account dma_pfn_offset when used with device tree Vladimir Murzin
2017-03-10  9:23 ` [PATCH v3 4/7] drivers: dma-coherent: Introduce default DMA pool Vladimir Murzin
2017-03-10  9:23 ` [PATCH v3 5/7] ARM: NOMMU: Introduce dma operations for noMMU Vladimir Murzin
2017-04-19 10:10   ` Arnd Bergmann
2017-04-19 14:12     ` Vladimir Murzin [this message]
2017-03-10  9:23 ` [PATCH v3 6/7] ARM: NOMMU: Set ARM_DMA_MEM_BUFFERABLE for M-class cpus Vladimir Murzin
2017-04-19 10:02   ` Arnd Bergmann
2017-04-19 14:10     ` Vladimir Murzin
2017-04-21 22:12       ` Arnd Bergmann
2017-03-10  9:23 ` [PATCH v3 7/7] ARM: dma-mapping: Remove traces of NOMMU code Vladimir Murzin
2017-04-19  9:56   ` Arnd Bergmann
2017-04-19 14:11     ` Vladimir Murzin
2017-03-16  9:03 ` [PATCH v3 0/7] ARM: Fix dma_alloc_coherent() and friends for NOMMU Vladimir Murzin
2017-03-22 12:23   ` Szemző András
2017-03-23  9:26     ` Vladimir Murzin
2017-03-29  8:17       ` Vladimir Murzin
2017-04-18 12:51         ` Vladimir Murzin
2017-04-19 11:56           ` Joerg Roedel
2017-04-19 14:20             ` Vladimir Murzin
2017-05-11 14:44               ` Benjamin Gaignard

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=a669ed51-93a9-4e49-189c-98f2c1c6e312@arm.com \
    --to=vladimir.murzin@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexandre.torgue@st.com \
    --cc=arnd@arndb.de \
    --cc=benjamin.gaignard@linaro.org \
    --cc=kbuild-all@01.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=robin.murphy@arm.com \
    --cc=sza@esh.hu \
    /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

all inboxes | Powered by JetHome®