summaryrefslogtreecommitdiff
path: root/arch/mips/loongson64/loongson-3/hpet.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-08-18 19:41:12 +0300
committerIngo Molnar <mingo@kernel.org>2016-08-18 19:41:12 +0300
commitf594d0b9b34aeb8e3ffa524eaa8a4085afb56d22 (patch)
tree7ef81ad042bcfe78dc0f41e05cebfdbc268871c4 /arch/mips/loongson64/loongson-3/hpet.c
parentb3830e8d478cd9fe33e820425ce431c8ef280967 (diff)
parent7b0501b1e7cddd32b265178e32d332bdfbb532d4 (diff)
downloadlinux-f594d0b9b34aeb8e3ffa524eaa8a4085afb56d22.tar.xz
Merge branch 'x86/urgent' into x86/asm, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/mips/loongson64/loongson-3/hpet.c')
-rw-r--r--arch/mips/loongson64/loongson-3/hpet.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/mips/loongson64/loongson-3/hpet.c b/arch/mips/loongson64/loongson-3/hpet.c
index 249039af66c4..4788bea62a6a 100644
--- a/arch/mips/loongson64/loongson-3/hpet.c
+++ b/arch/mips/loongson64/loongson-3/hpet.c
@@ -13,8 +13,8 @@
#define SMBUS_PCI_REG64 0x64
#define SMBUS_PCI_REGB4 0xb4
-#define HPET_MIN_CYCLES 64
-#define HPET_MIN_PROG_DELTA (HPET_MIN_CYCLES + (HPET_MIN_CYCLES >> 1))
+#define HPET_MIN_CYCLES 16
+#define HPET_MIN_PROG_DELTA (HPET_MIN_CYCLES * 12)
static DEFINE_SPINLOCK(hpet_lock);
DEFINE_PER_CPU(struct clock_event_device, hpet_clockevent_device);
@@ -157,14 +157,14 @@ static int hpet_tick_resume(struct clock_event_device *evt)
static int hpet_next_event(unsigned long delta,
struct clock_event_device *evt)
{
- unsigned int cnt;
- int res;
+ u32 cnt;
+ s32 res;
cnt = hpet_read(HPET_COUNTER);
- cnt += delta;
+ cnt += (u32) delta;
hpet_write(HPET_T0_CMP, cnt);
- res = (int)(cnt - hpet_read(HPET_COUNTER));
+ res = (s32)(cnt - hpet_read(HPET_COUNTER));
return res < HPET_MIN_CYCLES ? -ETIME : 0;
}
@@ -230,7 +230,7 @@ void __init setup_hpet_timer(void)
cd = &per_cpu(hpet_clockevent_device, cpu);
cd->name = "hpet";
- cd->rating = 320;
+ cd->rating = 100;
cd->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
cd->set_state_shutdown = hpet_set_state_shutdown;
cd->set_state_periodic = hpet_set_state_periodic;