From nobody Tue Apr 7 00:25:46 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80874C433FE for ; Sat, 8 Oct 2022 15:47:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229470AbiJHPr0 (ORCPT ); Sat, 8 Oct 2022 11:47:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiJHPrX (ORCPT ); Sat, 8 Oct 2022 11:47:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29EC94316E for ; Sat, 8 Oct 2022 08:47:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B7A94B80B8D for ; Sat, 8 Oct 2022 15:47:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE704C433C1; Sat, 8 Oct 2022 15:47:19 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="C3VRJb88" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1665244037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kHGPZI9TAFZXuftbhzouX4C1DXmHG0LSAvVwmxpYbHQ=; b=C3VRJb886fi2tZ+NaC9z2isSA5lG+x1IDF4DY/b+R9zp79b5EpIwINsffyKW21plsC8sXT 5adlDd4+qGFgocfiYe+ta1U6AyDTFrMeDunoU7dF7Xua9v2EZNdjlUQ7EzDayZQbCUHIU0 ktht4Z7SP/ct6D0yhCC4GQziOqNZv7o= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 8f6f8318 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 8 Oct 2022 15:47:16 +0000 (UTC) From: "Jason A. Donenfeld" 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" Subject: [PATCH] Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()" Date: Sat, 8 Oct 2022 09:47:00 -0600 Message-Id: <20221008154700.404837-1-Jason@zx2c4.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Cc: Andy Shevchenko Fixes: 72a95859728a ("mfd: syscon: Remove repetition of the regmap_get_val_= endian()") Signed-off-by: Jason A. Donenfeld Reviewed-by: Andy Shevchenko --- 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_n= ode *np, bool check_clk) goto err_map; } =20 + /* Parse the device's DT node for an endianness specification */ + if (of_property_read_bool(np, "big-endian")) + syscon_config.val_format_endian =3D REGMAP_ENDIAN_BIG; + else if (of_property_read_bool(np, "little-endian")) + syscon_config.val_format_endian =3D REGMAP_ENDIAN_LITTLE; + else if (of_property_read_bool(np, "native-endian")) + syscon_config.val_format_endian =3D 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 --=20 2.37.3