From: Bryan O'Donoghue Date: Tue, 31 Mar 2015 11:15:36 +0000 (+0100) Subject: x86/intel/quark: Run IMR self-test on IMR capble hw only X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a6fcb6d4804b51ffcae7881c7f99483f4981ddf1;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git x86/intel/quark: Run IMR self-test on IMR capble hw only Automated testing with LKP shows IMR self test code running and printing error messages on QEMU hardware lacking IMR support. Update IMR self-test code to run only when IMR hardware should be present. Tested on Quark X1000 and QEMU. Signed-off-by: Bryan O'Donoghue Acked-by: Ong Boon Leong Cc: Borislav Petkov Cc: H. Peter Anvin Cc: Thomas Gleixner Cc: andriy.shevchenko@intel.com Cc: dvhart@linux.intel.com Cc: huang.ying.caritas@gmail.com Cc: ying.huang@intel.com Link: http://lkml.kernel.org/r/1427800536-32339-1-git-send-email-pure.logic@nexus-software.ie Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/platform/intel-quark/imr_selftest.c b/arch/x86/platform/intel-quark/imr_selftest.c index c9a0838890e2..278e4da4222f 100644 --- a/arch/x86/platform/intel-quark/imr_selftest.c +++ b/arch/x86/platform/intel-quark/imr_selftest.c @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -101,6 +102,12 @@ static void __init imr_self_test(void) } } +static const struct x86_cpu_id imr_ids[] __initconst = { + { X86_VENDOR_INTEL, 5, 9 }, /* Intel Quark SoC X1000. */ + {} +}; +MODULE_DEVICE_TABLE(x86cpu, imr_ids); + /** * imr_self_test_init - entry point for IMR driver. * @@ -108,7 +115,8 @@ static void __init imr_self_test(void) */ static int __init imr_self_test_init(void) { - imr_self_test(); + if (x86_match_cpu(imr_ids)) + imr_self_test(); return 0; }