lkml.org 
[lkml]   [2008]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/2] acpi_pm.c: check for monotonicity
Hi,

some minor comments:

2008/8/22 Dominik Brodowski <linux@dominikbrodowski.net>:
> + for (j = 0; j < ACPI_PM_MONOTONICITY_CHECKS; j++) {
> + value1 = clocksource_acpi_pm.read();
> + for (i = 0; i < 10000; i++) {
> + value2 = clocksource_acpi_pm.read();
> + if (value2 == value1)
> + continue;
> + if (value2 > value1)
> + good++;
> + break;
> + if ((value2 < value1) && ((value2) < 0xFFF))
The brackets arout value2 are not needed and look strange.

> + good++;
> + break;
> + printk(KERN_INFO "PM-Timer had inconsistent results:"
> + " 0x%#llx, 0x%#llx - aborting.\n",
> + value1, value2);
> + return -EINVAL;
> + }
> + udelay(300 * i);
300*10000 microseconds seems like a long time to me. Is this the
intended maximal delay?

> + }
> +
> + if (good != ACPI_PM_MONOTONICITY_CHECKS) {
> + printk(KERN_INFO "PM-Timer failed consistency check "
> + " (0x%#llx) - aborting.\n", value1);
> + return -ENODEV;
If the inner loop runs out once, you alreay know that you will later
abort here. Maybe move the check directly after the inner loop to
avoid the additional delay (10*10000*300 microseconds = 30 seconds) in
case of failure?

I hope this helps,
Jochen
--
http://seehuhn.de/


\
 
 \ /
  Last update: 2008-08-23 10:51    [W:1.887 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site