mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Peter Mamonov <pmamonov@gmail.com>
To: barebox@lists.infradead.org
Cc: Peter Mamonov <pmamonov@gmail.com>
Subject: [PATCH v7 1/5] common: clock: introduce mdelay_non_interruptible()
Date: Thu, 24 Sep 2015 19:20:24 +0300	[thread overview]
Message-ID: <1443111628-12758-2-git-send-email-pmamonov@gmail.com> (raw)
In-Reply-To: <1443111628-12758-1-git-send-email-pmamonov@gmail.com>

Signed-off-by: Peter Mamonov <pmamonov@gmail.com>
---
 common/clock.c   | 9 +++++++++
 include/clock.h  | 1 +
 include/common.h | 1 +
 3 files changed, 11 insertions(+)

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;
diff --git a/include/clock.h b/include/clock.h
index 691befc..68d71d7 100644
--- a/include/clock.h
+++ b/include/clock.h
@@ -38,6 +38,7 @@ int is_timeout_non_interruptible(uint64_t start_ns, uint64_t time_offset_ns);
 
 void ndelay(unsigned long nsecs);
 void mdelay(unsigned long msecs);
+void mdelay_non_interruptible (unsigned long msecs);
 
 #define SECOND ((uint64_t)(1000 * 1000 * 1000))
 #define MSECOND ((uint64_t)(1000 * 1000))
diff --git a/include/common.h b/include/common.h
index 553a7f4..c576908 100644
--- a/include/common.h
+++ b/include/common.h
@@ -72,6 +72,7 @@ void __noreturn poweroff(void);
 /* lib_$(ARCH)/time.c */
 void	udelay (unsigned long);
 void	mdelay (unsigned long);
+void	mdelay_non_interruptible (unsigned long);
 
 /* lib_generic/crc32.c */
 uint32_t crc32(uint32_t, const void*, unsigned int);
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2015-09-24 16:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24 16:20 [PATCH v7 0/5] input: add usb keyboard driver Peter Mamonov
2015-09-24 16:20 ` Peter Mamonov [this message]
2015-09-24 16:20 ` [PATCH v7 2/5] usb: ehci-hcd: port periodic transactions implementation from the u-boot Peter Mamonov
2015-09-24 16:20 ` [PATCH v7 3/5] usb: ehci-hcd: detect re-entrance Peter Mamonov
2015-09-24 16:20 ` [PATCH v7 4/5] usb: ehci-hcd: use mdelay_non_interruptible() Peter Mamonov
2015-09-24 16:20 ` [PATCH v7 5/5] input: port usb keyboard driver from the u-boot Peter Mamonov
2015-09-29  6:43 ` [PATCH v7 0/5] input: add usb keyboard driver Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1443111628-12758-2-git-send-email-pmamonov@gmail.com \
    --to=pmamonov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox