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:   Wed, 12 Apr 2017 09:58:43 +0800
From:   Dong Aisheng <aisheng.dong@....com>
To:     <linux-kernel@...r.kernel.org>
CC:     <shawnguo@...nel.org>, <linux-arm-kernel@...ts.infradead.org>,
        <aisheng.dong@....com>, <kernel@...gutronix.de>,
        <lgirdwood@...il.com>, <broonie@...nel.org>, <yibin.gong@....com>
Subject: [PATCH 2/6] regulator: anatop: only set supply regulator when it actually exists

Mandatorily set the initdata->supply_regulator while it actually not
exist will cause regulator core to resolve supply each time whenever
a new regulator registered which is meaningless and waste CPU mips.

We can observe more than one hundred times of iteration of resolving
during a MX6Q SDB board booting up.

This patch adds the condition check for vin-supply to avoid the issue.

Cc: Liam Girdwood <lgirdwood@...il.com>
Cc: Mark Brown <broonie@...nel.org>
Cc: Shawn Guo <shawnguo@...nel.org>
Cc: Sascha Hauer <kernel@...gutronix.de>
Cc: Robin Gong <yibin.gong@....com>
Signed-off-by: Dong Aisheng <aisheng.dong@....com>
---
 drivers/regulator/anatop-regulator.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index 46b9c2c..2a97ada 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -203,7 +203,9 @@ static int anatop_regulator_probe(struct platform_device *pdev)
 	if (!initdata)
 		return -ENOMEM;
 
-	initdata->supply_regulator = "vin";
+	if (of_find_property(np, "vin-supply", NULL))
+		initdata->supply_regulator = "vin";
+
 	sreg->initdata = initdata;
 
 	anatop_np = of_get_parent(np);
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ