Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165696
b: refs/heads/master
c: ae21cf9
h: refs/heads/master
v: v3
  • Loading branch information
Nils Carlson authored and Linus Torvalds committed Sep 24, 2009
1 parent 97c7950 commit d32f88a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 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: dc80df567dd04738ee8b3922feacf099ae81645e
refs/heads/master: ae21cf9248584d9b3776bfe2ebec47256bf098f8
21 changes: 12 additions & 9 deletions trunk/drivers/char/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,8 @@ static irqreturn_t hpet_interrupt(int irq, void *data)
unsigned long m, t;

t = devp->hd_ireqfreq;
m = read_counter(&devp->hd_hpet->hpet_mc);
write_counter(t + m + devp->hd_hpets->hp_delta,
&devp->hd_timer->hpet_compare);
m = read_counter(&devp->hd_timer->hpet_compare);
write_counter(t + m, &devp->hd_timer->hpet_compare);
}

if (devp->hd_flags & HPET_SHARED_IRQ)
Expand Down Expand Up @@ -504,21 +503,25 @@ static int hpet_ioctl_ieon(struct hpet_dev *devp)
g = v | Tn_32MODE_CNF_MASK | Tn_INT_ENB_CNF_MASK;

if (devp->hd_flags & HPET_PERIODIC) {
write_counter(t, &timer->hpet_compare);
g |= Tn_TYPE_CNF_MASK;
v |= Tn_TYPE_CNF_MASK;
writeq(v, &timer->hpet_config);
v |= Tn_VAL_SET_CNF_MASK;
v |= Tn_TYPE_CNF_MASK | Tn_VAL_SET_CNF_MASK;
writeq(v, &timer->hpet_config);
local_irq_save(flags);

/* NOTE: what we modify here is a hidden accumulator
/*
* NOTE: First we modify the hidden accumulator
* register supported by periodic-capable comparators.
* We never want to modify the (single) counter; that
* would affect all the comparators.
* would affect all the comparators. The value written
* is the counter value when the first interrupt is due.
*/
m = read_counter(&hpet->hpet_mc);
write_counter(t + m + hpetp->hp_delta, &timer->hpet_compare);
/*
* Then we modify the comparator, indicating the period
* for subsequent interrupt.
*/
write_counter(t, &timer->hpet_compare);
} else {
local_irq_save(flags);
m = read_counter(&hpet->hpet_mc);
Expand Down

0 comments on commit d32f88a

Please sign in to comment.