Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135740
b: refs/heads/master
c: 8d6f0c8
h: refs/heads/master
v: v3
  • Loading branch information
Andreas Herrmann authored and Ingo Molnar committed Feb 22, 2009
1 parent 25d5a91 commit fa2651b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b98103a5597b87211a1c74077b06faeac554bedc
refs/heads/master: 8d6f0c8214928f7c5083dd54ecb69c5d615b516e
22 changes: 16 additions & 6 deletions trunk/arch/x86/kernel/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,27 +231,37 @@ static struct clock_event_device hpet_clockevent = {
.rating = 50,
};

static void hpet_start_counter(void)
static void hpet_stop_counter(void)
{
unsigned long cfg = hpet_readl(HPET_CFG);

cfg &= ~HPET_CFG_ENABLE;
hpet_writel(cfg, HPET_CFG);
hpet_writel(0, HPET_COUNTER);
hpet_writel(0, HPET_COUNTER + 4);
}

static void hpet_start_counter(void)
{
unsigned long cfg = hpet_readl(HPET_CFG);
cfg |= HPET_CFG_ENABLE;
hpet_writel(cfg, HPET_CFG);
}

static void hpet_restart_counter(void)
{
hpet_stop_counter();
hpet_start_counter();
}

static void hpet_resume_device(void)
{
force_hpet_resume();
}

static void hpet_restart_counter(void)
static void hpet_resume_counter(void)
{
hpet_resume_device();
hpet_start_counter();
hpet_restart_counter();
}

static void hpet_enable_legacy_int(void)
Expand Down Expand Up @@ -738,7 +748,7 @@ static struct clocksource clocksource_hpet = {
.mask = HPET_MASK,
.shift = HPET_SHIFT,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
.resume = hpet_restart_counter,
.resume = hpet_resume_counter,
#ifdef CONFIG_X86_64
.vread = vread_hpet,
#endif
Expand All @@ -750,7 +760,7 @@ static int hpet_clocksource_register(void)
cycle_t t1;

/* Start the counter */
hpet_start_counter();
hpet_restart_counter();

/* Verify whether hpet counter works */
t1 = read_hpet();
Expand Down

0 comments on commit fa2651b

Please sign in to comment.