lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ef1cd66f0808230148u317eb063xac80a319414c9f33@mail.gmail.com>
Date:	Sat, 23 Aug 2008 09:48:08 +0100
From:	"Jochen Voß" <jochen.voss@...glemail.com>
To:	"Dominik Brodowski" <linux@...inikbrodowski.net>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"Andreas Mohr" <andi@...as.de>, linux-kernel@...r.kernel.org,
	linux-acpi@...r.kernel.org, johnstul@...ibm.com,
	hirofumi@...l.parknet.co.jp, alan@...rguk.ukuu.org.uk,
	arjan@...radead.org
Subject: Re: [PATCH v2 2/2] acpi_pm.c: check for monotonicity

Hi,

some minor comments:

2008/8/22 Dominik Brodowski <linux@...inikbrodowski.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/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ