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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 16 Dec 2019 18:06:21 +0100
From:   Robert Karszniewicz <r.karszniewicz@...tec.de>
To:     linux-kernel@...r.kernel.org
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>
Subject: [PATCH 1/1] regulator: of: Hide wrong warning regarding suspend state configuration

A "No configuration" warning is falsely emitted in the case when the
of-property regulator-always-on is set but regulator-(on|off)-in-suspend
isn't set.
This patch fixes the warning by explicitly setting always-on regulator's
states to ENABLE_IN_SUSPEND.

Signed-off-by: Robert Karszniewicz <r.karszniewicz@...tec.de>
---
Tested on v4.19.67, applies cleanly on v5.5-rc2.

 drivers/regulator/of_regulator.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index 210fc20..3acb1571 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -188,8 +188,14 @@ static void of_get_regulation_constraints(struct device_node *np,
 			continue;
 		}
 
+		if (!suspend_state)
+			continue;
+
+		if (constraints->always_on)
+			suspend_state->enabled = ENABLE_IN_SUSPEND;
+
 		suspend_np = of_get_child_by_name(np, regulator_states[i]);
-		if (!suspend_np || !suspend_state)
+		if (!suspend_np)
 			continue;
 
 		if (!of_property_read_u32(suspend_np, "regulator-mode",
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ