Re: [PATCH][trivial] line up 'ESR value before/after enabling vector' messages

From: Dave Jones
Date: Wed Aug 11 2004 - 05:50:32 EST


On Wed, Aug 11, 2004 at 08:23:14AM +0200, Ingo Molnar wrote:
>
> * Jesper Juhl <juhl-lkml@xxxxxx> wrote:
>
> > - " %08lx\n", value);
> > + " %08lx\n", value);
>
> > - Dprintk("ESR value after enabling vector: %08x\n", value);
> > + Dprintk("ESR value after enabling vector: %08x\n", value);
>
> Signed-off-by: Ingo Molnar <mingo@xxxxxxx>

Has this printk actually been useful ? ever ?
I notice a majority of the time, it never changes too.
If it is useful, how about changing it so it prints something
if the value changed ? (Something like patch below maybe?)
Or is possible for the APIC to lock up between the two printk's ?

Dave


Only print out the ESR value if it changes after enabling vector.

Signed-off-by: Dave Jones <davej@xxxxxxxxxx>

--- 1/arch/i386/kernel/apic.c~ 2004-08-11 11:43:32.022485536 +0100
+++ 2/arch/i386/kernel/apic.c 2004-08-11 11:45:10.824465352 +0100
@@ -335,7 +335,7 @@

void __init setup_local_APIC (void)
{
- unsigned long value, ver, maxlvt;
+ unsigned long oldvalue, value, ver, maxlvt;

/* Pound the ESR really hard over the head with a big hammer - mbligh */
if (esr_disable) {
@@ -449,9 +449,7 @@
maxlvt = get_maxlvt();
if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */
apic_write(APIC_ESR, 0);
- value = apic_read(APIC_ESR);
- printk("ESR value before enabling vector: %08lx\n", value);
-
+ oldvalue = apic_read(APIC_ESR);
value = ERROR_APIC_VECTOR; // enables sending errors
apic_write_around(APIC_LVTERR, value);
/*
@@ -460,7 +458,9 @@
if (maxlvt > 3)
apic_write(APIC_ESR, 0);
value = apic_read(APIC_ESR);
- printk("ESR value after enabling vector: %08lx\n", value);
+ if (value != oldvalue)
+ printk("ESR value before enabling vector: %08lx after: %08lx\n",
+ oldvalue, value);
} else {
if (esr_disable)
/*
-
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/