]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86, MCE, AMD: Adjust initcall sequence for xen
authorLiu, Jinsong <jinsong.liu@intel.com>
Thu, 7 Jun 2012 11:58:50 +0000 (19:58 +0800)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 12 Jun 2012 18:09:07 +0000 (14:09 -0400)
commit9b6d6b2f40595cc871fada1cadea3e7c86745535
treec57bb4777210bcd0cc6653b11f57de23bd99fcbc
parent6ae14721f1c694492685f223965cae902ad015f2
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.

[upstream git commit 2842a99b6d02232b174971f9840f182c371b05c7]
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>
arch/x86/kernel/cpu/mcheck/mce_amd.c