mirror of
https://github.com/torvalds/linux.git
synced 2024-12-11 21:52:04 +00:00
x86/microcode: Remove microcode_mutex
microcode_mutex is only used by reload_store(). It has a comment saying "to synchronize with each other". Other user of this mutex have been removed in the commits181b6f40e9
("x86/microcode: Rip out the OLD_INTERFACE").b6f86689d5
("x86/microcode: Rip out the subsys interface gunk") The sysfs interface does not need additional synchronisation vs itself because it is provided as kernfs_ops::mutex which is acquired in kernfs_fop_write_iter(). Remove the superfluous microcode_mutex. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Sohil Mehta <sohil.mehta@intel.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20230804075853.JF_n6GXC@linutronix.de
This commit is contained in:
parent
05e91e7211
commit
80347cd515
@ -2276,8 +2276,7 @@ void store_cpu_caps(struct cpuinfo_x86 *curr_info)
|
|||||||
* @prev_info: CPU capabilities stored before an update.
|
* @prev_info: CPU capabilities stored before an update.
|
||||||
*
|
*
|
||||||
* The microcode loader calls this upon late microcode load to recheck features,
|
* The microcode loader calls this upon late microcode load to recheck features,
|
||||||
* only when microcode has been updated. Caller holds microcode_mutex and CPU
|
* only when microcode has been updated. Caller holds and CPU hotplug lock.
|
||||||
* hotplug lock.
|
|
||||||
*
|
*
|
||||||
* Return: None
|
* Return: None
|
||||||
*/
|
*/
|
||||||
|
@ -54,15 +54,12 @@ LIST_HEAD(microcode_cache);
|
|||||||
*
|
*
|
||||||
* All non cpu-hotplug-callback call sites use:
|
* All non cpu-hotplug-callback call sites use:
|
||||||
*
|
*
|
||||||
* - microcode_mutex to synchronize with each other;
|
|
||||||
* - cpus_read_lock/unlock() to synchronize with
|
* - cpus_read_lock/unlock() to synchronize with
|
||||||
* the cpu-hotplug-callback call sites.
|
* the cpu-hotplug-callback call sites.
|
||||||
*
|
*
|
||||||
* We guarantee that only a single cpu is being
|
* We guarantee that only a single cpu is being
|
||||||
* updated at any particular moment of time.
|
* updated at any particular moment of time.
|
||||||
*/
|
*/
|
||||||
static DEFINE_MUTEX(microcode_mutex);
|
|
||||||
|
|
||||||
struct ucode_cpu_info ucode_cpu_info[NR_CPUS];
|
struct ucode_cpu_info ucode_cpu_info[NR_CPUS];
|
||||||
|
|
||||||
struct cpu_info_ctx {
|
struct cpu_info_ctx {
|
||||||
@ -488,10 +485,7 @@ static ssize_t reload_store(struct device *dev,
|
|||||||
if (tmp_ret != UCODE_NEW)
|
if (tmp_ret != UCODE_NEW)
|
||||||
goto put;
|
goto put;
|
||||||
|
|
||||||
mutex_lock(µcode_mutex);
|
|
||||||
ret = microcode_reload_late();
|
ret = microcode_reload_late();
|
||||||
mutex_unlock(µcode_mutex);
|
|
||||||
|
|
||||||
put:
|
put:
|
||||||
cpus_read_unlock();
|
cpus_read_unlock();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user