Skip to content

Commit 00fd6a7

Browse files
committed
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS fix from Ralf Baechle: "Just a fix for empty loops that may be removed by non-antique GCC" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: MIPS: Fix delay loops which may be removed by GCC.
2 parents d72aee7 + c861519 commit 00fd6a7

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

arch/mips/pci/pci-rt2880.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* by the Free Software Foundation.
1212
*/
1313

14+
#include <linux/delay.h>
1415
#include <linux/types.h>
1516
#include <linux/pci.h>
1617
#include <linux/io.h>
@@ -232,8 +233,7 @@ static int rt288x_pci_probe(struct platform_device *pdev)
232233
ioport_resource.end = RT2880_PCI_IO_BASE + RT2880_PCI_IO_SIZE - 1;
233234

234235
rt2880_pci_reg_write(0, RT2880_PCI_REG_PCICFG_ADDR);
235-
for (i = 0; i < 0xfffff; i++)
236-
;
236+
udelay(1);
237237

238238
rt2880_pci_reg_write(0x79, RT2880_PCI_REG_ARBCTL);
239239
rt2880_pci_reg_write(0x07FF0001, RT2880_PCI_REG_BAR0SETUP_ADDR);

arch/mips/pmcs-msp71xx/msp_setup.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* option) any later version.
1111
*/
1212

13+
#include <linux/delay.h>
14+
1315
#include <asm/bootinfo.h>
1416
#include <asm/cacheflush.h>
1517
#include <asm/idle.h>
@@ -77,7 +79,7 @@ void msp7120_reset(void)
7779
*/
7880

7981
/* Wait a bit for the DDRC to settle */
80-
for (i = 0; i < 100000000; i++);
82+
mdelay(125);
8183

8284
#if defined(CONFIG_PMC_MSP7120_GW)
8385
/*

arch/mips/sni/reset.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*
44
* Reset a SNI machine.
55
*/
6+
#include <linux/delay.h>
7+
68
#include <asm/io.h>
79
#include <asm/reboot.h>
810
#include <asm/sni.h>
@@ -32,9 +34,9 @@ void sni_machine_restart(char *command)
3234
for (;;) {
3335
for (i = 0; i < 100; i++) {
3436
kb_wait();
35-
for (j = 0; j < 100000 ; j++)
36-
/* nothing */;
37+
udelay(50);
3738
outb_p(0xfe, 0x64); /* pulse reset low */
39+
udelay(50);
3840
}
3941
}
4042
}

0 commit comments

Comments
 (0)