Commit aac5925b authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'edac_urgent_for_v5.9_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras

Pull EDAC fixes from Borislav Petkov:
 "Two fixes for resulting from CONFIG_DEBUG_TEST_DRIVER_REMOVE=y
  experiments:

   - complete a previous fix to reset a local structure containing
     scanned system data properly so that the driver rescans, as it
     should, on a second load.

   - address a refcount underflow due to not paying attention to the
     driver whitelest on unregister"

* tag 'edac_urgent_for_v5.9_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
  EDAC/ghes: Check whether the driver is on the safe list correctly
  EDAC/ghes: Clear scanned data on unload
parents 376566ca 251c54ea
...@@ -508,6 +508,7 @@ int ghes_edac_register(struct ghes *ghes, struct device *dev) ...@@ -508,6 +508,7 @@ int ghes_edac_register(struct ghes *ghes, struct device *dev)
if (!force_load && idx < 0) if (!force_load && idx < 0)
return -ENODEV; return -ENODEV;
} else { } else {
force_load = true;
idx = 0; idx = 0;
} }
...@@ -629,9 +630,13 @@ void ghes_edac_unregister(struct ghes *ghes) ...@@ -629,9 +630,13 @@ void ghes_edac_unregister(struct ghes *ghes)
struct mem_ctl_info *mci; struct mem_ctl_info *mci;
unsigned long flags; unsigned long flags;
if (!force_load)
return;
mutex_lock(&ghes_reg_mutex); mutex_lock(&ghes_reg_mutex);
system_scanned = false; system_scanned = false;
memset(&ghes_hw, 0, sizeof(struct ghes_hw_desc));
if (!refcount_dec_and_test(&ghes_refcount)) if (!refcount_dec_and_test(&ghes_refcount))
goto unlock; goto unlock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment