Skip to content

Commit a6fcb6d

Browse files
0xB0DIngo Molnar
authored andcommitted
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 <pure.logic@nexus-software.ie> Acked-by: Ong Boon Leong <boon.leong.ong@intel.com> Cc: Borislav Petkov <bp@alien8.de> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> 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 <mingo@kernel.org>
1 parent e42391c commit a6fcb6d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

arch/x86/platform/intel-quark/imr_selftest.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212

1313
#include <asm-generic/sections.h>
14+
#include <asm/cpu_device_id.h>
1415
#include <asm/imr.h>
1516
#include <linux/init.h>
1617
#include <linux/mm.h>
@@ -101,14 +102,21 @@ static void __init imr_self_test(void)
101102
}
102103
}
103104

105+
static const struct x86_cpu_id imr_ids[] __initconst = {
106+
{ X86_VENDOR_INTEL, 5, 9 }, /* Intel Quark SoC X1000. */
107+
{}
108+
};
109+
MODULE_DEVICE_TABLE(x86cpu, imr_ids);
110+
104111
/**
105112
* imr_self_test_init - entry point for IMR driver.
106113
*
107114
* return: -ENODEV for no IMR support 0 if good to go.
108115
*/
109116
static int __init imr_self_test_init(void)
110117
{
111-
imr_self_test();
118+
if (x86_match_cpu(imr_ids))
119+
imr_self_test();
112120
return 0;
113121
}
114122

0 commit comments

Comments
 (0)