From: linux@armlinux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 06/10] soc/qbman: Add ARM equivalent for flush_dcache_range()
Date: Mon, 30 Jan 2017 15:12:20 +0000 [thread overview]
Message-ID: <20170130151220.GZ27312@n2100.armlinux.org.uk> (raw)
In-Reply-To: <VI1PR0401MB2430DA6BD2F857C30EC86A50917F0@VI1PR0401MB2430.eurprd04.prod.outlook.com>
On Wed, Jan 18, 2017 at 11:36:18PM +0000, Scott Wood wrote:
> On 01/18/2017 05:12 PM, Russell King - ARM Linux wrote:
> > Please do not fiddle about under the covers, there be dragons there.
> >
> > It looks to me like you're trying to use __cpuc_flush_dcache_area()
> > on an area that's been ioremap()'d, which is a waste of CPU cycles.
> > ioremap()'d areas are mapped as "device" memory type, which means
> > the region isn't even cached. So I don't think this is necessary.
>
> It is mapped cachable, via memremap() (see patch 1/10). This is RAM
> that the device uses, non-coherently, for its own purposes (but requires
> software to clear it first).
Ok.
> Is there a non-"under the covers" way to say "flush this region" without
> the arch second-guessing whether it really needs to be flushed?
memremap() doesn't have any associated cache flushing functionality
defined for it - it's a relatively new interface added to the kernel.
There are some interfaces defined for memory that was vmalloc'd, but
due to the way kernel/memremap.c works, you can't guarantee that the
pointer you end up with came from vmalloc'd space, so I don't think
suggesting to use those would be correct (as they may have assumptions
that they'll only be called with vmalloc'd addresses.)
As pointed out later in the thread, using dma_map_single() on the
returned address is not permissible either.
The only thing I can say is that it needs a proposal for a new arch-
independent interface.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2017-01-30 15:12 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-18 22:39 [PATCH 00/10] fsl/qbman: ARM Enablement Roy Pledge
2017-01-18 22:39 ` [PATCH 01/10] soc/qbman: Use portable mapping for the FQD reserved memory Roy Pledge
2017-01-18 22:39 ` [PATCH 02/10] soc/qbman: Drop set/clear_bits usage Roy Pledge
2017-01-18 22:39 ` [PATCH 03/10] soc/qbman: Drop L1_CACHE_BYTES compile time check Roy Pledge
2017-01-18 22:39 ` [PATCH 04/10] soc/qbman: Fix ARM32 typo Roy Pledge
2017-01-18 22:39 ` [PATCH 05/10] soc/qbman: Rework ioremap() calls for ARM/PPC Roy Pledge
2017-01-18 22:39 ` [PATCH 06/10] soc/qbman: Add ARM equivalent for flush_dcache_range() Roy Pledge
2017-01-18 23:12 ` Russell King - ARM Linux
2017-01-18 23:36 ` Scott Wood
2017-01-23 19:24 ` Roy Pledge
2017-01-25 21:20 ` Arnd Bergmann
2017-01-26 5:08 ` Scott Wood
2017-01-27 16:41 ` Arnd Bergmann
2017-01-28 2:34 ` Scott Wood
2017-01-30 15:31 ` Robin Murphy
2017-01-30 19:04 ` Roy Pledge
2017-02-01 13:03 ` Robin Murphy
2017-02-01 22:51 ` Scott Wood
2017-02-06 22:26 ` Roy Pledge
2017-02-06 22:37 ` Russell King - ARM Linux
2017-02-07 16:44 ` Roy Pledge
2017-02-07 18:25 ` Robin Murphy
2017-02-13 21:26 ` Roy Pledge
2017-03-16 0:43 ` Roy Pledge
2017-03-16 20:08 ` Scott Wood
2017-03-29 21:19 ` Roy Pledge
2017-01-30 15:19 ` Russell King - ARM Linux
2017-02-01 12:47 ` Arnd Bergmann
2017-02-01 23:16 ` Russell King - ARM Linux
2017-02-02 17:21 ` Roy Pledge
2017-01-30 15:04 ` Russell King - ARM Linux
2017-02-01 12:52 ` Arnd Bergmann
2017-01-30 15:12 ` Russell King - ARM Linux [this message]
2017-01-18 22:39 ` [PATCH 07/10] soc/qbman: add QMAN_REV32 Roy Pledge
2017-01-18 22:39 ` [PATCH 08/10] soc/qbman: different register offsets on ARM Roy Pledge
2017-01-18 22:39 ` [PATCH 09/10] soc/qbman: Add missing headers " Roy Pledge
2017-01-18 22:39 ` [PATCH 10/10] fsl/qbman: Enable FSL_LAYERSCAPE config " Roy Pledge
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=20170130151220.GZ27312@n2100.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--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;
as well as URLs for NNTP newsgroup(s).