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]
Message-Id: <20200830185356.5365-3-digetx@gmail.com>
Date:   Sun, 30 Aug 2020 21:53:52 +0300
From:   Dmitry Osipenko <digetx@...il.com>
To:     Lee Jones <lee.jones@...aro.org>, Rob Herring <robh+dt@...nel.org>,
        Thierry Reding <thierry.reding@...il.com>,
        Jonathan Hunter <jonathanh@...dia.com>,
        Pavel Machek <pavel@....cz>, Dan Murphy <dmurphy@...com>,
        Sebastian Reichel <sre@...nel.org>,
        Lubomir Rintel <lkundrak@...sk>,
        Mark Brown <broonie@...nel.org>
Cc:     devicetree@...r.kernel.org, linux-tegra@...r.kernel.org,
        linux-leds@...r.kernel.org, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH v2 2/6] regmap: Use flexible sleep

The multi-reg write function uses udelay(), which is a busy-loop based
delaying function that is not suitable for a long delays. Hence let's
replace the udelay() with fsleep(), which is flexible sleep function that
selects best delay function based on the delay-time.

Signed-off-by: Dmitry Osipenko <digetx@...il.com>
---
 drivers/base/regmap/regmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index e93700af7e6e..a417cb1a11dc 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -2231,7 +2231,7 @@ static int _regmap_range_multi_paged_reg_write(struct regmap *map,
 					return ret;
 
 				if (regs[i].delay_us)
-					udelay(regs[i].delay_us);
+					fsleep(regs[i].delay_us);
 
 				base += n;
 				n = 0;
@@ -2268,7 +2268,7 @@ static int _regmap_multi_reg_write(struct regmap *map,
 				return ret;
 
 			if (regs[i].delay_us)
-				udelay(regs[i].delay_us);
+				fsleep(regs[i].delay_us);
 		}
 		return 0;
 	}
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ