Commit 0969ccef authored by Jan Kiszka's avatar Jan Kiszka Committed by Philippe Gerum
Browse files

x86/hpet: irq_pipeline: Harden clocksource for use in oob



While it's slow, has scalability issues, it remains the second-best
clocksource for Linux on x86. If Linux decides that the TSC is not
reliable we will end up here and should avoid bringing the system into
an unstable state.
Suggested-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 4c475643
......@@ -811,7 +811,7 @@ static u64 read_hpet(struct clocksource *cs)
if (arch_spin_is_locked(&old.lock))
goto contended;
local_irq_save(flags);
flags = hard_local_irq_save();
if (arch_spin_trylock(&hpet.lock)) {
new.value = hpet_readl(HPET_COUNTER);
/*
......@@ -819,10 +819,10 @@ static u64 read_hpet(struct clocksource *cs)
*/
WRITE_ONCE(hpet.value, new.value);
arch_spin_unlock(&hpet.lock);
local_irq_restore(flags);
hard_local_irq_restore(flags);
return (u64)new.value;
}
local_irq_restore(flags);
hard_local_irq_restore(flags);
contended:
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment