MIPS: Fix delay loops which may be removed by GCC.
GCC 4.1 and newer remove empty loops. This becomes a problem when delay loops get removed. Fixed by rewriting to user the proper Linux interface for such delays. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Reported-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Acked-by: John Crispin <blogic@openwrt.org>
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
*
|
||||
* Reset a SNI machine.
|
||||
*/
|
||||
#include <linux/delay.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/reboot.h>
|
||||
#include <asm/sni.h>
|
||||
@@ -32,9 +34,9 @@ void sni_machine_restart(char *command)
|
||||
for (;;) {
|
||||
for (i = 0; i < 100; i++) {
|
||||
kb_wait();
|
||||
for (j = 0; j < 100000 ; j++)
|
||||
/* nothing */;
|
||||
udelay(50);
|
||||
outb_p(0xfe, 0x64); /* pulse reset low */
|
||||
udelay(50);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user