From: David Miller <davem@davemloft.net>
To: ard.biesheuvel@linaro.org
Cc: dan.j.williams@intel.com, will.deacon@arm.com,
jassisinghbrar@gmail.com, netdev@vger.kernel.org,
devicetree@vger.kernel.org, arnd.bergmann@linaro.org,
robh+dt@kernel.org, mark.rutland@arm.com,
jaswinder.singh@linaro.org
Subject: Re: [PATCH 2/3] net: socionext: Add Synquacer NetSec driver
Date: Thu, 30 Nov 2017 12:58:13 -0500 (EST) [thread overview]
Message-ID: <20171130.125813.1832145274236885737.davem@davemloft.net> (raw)
In-Reply-To: <CAKv+Gu9sOzce_r3JKU8B4JDK2Gr5cB5NZdQxUMEmmy6SZ+sOFw@mail.gmail.com>
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Date: Thu, 30 Nov 2017 17:48:44 +0000
> On 30 November 2017 at 17:42, David Miller <davem@davemloft.net> wrote:
>> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> Date: Thu, 30 Nov 2017 17:37:27 +0000
>>
>>> Well, the whole point of using memremap() instead of ioremap() is that
>>> the region has memory semantics, i.e., we read the MAC address and the
>>> DMA engine microcode from it. If memremap() itself is flawed in this
>>> regard, I agree we should fix it. But as I understand it, this is
>>> really an implementation problem in memremap() [the fact that it falls
>>> back to ioremap()] and not a problem in this driver.
>>>
>>> So what alternative would you propose in this case?
>>>
>>> BTW, this should be IOREMAP_WC not IOREMAP_WT, because the EEPROM on
>>> the platform in question does not tolerate cached mappings (or rather,
>>> shareable mappings). ioremap_wt() happens to result in device mappings
>>> rather than writethrough cacheable mappings, but this is another
>>> problem in itself. Once arm64 fixes ioremap_wt(), this code will no
>>> longer work on the SynQuacer SoC.
>>
>> It doesn't "fall back", it directly uses ioremap_wt() for non-RAM
>> mappings.
>>
>> It you look, most architectures do a "#define iomrep_wt ioremap"
>
> OK, but that still means the implementation of memremap() is flawed,
> not its use in this driver.
>
> memremap() exists to allow non-DRAM regions to be mapped with memory
> semantics, and if we currently implement that incorrectly, we should
> fix it. But that still does not mean we should have __iomem
> annotations and special accessors in this case, precisely because it
> has memory semantics, and so it is a virtual pointer that may be
> dereferenced normally.
Memory semantics and how to access that memory are two different things.
On sparc64 the cacheability etc. can be specified in the load and
store instructions.
That's why I have all of the ioremap*() routines return a physical
address. The value returned from all of the ioremap*() interfaces is
completely opaque. That's why the return type is __iomem.
The iomem accessors on sparc64 use the appropriate access bits in the
load and store instructions as needed.
So in order for this to work properly, new sets of acessors need to be
implemented to let me give you the access semantics you want yet at
the same time allowing architectures to have the flexibility of
still returning an opaque "pointer".
There is no reason for me to make a virtual mapping on sparc64 because
it is completely unnecessary overhead since I can give you whatever
cacheability/IO/etc. attributes needed in the load and store
instructions themselves.
Thanks.
next prev parent reply other threads:[~2017-11-30 17:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-30 16:13 [PATCH 2/3] net: socionext: Add Synquacer NetSec driver jassisinghbrar
[not found] ` <1512058396-15907-1-git-send-email-jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-11-30 17:29 ` David Miller
2017-11-30 17:37 ` Ard Biesheuvel
[not found] ` <CAKv+Gu8wJkNWufXsRYGe0juLWt9GRfRj=tg3M+on2wtwaj+6EA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-30 17:42 ` David Miller
[not found] ` <20171130.124234.1467691580228393484.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2017-11-30 17:48 ` Ard Biesheuvel
2017-11-30 17:58 ` David Miller [this message]
2017-11-30 18:08 ` Ard Biesheuvel
[not found] ` <CAKv+Gu9qpLWTjjCZBvyn87HoNNY+U5++2UeHxF8jXYQPDd3U1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-30 18:14 ` David Miller
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=20171130.125813.1832145274236885737.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=ard.biesheuvel@linaro.org \
--cc=arnd.bergmann@linaro.org \
--cc=dan.j.williams@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=jassisinghbrar@gmail.com \
--cc=jaswinder.singh@linaro.org \
--cc=mark.rutland@arm.com \
--cc=netdev@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=will.deacon@arm.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;
as well as URLs for NNTP newsgroup(s).