From: Russell King - ARM Linux <linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>
To: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
Cc: Bill Mills <wmills-l0cyMroinI0@public.gmane.org>,
t-kristo-l0cyMroinI0@public.gmane.org,
ssantosh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
catalin.marinas-5wv7dgnIgG8@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
r-woodruff2-l0cyMroinI0@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [RFC v2 4/4] ARM: keystone: dma-coherent with safe fallback
Date: Mon, 6 Jun 2016 12:43:21 +0100 [thread overview]
Message-ID: <20160606114321.GJ1041@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20160606085627.GA6831@leverpostej>
On Mon, Jun 06, 2016 at 09:56:27AM +0100, Mark Rutland wrote:
> I very much do not like this. As I previously mentioned [1],
> dma-coherent has de-facto semantics today. This series deliberately
> changes that, and inverts the relationship between DT and kernel (as the
> describption in the DT would now depend on the configuration of the
> kernel).
dma-coherent's semantics are not very well defined - just grep for it
in Documention/devicetree/ and you'll find several different wordings
for what this property means.
Anyway, my point here is that all of these merely say that the hardware
is coherent in _some regard_ - it doesn't specify under what conditions
DMA coherency is guaranteed by the hardware. It happens that on ARM,
most platforms give that guarantee when using inner shared mappings. If
we were to use some other sharing, or disable sharing altogether (eg, by
disabling SMP support) then all these platforms would immediately break.
In other words, DMA coherence today already depends on the kernel's setup
of the page tables corresponding to the requirements of the hardware.
Keystone II is just slightly different - and as I understand it, TI
followed one of the early specifications that ARM Ltd produced. That
specification may have contained errors, but unfortunately, we now have
a situation where there is hardware out there which followed in good
faith.
So, it seems to me to be entirely reasonable that Keystone II should
mark devices with the "dma-coherent" property - just the same way as
every other platform does. It also seems to be entirely appropriate for
a platform to remove this property if it determines that the conditions
for DMA coherency are not met - in order to save the users data from
corruption.
TI Keystone II is not the only platform with issues here: there are
Marvell Armada platforms out there which have DMA coherence, but are
uniprocessor, we don't set the shared bit (which they require for
DMA coherence) and so we omit the dma-coherent property from the
device tree at the moment. And they're inner-shared coherent. We
just don't set the page tables up so that they can work.
So, I think to require a whole new property is absurd. The existing
property means "if the rest of the system is appropriately configured,
this device can be dma-coherent". So, what I think we need is a way
to communicate whether the rest of the system has been appropriately
configured, so the property can be attached to devices which meet the
criteria, but the arch/platform level can signal whether the conditions
for device DMA coherence have been met. That's not a DT property,
that's a matter of how the kernel has setup the system.
--
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.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-06-06 11:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1465183229-24147-1-git-send-email-wmills@ti.com>
[not found] ` <1465183229-24147-5-git-send-email-wmills@ti.com>
2016-06-06 8:56 ` [RFC v2 4/4] ARM: keystone: dma-coherent with safe fallback Mark Rutland
2016-06-06 9:09 ` Arnd Bergmann
2016-06-06 11:42 ` Mark Rutland
2016-06-06 12:37 ` Arnd Bergmann
2016-06-06 12:50 ` William Mills
2016-06-06 16:18 ` Santosh Shilimkar
2016-06-06 11:43 ` Russell King - ARM Linux [this message]
2016-06-06 11:59 ` Mark Rutland
2016-06-06 12:19 ` William Mills
2016-06-06 12:32 ` Russell King - ARM Linux
2016-06-06 16:28 ` Santosh Shilimkar
[not found] ` <20160606123210.GL1041-l+eeeJia6m9URfEZ8mYm6t73F7V6hmMc@public.gmane.org>
2016-06-07 10:01 ` Mark Rutland
2016-06-07 12:32 ` Russell King - ARM Linux
[not found] ` <20160607123248.GO1041-l+eeeJia6m9URfEZ8mYm6t73F7V6hmMc@public.gmane.org>
2016-06-07 12:55 ` Mark Rutland
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=20160606114321.GJ1041@n2100.armlinux.org.uk \
--to=linux-i+ivw8tiwo2tmtq+vha3yw@public.gmane.org \
--cc=catalin.marinas-5wv7dgnIgG8@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=r-woodruff2-l0cyMroinI0@public.gmane.org \
--cc=ssantosh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=t-kristo-l0cyMroinI0@public.gmane.org \
--cc=wmills-l0cyMroinI0@public.gmane.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).