Suspend 2 merge: 19/51: Remove MTRR sysdev support.

From: Nigel Cunningham
Date: Wed Nov 24 2004 - 09:24:23 EST


This patch removes sysdev support for MTRRs (potential SMP hang and
shouldn't be done with interrupts done anyway). Instead, we save and
restore MTRRs when entering and exiting the processor freezers (ie when
saving the registers & context for each CPU via an SMP call).

diff -ruN 510-mtrr-remove-sysdev-old/arch/i386/kernel/cpu/mtrr/main.c 510-mtrr-remove-sysdev-new/arch/i386/kernel/cpu/mtrr/main.c
--- 510-mtrr-remove-sysdev-old/arch/i386/kernel/cpu/mtrr/main.c 2004-11-03 21:51:13.000000000 +1100
+++ 510-mtrr-remove-sysdev-new/arch/i386/kernel/cpu/mtrr/main.c 2004-11-04 16:27:40.000000000 +1100
@@ -167,7 +167,6 @@
atomic_dec(&data->count);
local_irq_restore(flags);
}
-
#endif

/**
@@ -564,7 +563,7 @@

static struct mtrr_value * mtrr_state;

-static int mtrr_save(struct sys_device * sysdev, u32 state)
+int mtrr_save(void)
{
int i;
int size = num_var_ranges * sizeof(struct mtrr_value);
@@ -584,28 +583,27 @@
return 0;
}

-static int mtrr_restore(struct sys_device * sysdev)
+/* Restore mtrrs on this CPU only.
+ * Done with interrupts disabled via __smp_lowlevel_suspend
+ */
+int mtrr_restore_one_cpu(void)
{
int i;

for (i = 0; i < num_var_ranges; i++) {
if (mtrr_state[i].lsize)
- set_mtrr(i,
+ mtrr_if->set(i,
mtrr_state[i].lbase,
mtrr_state[i].lsize,
mtrr_state[i].ltype);
}
- kfree(mtrr_state);
return 0;
}

-
-
-static struct sysdev_driver mtrr_sysdev_driver = {
- .suspend = mtrr_save,
- .resume = mtrr_restore,
-};
-
+void mtrr_restore_finish(void)
+{
+ kfree(mtrr_state);
+}

/**
* mtrr_init - initialize mtrrs on the boot CPU
@@ -692,8 +690,7 @@
init_table();
init_other_cpus();

- return sysdev_driver_register(&cpu_sysdev_class,
- &mtrr_sysdev_driver);
+ return 0;
}
return -ENXIO;
}


-
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/