mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Stephen Boyd <stephen.boyd@linaro.org>
Cc: linux-kernel@vger.kernel.org,
	Laura Abbott <lauraa@codeaurora.org>,
	linux-arm@lists.infradead.org,
	Robin Murphy <robin.murphy@arm.com>,
	Laura Abbott <labbott@redhat.com>, Arnd Bergmann <arnd@arndb.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Mimi Zohar <zohar@linux.vnet.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mark Brown <broonie@kernel.org>,
	Will Deacon <will.deacon@arm.com>,
	Ming Lei <ming.lei@canonical.com>
Subject: Re: [RFC/PATCHv2 v2 2/4] dma-mapping: Add dma_remap() APIs
Date: Thu, 21 Apr 2016 11:35:12 +0100	[thread overview]
Message-ID: <20160421103512.GC23774@e104818-lin.cambridge.arm.com> (raw)
In-Reply-To: <1461114269-13718-3-git-send-email-stephen.boyd@linaro.org>

Hi Stephen,

On Tue, Apr 19, 2016 at 06:04:27PM -0700, Stephen Boyd wrote:
> From: Laura Abbott <lauraa@codeaurora.org>
> 
> Some systems are memory constrained but they need to load very
> large firmwares. The firmware subsystem allows drivers to request
> this firmware be loaded from the filesystem, but this requires
> that the entire firmware be loaded into kernel memory first
> before it's provided to the driver. This can lead to a situation
> where we map the firmware twice, once to load the firmware into
> kernel memory and once to copy the firmware into the final
> resting place.
> 
> This design creates needless memory pressure and delays loading
> because we have to copy from kernel memory to somewhere else.
> Let's add a couple DMA APIs that allow us to map DMA buffers into
> the CPU's address space in arbitrary sizes. With this API, we can
> allocate a DMA buffer with DMA_ATTR_NO_KERNEL_MAPPING and move a
> small mapping window across our large DMA buffer to load the
> firmware directly into buffer.

The first two patches in this series don't make sense to me. I don't
understand what the memory pressure is: physical or virtual? Because
they don't seem to address the former (the DMA buffer is allocated in
full) while the latter doesn't need any addressing at all on arm64, we
have plenty of VA space.

Why do you even need the coherent DMA API? Can you use the streaming API
(map_sg etc.) with a separately allocated buffer?

-- 
Catalin

  reply	other threads:[~2016-04-21 10:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-20  1:04 [RFC/PATCHv2 v2 0/4] request_firmware() on memory constrained devices Stephen Boyd
2016-04-20  1:04 ` [RFC/PATCHv2 v2 1/4] ARM64: dma: Add support for NO_KERNEL_MAPPING attribute Stephen Boyd
2016-04-20  1:04 ` [RFC/PATCHv2 v2 2/4] dma-mapping: Add dma_remap() APIs Stephen Boyd
2016-04-21 10:35   ` Catalin Marinas [this message]
     [not found]     ` <20160423003516.12876.30413@sboyd-linaro>
2016-04-27 15:25       ` Catalin Marinas
2016-04-27 18:16         ` Laura Abbott
2016-04-20  1:04 ` [RFC/PATCHv2 v2 3/4] firmware_class: Provide infrastructure to make fw caching optional Stephen Boyd
2016-04-20  1:04 ` [RFC/PATCHv2 v2 4/4] firmware: Support requesting firmware directly into DMA memory Stephen Boyd
2016-04-20 12:32 ` [RFC/PATCHv2 v2 0/4] request_firmware() on memory constrained devices Mimi Zohar

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=20160421103512.GC23774@e104818-lin.cambridge.arm.com \
    --to=catalin.marinas@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=labbott@redhat.com \
    --cc=lauraa@codeaurora.org \
    --cc=linux-arm@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=ming.lei@canonical.com \
    --cc=robin.murphy@arm.com \
    --cc=stephen.boyd@linaro.org \
    --cc=will.deacon@arm.com \
    --cc=zohar@linux.vnet.ibm.com \
    /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®