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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200720094449.32282-1-wens@kernel.org>
Date:   Mon, 20 Jul 2020 17:44:49 +0800
From:   Chen-Yu Tsai <wens@...nel.org>
To:     Mark Brown <broonie@...nel.org>,
        Liam Girdwood <lgirdwood@...il.com>
Cc:     Chen-Yu Tsai <wens@...e.org>, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, Maxime Ripard <mripard@...nel.org>
Subject: [PATCH] reuglator: gpio: Honor regulator-boot-on property

From: Chen-Yu Tsai <wens@...e.org>

When requesting the enable GPIO, the driver tries to do so with the
correct output level matching the current state. This is done by
checking the boot_on constraint, which is derived from the
regulator-boot-on property in the device tree. This is especially
important if the regulator is a critical one, such as a supply for
the boot CPU.

Honor the regulator-boot-on property by checking the boot_on
constraint setting. This is the same as what is done in the fixed
regulator driver.

Also drop support for the undocumented enable-at-boot property. This
property was not documented in the original commit introducing DT
support, nor is it now, and there are no in-tree device trees that use
this property.

Fixes: 006694d099e8 ("regulator: gpio-regulator: Allow use of GPIO controlled regulators though DT")
Signed-off-by: Chen-Yu Tsai <wens@...e.org>
---
 drivers/regulator/gpio-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c
index 110ee6fe76c4..5646b7a26288 100644
--- a/drivers/regulator/gpio-regulator.c
+++ b/drivers/regulator/gpio-regulator.c
@@ -148,7 +148,7 @@ of_get_gpio_regulator_config(struct device *dev, struct device_node *np,
 
 	config->supply_name = config->init_data->constraints.name;
 
-	if (of_property_read_bool(np, "enable-at-boot"))
+	if (config->init_data->constraints.boot_on)
 		config->enabled_at_boot = true;
 
 	of_property_read_u32(np, "startup-delay-us", &config->startup_delay);
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ