Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139706
b: refs/heads/master
c: 303d379
h: refs/heads/master
v: v3
  • Loading branch information
Yasunori Goto authored and Linus Torvalds committed Apr 3, 2009
1 parent 9c32606 commit 2139cca
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 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: 1f80769ffd36e74357fe896dc43dddf1af1510f3
refs/heads/master: 303d379c54fc9ed553562e36c1cbd1791a3f5d17
22 changes: 21 additions & 1 deletion trunk/drivers/char/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ static struct ctl_table_header *sysctl_header;
*/
#define TICK_CALIBRATE (1000UL)

static unsigned long hpet_calibrate(struct hpets *hpetp)
static unsigned long __hpet_calibrate(struct hpets *hpetp)
{
struct hpet_timer __iomem *timer = NULL;
unsigned long t, m, count, i, flags, start;
Expand Down Expand Up @@ -750,6 +750,26 @@ static unsigned long hpet_calibrate(struct hpets *hpetp)
return (m - start) / i;
}

static unsigned long hpet_calibrate(struct hpets *hpetp)
{
unsigned long ret = -1;
unsigned long tmp;

/*
* Try to calibrate until return value becomes stable small value.
* If SMI interruption occurs in calibration loop, the return value
* will be big. This avoids its impact.
*/
for ( ; ; ) {
tmp = __hpet_calibrate(hpetp);
if (ret <= tmp)
break;
ret = tmp;
}

return ret;
}

int hpet_alloc(struct hpet_data *hdp)
{
u64 cap, mcfg;
Expand Down

0 comments on commit 2139cca

Please sign in to comment.