lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 11 Oct 2022 12:44:27 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     "Jason A. Donenfeld" <Jason@...c4.com>
Cc:     arnd@...db.de, lee@...nel.org, linux-kernel@...r.kernel.org,
        torvalds@...ux-foundation.org
Subject: Re: [PATCH] Revert "mfd: syscon: Remove repetition of the
 regmap_get_val_endian()"

On Sat, Oct 08, 2022 at 09:47:00AM -0600, Jason A. Donenfeld wrote:
> 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.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

as per discussion and analysis that shows that syscon needs that code because
it calls regmap_init_mmio() with dev == NULL.

> Cc: Lee Jones <lee@...nel.org>
> Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Fixes: 72a95859728a ("mfd: syscon: Remove repetition of the regmap_get_val_endian()")
> Signed-off-by: Jason A. Donenfeld <Jason@...c4.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
> 
> 

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ