linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: arnd@arndb.de, lee@kernel.org, linux-kernel@vger.kernel.org,
	andriy.shevchenko@linux.intel.com, torvalds@linux-foundation.org
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
Subject: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"
Date: Sat,  8 Oct 2022 09:47:00 -0600	[thread overview]
Message-ID: <20221008154700.404837-1-Jason@zx2c4.com> (raw)
In-Reply-To: <Y0GZwkDwnak2ReTt@zx2c4.com>

This reverts commit 72a95859728a7866522e6633818bebc1c2519b17. It broke
reboots on big-endian MIPS and MIPS64 malta QEMU instances, which use
the syscon driver. Little-endian is not effected, which means likely
it's important to handle regmap_get_val_endian() in this function after
all.

Cc: Lee Jones <lee@kernel.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Fixes: 72a95859728a ("mfd: syscon: Remove repetition of the regmap_get_val_endian()")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 drivers/mfd/syscon.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index 9489e80e905a..bdb2ce7ff03b 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -66,6 +66,14 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_clk)
 		goto err_map;
 	}
 
+	/* Parse the device's DT node for an endianness specification */
+	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"))
+		syscon_config.val_format_endian = REGMAP_ENDIAN_LITTLE;
+	else if (of_property_read_bool(np, "native-endian"))
+		syscon_config.val_format_endian = REGMAP_ENDIAN_NATIVE;
+
 	/*
 	 * search for reg-io-width property in DT. If it is not provided,
 	 * default to 4 bytes. regmap_init_mmio will return an error if values
-- 
2.37.3


  reply	other threads:[~2022-10-08 15:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06  9:02 [GIT PULL] MFD for v6.1 Lee Jones
2022-10-07 19:20 ` pr-tracker-bot
2022-10-08 15:39 ` Jason A. Donenfeld
2022-10-08 15:47   ` Jason A. Donenfeld [this message]
2022-10-08 16:45     ` [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()" Linus Torvalds
2022-10-08 19:07       ` Andy Shevchenko
2022-10-10  7:48         ` Lee Jones
2022-10-10 15:25           ` Jason A. Donenfeld
2022-10-11  7:39         ` Lee Jones
2022-10-11  9:44           ` Andy Shevchenko
2022-10-11  9:44     ` Andy Shevchenko
2022-10-18  7:23     ` Lee Jones

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=20221008154700.404837-1-Jason@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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).