Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform/x86/intel/ifs: Sysfs interface for Array BIST

The interface to trigger Array BIST test and obtain its result
is similar to the existing scan test. The only notable
difference is that, Array BIST doesn't require any test content
to be loaded. So binary load related options are not needed for
this test.

Add sysfs interface for array BIST test, the testing support will
be added by subsequent patch.

Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20230322003359.213046-7-jithu.joseph@intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Jithu Joseph and committed by
Hans de Goede
5210fb4e d31bbdf4

+24 -6
+2
drivers/platform/x86/intel/ifs/core.c
··· 22 22 MODULE_DEVICE_TABLE(x86cpu, ifs_cpu_ids); 23 23 24 24 ATTRIBUTE_GROUPS(plat_ifs); 25 + ATTRIBUTE_GROUPS(plat_ifs_array); 25 26 26 27 bool *ifs_pkg_auth; 27 28 ··· 50 49 .misc = { 51 50 .name = "intel_ifs_1", 52 51 .minor = MISC_DYNAMIC_MINOR, 52 + .groups = plat_ifs_array_groups, 53 53 }, 54 54 }, 55 55 };
+1
drivers/platform/x86/intel/ifs/ifs.h
··· 256 256 int ifs_load_firmware(struct device *dev); 257 257 int do_core_test(int cpu, struct device *dev); 258 258 extern struct attribute *plat_ifs_attrs[]; 259 + extern struct attribute *plat_ifs_array_attrs[]; 259 260 260 261 #endif
+12 -1
drivers/platform/x86/intel/ifs/runtest.c
··· 236 236 */ 237 237 int do_core_test(int cpu, struct device *dev) 238 238 { 239 + const struct ifs_test_caps *test = ifs_get_test_caps(dev); 240 + struct ifs_data *ifsd = ifs_get_data(dev); 239 241 int ret = 0; 240 242 241 243 /* Prevent CPUs from being taken offline during the scan test */ ··· 249 247 goto out; 250 248 } 251 249 252 - ifs_test_core(cpu, dev); 250 + switch (test->test_num) { 251 + case IFS_TYPE_SAF: 252 + if (!ifsd->loaded) 253 + return -EPERM; 254 + ifs_test_core(cpu, dev); 255 + break; 256 + case IFS_TYPE_ARRAY_BIST: 257 + default: 258 + return -EINVAL; 259 + } 253 260 out: 254 261 cpus_read_unlock(); 255 262 return ret;
+9 -5
drivers/platform/x86/intel/ifs/sysfs.c
··· 64 64 struct device_attribute *attr, 65 65 const char *buf, size_t count) 66 66 { 67 - struct ifs_data *ifsd = ifs_get_data(dev); 68 67 unsigned int cpu; 69 68 int rc; 70 69 ··· 74 75 if (down_interruptible(&ifs_sem)) 75 76 return -EINTR; 76 77 77 - if (!ifsd->loaded) 78 - rc = -EPERM; 79 - else 80 - rc = do_core_test(cpu, dev); 78 + rc = do_core_test(cpu, dev); 81 79 82 80 up(&ifs_sem); 83 81 ··· 143 147 &dev_attr_run_test.attr, 144 148 &dev_attr_current_batch.attr, 145 149 &dev_attr_image_version.attr, 150 + NULL 151 + }; 152 + 153 + /* global array sysfs attributes */ 154 + struct attribute *plat_ifs_array_attrs[] = { 155 + &dev_attr_details.attr, 156 + &dev_attr_status.attr, 157 + &dev_attr_run_test.attr, 146 158 NULL 147 159 };