]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
platform/x86/intel/ifs: Remove image loading during init
authorJithu Joseph <jithu.joseph@intel.com>
Thu, 17 Nov 2022 03:59:22 +0000 (19:59 -0800)
committerBorislav Petkov <bp@suse.de>
Fri, 18 Nov 2022 20:37:04 +0000 (21:37 +0100)
IFS test image is unnecessarily loaded during driver initialization.
Drop image loading during ifs_init() and improve module load time. With
this change, user has to load one when starting the tests.

As a consequence, make ifs_sem static as it is only used within sysfs.c

Suggested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Sohil Mehta <sohil.mehta@intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20221117035935.4136738-4-jithu.joseph@intel.com
drivers/platform/x86/intel/ifs/core.c
drivers/platform/x86/intel/ifs/ifs.h
drivers/platform/x86/intel/ifs/sysfs.c

index 27204e3d674d1ca852b3f788de7b820a58ba800f..5fb7f655c291c291784ce5f420458db04c4c15d6 100644 (file)
@@ -51,12 +51,8 @@ static int __init ifs_init(void)
        ifs_device.misc.groups = ifs_get_groups();
 
        if ((msrval & BIT(ifs_device.data.integrity_cap_bit)) &&
-           !misc_register(&ifs_device.misc)) {
-               down(&ifs_sem);
-               ifs_load_firmware(ifs_device.misc.this_device);
-               up(&ifs_sem);
+           !misc_register(&ifs_device.misc))
                return 0;
-       }
 
        return -ENODEV;
 }
index 73c8e91cf144deb4054a994e207b6539cc7d872a..3ff1d9aaeaa9e25a75e46b46092f1bf50c81d21c 100644 (file)
@@ -229,6 +229,4 @@ void ifs_load_firmware(struct device *dev);
 int do_core_test(int cpu, struct device *dev);
 const struct attribute_group **ifs_get_groups(void);
 
-extern struct semaphore ifs_sem;
-
 #endif
index 37d8380d6fa8158b62670874716dbd01fe446010..65dd6fea5342fdec33af60b65fd39144e5fbef9b 100644 (file)
@@ -13,7 +13,7 @@
  * Protects against simultaneous tests on multiple cores, or
  * reloading can file while a test is in progress
  */
-DEFINE_SEMAPHORE(ifs_sem);
+static DEFINE_SEMAPHORE(ifs_sem);
 
 /*
  * The sysfs interface to check additional details of last test