Re: [PATCH] panic: Fix panic_timeout accuracy when running on ahypervisor

From: Anton Blanchard
Date: Mon Feb 01 2010 - 19:53:21 EST



Hi Andrew,

> > +static void panic_blink_one_second(void)
> > +{
> > + static long i = 0, end;
>
> I assumed the `static' was a brainfart and removed it?

...

> In fact we can simplify it a bit:
>
> --- a/kernel/panic.c~panic-fix-panic_timeout-accuracy-when-running-on-a-hypervisor-fix
> +++ a/kernel/panic.c
> @@ -42,12 +42,10 @@ EXPORT_SYMBOL(panic_blink);
>
> static void panic_blink_one_second(void)
> {
> - static long i = 0, end;
> -
> if (panic_blink) {
> - end = i + MSEC_PER_SEC;
> + long i = 0;
>
> - while (i < end) {
> + while (i < MSEC_PER_SEC) {
> i += panic_blink(i);
> mdelay(1);
> i++;

Unfortunately the panic_blink users seem to rely on count ever increasing:

static long i8042_panic_blink(long count)
{
...
static long last_blink;
...
if (count - last_blink < i8042_blink_frequency)
return 0;

If we reset to 0 each second, this is going to always be true. Ugly interface.

Anton
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/