public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	Simon Arlott <simon@fire.lp0.eu>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Revert "regmap-mmio: Use native endianness for read/write"
Date: Tue, 26 Jan 2016 11:31:03 +0000	[thread overview]
Message-ID: <20160126113103.GA6588@sirena.org.uk> (raw)
In-Reply-To: <6962431.EnoXCqILtZ@wuerfel>

[-- Attachment #1: Type: text/plain, Size: 1893 bytes --]

On Tue, Jan 26, 2016 at 10:09:35AM +0100, Arnd Bergmann wrote:

> * On 32-bit architectures, you generally cannot do 64-bit atomic I/O
>   operations, and we have two implementations that do it nonatomically,
>   depending on how a device is wired to the bus, see
>   include/linux/io-64-nonatomic-{hi-lo,lo-hi}.h.
>   I think we should just not go there for regmap unless we absolutely
>   have to.

That's fine, we don't support 64 bit MMIO regmaps on 32 bit systems
anyway (they're ifdefed out and will generate an error if you try to use
them).  If someone wants that functionality they can sort it out.

> However, we have some freedom at the regmap-mmio level, which we can
> sanitize in 4.6 if we want to make it more consistent with the rest
> of regmap. We have around 50 callers of {devm_,}regmap_init_mmio()
> and almost all of them do not specify endianess but expect little-endian
> behavior. We can change all existing instances to set REGMAP_ENDIAN_NATIVE
> explicitly and change regmap_init_mmio() to return an error if the
> caller does not specify a particular endianess (big, little, native).

As far as I can tell almost all the users actually want little endian
(everyone except these MIPS users) so if we're going to go through and
change all the users we should be going for that.  Given that things
just won't work if they have the wrong endianness I'm reasonably
comfortable with keeping a default in the core - so long as the core is
explicit about what it's doing so unlikely to get confused I think we
are reasonably safe.

> This is a tradeoff between interface simplicity (defaulting to LE is
> convenient for most people) and consistency (all other regmap interfaces
> default to native if I understood Mark right).

All other regmaps default to either native or big endian (native for
things with explicit read and write operations, big for byte stream
buses).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  parent reply	other threads:[~2016-01-26 11:31 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-25 22:07 [PATCH] Revert "regmap-mmio: Use native endianness for read/write" Johannes Berg
2016-01-25 22:24 ` Arnd Bergmann
2016-01-25 22:34   ` Johannes Berg
2016-01-25 23:52     ` Mark Brown
2016-01-26  8:25       ` Johannes Berg
2016-01-26  9:09         ` Arnd Bergmann
2016-01-26  9:24           ` Johannes Berg
2016-01-26 11:36             ` Mark Brown
2016-01-26 13:16               ` Arnd Bergmann
2016-01-26 13:20                 ` Johannes Berg
2016-01-26 15:23                   ` Mark Brown
2016-01-26 21:29                     ` Mark Brown
2016-01-26 20:05                 ` Mark Brown
2016-01-26 13:07             ` Arnd Bergmann
2016-01-26 11:31           ` Mark Brown [this message]
2016-01-25 22:47   ` Mark Brown
2016-01-25 23:01     ` Arnd Bergmann
2016-01-26 11:31       ` Mark Brown
2016-01-25 22:56 ` Mark Brown

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=20160126113103.GA6588@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=arnd@arndb.de \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=simon@fire.lp0.eu \
    /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