[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <9b06e8d20908011037m6b0f72cch154ed1e15bdc8938@mail.gmail.com>
Date: Sat, 1 Aug 2009 19:37:18 +0200
From: Loïc Grenié <loic.grenie@...il.com>
To: linux-kernel <linux-kernel@...r.kernel.org>,
Ralf Baechle <ralf@...ux-mips.org>
Subject: Strange arch/mips/delay.c
I could not compile for mips without something similar to the
following patch. As far as I can say __udelay and __ndelay
are costly nops (with __ndelay not compiling at all) without
the patch.
At that point, it might be interesting to change
the 0x00000005uLL by 0x00000045uLL and the >> 32
by >> 36 (the precision is much better and the cost
should be the same -- obviously there is a slightly higher
risk of overlow).
Thanks,
Loïc Grenié
Signed-off-by: Loic Grenie <loic.grenie@...il.com>
--- a/arch/mips/lib/delay.c
+++ b/arch/mips/lib/delay.c
@@ -43,7 +43,7 @@ void __udelay(unsigned long us)
{
unsigned int lpj = current_cpu_data.udelay_val;
- __delay((us * 0x000010c7 * HZ * lpj) >> 32);
+ __delay((us * 0x000010c7uLL * HZ * lpj) >> 32);
}
EXPORT_SYMBOL(__udelay);
@@ -51,6 +51,6 @@ void __ndelay(unsigned long ns)
{
unsigned int lpj = current_cpu_data.udelay_val;
- __delay((us * 0x00000005 * HZ * lpj) >> 32);
+ __delay((ns * 0x00000005uLL * HZ * lpj) >> 32);
}
EXPORT_SYMBOL(__ndelay);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists