public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Mark Brown <broonie@kernel.org>
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 14:16:16 +0100	[thread overview]
Message-ID: <2829394.8U4Fl4Zf7k@wuerfel> (raw)
In-Reply-To: <20160126113652.GC6588@sirena.org.uk>

On Tuesday 26 January 2016 11:36:52 Mark Brown wrote:
> On Tue, Jan 26, 2016 at 10:24:22AM +0100, Johannes Berg wrote:
> > On Tue, 2016-01-26 at 10:09 +0100, Arnd Bergmann wrote:
> 
> > > 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). 
> 
> > I'm not sure that we can, since regmap also takes the value from the DT
> > directly, and it seems that a driver passing it would mean the DT value
> > is no longer honoured?
> 
> DT should override the value in the driver rather than the other way
> around.

So if we default to little-endian for all regmap-mmio mappings, and let
the driver or DT override that, and the regmap core already has the
logic to read the ordering from DT, should we remove the parsing of 
the byteorder attributes from syscon and just let regmap do its thing?

I was thinking about adding the patch below, but it sounds like we can
just remove the parsing completely.

	Arnd


diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index b7aabeefab07..69d9bb84c94a 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -64,10 +64,13 @@ static struct syscon *of_syscon_register(struct device_node *np)
 		goto err_map;
 	}
 
-	/* Parse the device's DT node for an endianness specification */
+	/* Parse the device's DT node for an endianness specification,
+	   default to little-endian on all architectures */
 	if (of_property_read_bool(np, "big-endian"))
 		syscon_config.val_format_endian = REGMAP_ENDIAN_BIG;
-	 else if (of_property_read_bool(np, "little-endian"))
+	else if (of_property_read_bool(np, "native-endian"))
+		syscon_config.val_format_endian = REGMAP_ENDIAN_NATIVE;
+	else
 		syscon_config.val_format_endian = REGMAP_ENDIAN_LITTLE;
 
 	/*

  reply	other threads:[~2016-01-26 13:16 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 [this message]
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
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=2829394.8U4Fl4Zf7k@wuerfel \
    --to=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --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