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]
Message-Id: <20210523231335.8238-3-digetx@gmail.com>
Date:   Mon, 24 May 2021 02:13:23 +0300
From:   Dmitry Osipenko <digetx@...il.com>
To:     Thierry Reding <thierry.reding@...il.com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Michał Mirosław <mirq-linux@...e.qmqm.pl>,
        Nikola Milosavljević <mnidza@...look.com>,
        Ulf Hansson <ulf.hansson@...aro.org>,
        Peter Geis <pgwipeout@...il.com>,
        Nicolas Chauvet <kwizart@...il.com>,
        Viresh Kumar <vireshk@...nel.org>,
        Stephen Boyd <sboyd@...nel.org>,
        Matt Merhar <mattmerhar@...tonmail.com>,
        Paul Fertser <fercerpav@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
        Mikko Perttunen <mperttunen@...dia.com>
Cc:     linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org,
        devicetree@...r.kernel.org, linux-pm@...r.kernel.org,
        Nathan Chancellor <nathan@...nel.org>,
        linux-clk@...r.kernel.org
Subject: [PATCH v2 02/14] regulator: core: Detach coupled regulator before coupling count is dropped

Detach coupled regulator before dropping coupling count in order to allow
detaching callback to balance voltage of regulators. This is needed by
NVIDIA Tegra regulator couplers in order to bring back voltage to a value
that is safe for reboot once regulators are decoupled.

Signed-off-by: Dmitry Osipenko <digetx@...il.com>
---
 drivers/regulator/core.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index aae978c0c148..83571f83af04 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -5084,6 +5084,13 @@ static void regulator_remove_coupling(struct regulator_dev *rdev)
 
 	n_coupled = c_desc->n_coupled;
 
+	if (coupler && coupler->detach_regulator) {
+		err = coupler->detach_regulator(coupler, rdev);
+		if (err)
+			rdev_err(rdev, "failed to detach from coupler: %pe\n",
+				 ERR_PTR(err));
+	}
+
 	for (i = 1; i < n_coupled; i++) {
 		c_rdev = c_desc->coupled_rdevs[i];
 
@@ -5111,13 +5118,6 @@ static void regulator_remove_coupling(struct regulator_dev *rdev)
 		c_desc->n_resolved--;
 	}
 
-	if (coupler && coupler->detach_regulator) {
-		err = coupler->detach_regulator(coupler, rdev);
-		if (err)
-			rdev_err(rdev, "failed to detach from coupler: %pe\n",
-				 ERR_PTR(err));
-	}
-
 	kfree(rdev->coupling_desc.coupled_rdevs);
 	rdev->coupling_desc.coupled_rdevs = NULL;
 }
-- 
2.30.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ