summaryrefslogtreecommitdiffstats
path: root/common/clock.c
diff options
context:
space:
mode:
authorPeter Mamonov <pmamonov@gmail.com>2015-09-24 19:20:24 +0300
committerSascha Hauer <s.hauer@pengutronix.de>2015-10-02 07:50:51 +0200
commit8165f3131c6515fd7375dce7e2ee5759f237e011 (patch)
tree9415ad13bedbcaad7561e2f1fbbd4739a5c359b1 /common/clock.c
parentd27cddcc3ad5c37c22acf287a5dbe36a0906359f (diff)
downloadbarebox-8165f3131c6515fd7375dce7e2ee5759f237e011.tar.gz
common: clock: introduce mdelay_non_interruptible()
Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/clock.c')
-rw-r--r--common/clock.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/clock.c b/common/clock.c
index 35c9e6c..2c5dd91 100644
--- a/common/clock.c
+++ b/common/clock.c
@@ -202,6 +202,15 @@ void mdelay(unsigned long msecs)
}
EXPORT_SYMBOL(mdelay);
+void mdelay_non_interruptible(unsigned long msecs)
+{
+ uint64_t start = get_time_ns();
+
+ while (!is_timeout_non_interruptible(start, msecs * MSECOND))
+ ;
+}
+EXPORT_SYMBOL(mdelay_non_interruptible);
+
int init_clock(struct clocksource *cs)
{
current_clock = cs;