x86, mrst: Conditionally register cpu hotplug notifier for apbt

APB timer is used on Moorestown platforms but not on a standard PC.
If APB timer code is compiled in but not initialized at run-time due
to lack of FW reported SFI table, kernel would panic when the non-boot
CPUs are offlined and notifier is called.

https://bugzilla.kernel.org/show_bug.cgi?id=15786

This patch ensures CPU hotplug notifier for APB timer is only registered
when the APBT timer block is initialized.

Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
LKML-Reference: <1271701423-1162-1-git-send-email-jacob.jun.pan@linux.intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>

authored by Jacob Pan and committed by H. Peter Anvin ae7c9b70 05ce7bfe

+1 -1
+1 -1
arch/x86/kernel/apb_timer.c
··· 429 429 430 430 static __init int apbt_late_init(void) 431 431 { 432 - if (disable_apbt_percpu) 432 + if (disable_apbt_percpu || !apb_timer_block_enabled) 433 433 return 0; 434 434 /* This notifier should be called after workqueue is ready */ 435 435 hotcpu_notifier(apbt_cpuhp_notify, -20);