summaryrefslogtreecommitdiffstats
path: root/arch/mips64/sgi-ip22/ip22-timer.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-01-17 23:32:45 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-01-17 23:32:45 +0000
commitbb382d1cd598a97151a0edf5ac26e36afb0a64ce (patch)
treefd9f0ca1b31e5af2faa0d7165e6fd0fbb5524ebf /arch/mips64/sgi-ip22/ip22-timer.c
parentaf38bda129551834653720f277a920d7d284bd3d (diff)
- IOC3 driver now will panic when encountering a RX/TX PCI DMA error.
- IOC3 driver does no longer use GFP_DMA which given the _very_ small number of available GFP_DMA pages might have deadlocked the system. - First cut of Origin support. Last minute change: Do no longer use ARC memory / MD hub memory configuration information but klconfig.h stuff. Simpler, faster, shorter. - Zillions of MIPS64 fixes.
Diffstat (limited to 'arch/mips64/sgi-ip22/ip22-timer.c')
-rw-r--r--arch/mips64/sgi-ip22/ip22-timer.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/mips64/sgi-ip22/ip22-timer.c b/arch/mips64/sgi-ip22/ip22-timer.c
index 633bf0ef8..ff8ece37a 100644
--- a/arch/mips64/sgi-ip22/ip22-timer.c
+++ b/arch/mips64/sgi-ip22/ip22-timer.c
@@ -85,6 +85,7 @@ void indy_timer_interrupt(struct pt_regs *regs)
unsigned long count;
int irq = 7;
+ write_lock(&xtime_lock);
/* Ack timer and compute new compare. */
count = read_32bit_cp0_register(CP0_COUNT);
/* This has races. */
@@ -114,6 +115,7 @@ void indy_timer_interrupt(struct pt_regs *regs)
/* do it again in 60s */
last_rtc_update = xtime.tv_sec - 600;
}
+ write_unlock(&xtime_lock);
}
static unsigned long dosample(volatile unsigned char *tcwp,
@@ -252,9 +254,10 @@ void __init indy_timer_init(void)
set_cp0_status(ST0_IM, ALLINTS);
sti();
- /* Read time from the dallas chipset. */
- xtime.tv_sec = get_indy_time();
+ write_lock_irq(&xtime_lock);
+ xtime.tv_sec = get_indy_time(); /* Read time from RTC. */
xtime.tv_usec = 0;
+ write_unlock_irq(&xtime_lock);
}
void indy_8254timer_irq(void)
@@ -274,17 +277,17 @@ void do_gettimeofday(struct timeval *tv)
{
unsigned long flags;
- save_and_cli(flags);
+ read_lock_irqsave(&xtime_lock, flags);
*tv = xtime;
- restore_flags(flags);
+ read_unlock_irqrestore(&xtime_lock, flags);
}
void do_settimeofday(struct timeval *tv)
{
- cli();
+ write_lock_irq(&xtime_lock);
xtime = *tv;
time_state = TIME_BAD;
time_maxerror = MAXPHASE;
time_esterror = MAXPHASE;
- sti();
+ write_unlock_irq(&xtime_lock);
}