mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: barebox@lists.infradead.org
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH v7 03/10] clock: Use udelay() to implement mdelay()
Date: Thu, 14 Jun 2018 20:44:02 -0700	[thread overview]
Message-ID: <20180615034409.22180-4-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <20180615034409.22180-1-andrew.smirnov@gmail.com>

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 common/clock.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/common/clock.c b/common/clock.c
index f98176dd5..0c6cb399b 100644
--- a/common/clock.c
+++ b/common/clock.c
@@ -206,9 +206,11 @@ EXPORT_SYMBOL(udelay);
 
 void mdelay(unsigned long msecs)
 {
-	uint64_t start = get_time_ns();
-
-	while(!is_timeout(start, msecs * MSECOND));
+	/*
+	 * Parens around division below are needed to prevent ARM/EABI
+	 * toolchain from emitting a call to __aeabi_uldivmod.
+	 */
+	udelay(msecs * (MSECOND / USECOND));
 }
 EXPORT_SYMBOL(mdelay);
 
-- 
2.17.0


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

  parent reply	other threads:[~2018-06-15  3:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15  3:43 [PATCH v7 00/10] ARM: i.MX8MQ and EVK support Andrey Smirnov
2018-06-15  3:44 ` [PATCH v7 01/10] ARM: i.MX: ocotp: Provide missing .format_mac for i.MX8MQ Andrey Smirnov
2018-06-15  3:44 ` [PATCH v7 02/10] Port <linux/iopoll.h> from U-Boot Andrey Smirnov
2018-06-15  3:44 ` Andrey Smirnov [this message]
2018-06-15  3:44 ` [PATCH v7 04/10] ARM: i.MX8: Add DDRC PHY support code Andrey Smirnov
2018-06-15  3:44 ` [PATCH v7 05/10] ARM: Specify HAVE_PBL_IMAGE for CPU_64 Andrey Smirnov
2018-06-15  3:44 ` [PATCH v7 06/10] scripts: imx-image: Use a loop to create multiple header copies Andrey Smirnov
2018-06-15  3:44 ` [PATCH v7 07/10] scripts: imx-image: Share the code to write barebox header Andrey Smirnov
2018-06-15  3:44 ` [PATCH v7 08/10] scripts: imx-image: Add i.MX8MQ support Andrey Smirnov
2018-06-15  3:44 ` [PATCH v7 09/10] ARM: i.MX8: Add i.MX8mq EVK support Andrey Smirnov
2018-06-15  3:44 ` [PATCH v7 10/10] ARM: Introduce imx_v8_defconfig Andrey Smirnov
2018-06-15  7:06 ` [PATCH v7 00/10] ARM: i.MX8MQ and EVK support Sascha Hauer
2018-06-15 12:24   ` Andrey Smirnov

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=20180615034409.22180-4-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@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