aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu, Jinsong <jinsong.liu@intel.com>2012-06-07 07:58:50 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-07-19 15:51:37 -0400
commita8fccdb0617386695a13ec742a61b5c935b63795 (patch)
tree9eaa0d5a3507ae03965457db9158cce801cdb5ca
parentcef12ee52b054282461a6d5fe7742755fa6e3bd3 (diff)
x86, MCE, AMD: Adjust initcall sequence for xen
there are 3 funcs which need to be _initcalled in a logic sequence: 1. xen_late_init_mcelog 2. mcheck_init_device 3. threshold_init_device xen_late_init_mcelog must register xen_mce_chrdev_device before native mce_chrdev_device registration if running under xen platform; mcheck_init_device should be inited before threshold_init_device to initialize mce_device, otherwise a a NULL ptr dereference will cause panic. so we use following _initcalls 1. device_initcall(xen_late_init_mcelog); 2. device_initcall_sync(mcheck_init_device); 3. late_initcall(threshold_init_device); when running under xen, the initcall order is 1,2,3; on baremetal, we skip 1 and we do only 2 and 3. Acked-and-tested-by: Borislav Petkov <bp@amd64.org> Suggested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_amd.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index f4873a64f46d..be5274490428 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -777,4 +777,24 @@ static __init int threshold_init_device(void)
777 777
778 return 0; 778 return 0;
779} 779}
780device_initcall(threshold_init_device); 780/*
781 * there are 3 funcs which need to be _initcalled in a logic sequence:
782 * 1. xen_late_init_mcelog
783 * 2. mcheck_init_device
784 * 3. threshold_init_device
785 *
786 * xen_late_init_mcelog must register xen_mce_chrdev_device before
787 * native mce_chrdev_device registration if running under xen platform;
788 *
789 * mcheck_init_device should be inited before threshold_init_device to
790 * initialize mce_device, otherwise a NULL ptr dereference will cause panic.
791 *
792 * so we use following _initcalls
793 * 1. device_initcall(xen_late_init_mcelog);
794 * 2. device_initcall_sync(mcheck_init_device);
795 * 3. late_initcall(threshold_init_device);
796 *
797 * when running under xen, the initcall order is 1,2,3;
798 * on baremetal, we skip 1 and we do only 2 and 3.
799 */
800late_initcall(threshold_init_device);