Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109885
b: refs/heads/master
c: f1926ce
h: refs/heads/master
i:
  109883: 231029a
v: v3
  • Loading branch information
Dominik Brodowski authored and Ingo Molnar committed Sep 11, 2008
1 parent 518d2dc commit 8402a51
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 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: 6ef62164e794c480259ac158aa6c8c7b85746545
refs/heads/master: f1926ce63b996b42772b39e4b47bb4ef4ba748b4
21 changes: 10 additions & 11 deletions trunk/drivers/clocksource/acpi_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,13 @@ static int verify_pmtmr_rate(void)

/* Number of monotonicity checks to perform during initialization */
#define ACPI_PM_MONOTONICITY_CHECKS 10
/* Number of reads we try to get two different values */
#define ACPI_PM_READ_CHECKS 10000

static int __init init_acpi_pm_clocksource(void)
{
cycle_t value1, value2;
unsigned int i, j, good = 0;
unsigned int i, j = 0;

if (!pmtmr_ioport)
return -ENODEV;
Expand All @@ -192,29 +194,26 @@ static int __init init_acpi_pm_clocksource(void)

/* "verify" this timing source: */
for (j = 0; j < ACPI_PM_MONOTONICITY_CHECKS; j++) {
udelay(100 * j);
value1 = clocksource_acpi_pm.read();
for (i = 0; i < 10000; i++) {
for (i = 0; i < ACPI_PM_READ_CHECKS; i++) {
value2 = clocksource_acpi_pm.read();
if (value2 == value1)
continue;
if (value2 > value1)
good++;
break;
if ((value2 < value1) && ((value2) < 0xFFF))
good++;
break;
printk(KERN_INFO "PM-Timer had inconsistent results:"
" 0x%#llx, 0x%#llx - aborting.\n",
value1, value2);
return -EINVAL;
}
udelay(300 * i);
}

if (good != ACPI_PM_MONOTONICITY_CHECKS) {
printk(KERN_INFO "PM-Timer failed consistency check "
" (0x%#llx) - aborting.\n", value1);
return -ENODEV;
if (i == ACPI_PM_READ_CHECKS) {
printk(KERN_INFO "PM-Timer failed consistency check "
" (0x%#llx) - aborting.\n", value1);
return -ENODEV;
}
}

if (verify_pmtmr_rate() != 0)
Expand Down

0 comments on commit 8402a51

Please sign in to comment.