mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vladimir Murzin <vladimir.murzin@arm.com>
To: Christoph Hellwig <hch@lst.de>, dillon min <dillon.minfei@gmail.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	linux@armlinux.org.uk,
	Kate Stewart <kstewart@linuxfoundation.org>,
	allison@lohutok.net, info@metux.net, tglx@linutronix.de,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	linux-stm32@st-md-mailman.stormreply.com,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] arm-nommu: Add use_reserved_mem() to check if device support reserved memory
Date: Tue, 9 Jun 2020 17:25:04 +0100	[thread overview]
Message-ID: <b0c85637-4646-614b-d406-49aa72ce52e1@arm.com> (raw)
In-Reply-To: <031034fb-b109-7410-3ff8-e78cd12a5552@arm.com>

On 6/9/20 4:43 PM, Vladimir Murzin wrote:
> On 6/9/20 4:36 PM, Christoph Hellwig wrote:
>> On Tue, Jun 09, 2020 at 11:22:24PM +0800, dillon min wrote:
>>> Hi Vladimir,
>>>
>>> Thanks for reviewing.
>>>
>>> Hi Christoph Hellwig,
>>>
>>> I just want to know if kernel dma mapping/direct is focused on
>>> platforms with MMU.
>>> leave arch code to handle dma coherent memory management themself for
>>> no-MMU platform.
>>
>> No, I'd really like to consolidate everything that isn't overly
>> arch specific eventually.
>>
>>>
>>> so, you just return error code in kernel/dma/mapping.c,direct.c
>>> without CONFIG_MMU defined ?
>>> which means dma-direct mapping doesn't support !CONFIG_MMU is not a
>>> bug, but design as it's.
>>> or, just return error code currently, will add dma direct mapping
>>> support for !CONFIG_MMU in the
>>> future?
>>>
>>> As Vladimir Murzin's suggestion has changes in kernel code, I need
>>> your input to get
>>> the design goal about dma-direct mapping, thanks.
>>
>> Can someone repost the whole patch?
>>
> 
> Happy to repost as separate patch once dillon confirms it actually works.
> 
> Meanwhile, I'm trying to understand at which point we lost this 
> functionality for NOMMU... maybe it will become different patch :)
> 

mmap operation for dma-noop (ancestor of dma-direct) was proposed
in [1]. It was suggested to change dma_common_map() instead which
was implemented in 

07c75d7a6b9e ("drivers: dma-mapping: allow dma_common_mmap() for NOMMU")

that removed CONFIG_MMU drom dma_common_mmap(). Later

62fcee9a3bd7 ("dma-mapping: remove CONFIG_ARCH_NO_COHERENT_DMA_MMAP")

reintroduced CONFIG_MMU in dma_common_mmap().

Even though commit mentions ARM, I do not see how mmap would continue
to work for NOMMU with dma-direct. ARM NOMMU needs it's own DMA operations
only in cases where caches are implemented or active, in other cases it
fully relies on dma-direct.

It looks to me that we either should provide NOMMU variant for mmap in
dma/direct or (carefully) fix dma/mapping.

Thoughts?

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2017-January/480600.html

Vladimir

> Cheers
> Vladimir
> 


  reply	other threads:[~2020-06-09 16:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-08  8:30 [PATCH 0/2] Use 'arm_nommu_dma_ops' to handle dma memroy if device offer consistent dma memory region dillon.minfei
2020-06-08  8:30 ` [PATCH 1/2] ARM: dts: stm32: Setup 4M bytes reserved memory for mmap dillon.minfei
2020-06-09 15:58   ` dillon min
2020-06-08  8:30 ` [PATCH 2/2] arm-nommu: Add use_reserved_mem() to check if device support reserved memory dillon.minfei
2020-06-09 14:08   ` Vladimir Murzin
2020-06-09 15:22     ` dillon min
2020-06-09 15:36       ` Christoph Hellwig
2020-06-09 15:43         ` Vladimir Murzin
2020-06-09 16:25           ` Vladimir Murzin [this message]
2020-06-09 17:34             ` Christoph Hellwig
2020-06-10  2:24               ` dillon min
2020-06-10  7:24     ` Christoph Hellwig
2020-06-10  8:19       ` Vladimir Murzin
2020-06-11 15:45         ` Vladimir Murzin
2020-06-12  2:15           ` dillon min
2020-06-09 15:58 ` [PATCH 0/2] Use 'arm_nommu_dma_ops' to handle dma memroy if device offer consistent dma memory region dillon min

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=b0c85637-4646-614b-d406-49aa72ce52e1@arm.com \
    --to=vladimir.murzin@arm.com \
    --cc=alexandre.torgue@st.com \
    --cc=allison@lohutok.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dillon.minfei@gmail.com \
    --cc=hch@lst.de \
    --cc=info@metux.net \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux@armlinux.org.uk \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=tglx@linutronix.de \
    /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®