mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-22 09:22:37 +00:00
MIPS: malta-time: Start GIC count before syncing to RTC
The sampling of the GIC counter on Malta after observing a rising edge of the RTC update flag differs slightly between the first and second sample, with the first sample also calling gic_start_count(). The two samples should really be taken as similarly as possible to get the most accurate figure, so move the gic_start_count() call before detecting the rising edge. Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: James Hogan <james.hogan@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/13173/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
parent
6b8322576e
commit
aab4673b59
@ -81,16 +81,16 @@ static void __init estimate_frequencies(void)
|
||||
|
||||
local_irq_save(flags);
|
||||
|
||||
/* Start counter exactly on falling edge of update flag. */
|
||||
if (gic_present)
|
||||
gic_start_count();
|
||||
|
||||
/* Read counter exactly on falling edge of update flag. */
|
||||
while (CMOS_READ(RTC_REG_A) & RTC_UIP);
|
||||
while (!(CMOS_READ(RTC_REG_A) & RTC_UIP));
|
||||
|
||||
/* Initialize counters. */
|
||||
start = read_c0_count();
|
||||
if (gic_present) {
|
||||
gic_start_count();
|
||||
if (gic_present)
|
||||
gicstart = gic_read_count();
|
||||
}
|
||||
|
||||
/* Read counter exactly on falling edge of update flag. */
|
||||
while (CMOS_READ(RTC_REG_A) & RTC_UIP);
|
||||
|
Loading…
Reference in New Issue
Block a user