提交 b0ebb657 编写于 作者: F fengsheng 提交者: Yang Yingliang

drivers : sysctl remove rcu_lock

driver inclusion
category: Bugfix
bugzilla: NA
CVE: NA

sysctl: fixup rcu critical area using ioremap which might sleep.
Signed-off-by: Nfengsheng <fengsheng5@huawei.com>
Reviewed-by: Nzhangmu <zhangmu1@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 35b3cefd
......@@ -48,7 +48,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#define DEBUG
#define SYSCTL_DRIVER_VERSION "1.9.31.0"
#define SYSCTL_DRIVER_VERSION "1.9.32.0"
unsigned int g_sysctrl_debug;
......
......@@ -302,9 +302,7 @@ static int sysctl_hest_hisi_parse_ghes(struct acpi_hest_header *hest_hdr, void *
return -ENOMEM;
}
mutex_lock(&hisi_ghes_mutex);
list_add_rcu(&sysctl_ghes->list, &hisi_ghes_list);
mutex_unlock(&hisi_ghes_mutex);
list_add(&sysctl_ghes->list, &hisi_ghes_list);
return 0;
}
......@@ -458,15 +456,12 @@ static int sysctl_hisi_error_handler(struct work_struct *work)
struct ghes *sysctl_ghes = NULL;
(void)work;
rcu_read_lock();
list_for_each_entry_rcu(sysctl_ghes, &hisi_ghes_list, list) {
list_for_each_entry(sysctl_ghes, &hisi_ghes_list, list) {
if (!sysctl_ghes_proc(sysctl_ghes))
ret = NOTIFY_OK;
}
rcu_read_unlock();
return ret;
}
/* acpi hisi hest init */
......@@ -547,15 +542,10 @@ static void his_ghes_list_free(void)
struct ghes *node = NULL;
struct ghes *tmp_node = NULL;
rcu_read_lock();
list_for_each_entry_rcu(node, &hisi_ghes_list, list) {
list_for_each_entry(node, &hisi_ghes_list, list) {
if (!node)
continue;
mutex_lock(&hisi_ghes_mutex);
list_del_rcu(&node->list);
mutex_unlock(&hisi_ghes_mutex);
apei_unmap_generic_address(&node->generic->error_status_address);
if (sysctl_is_hest_type_generic_v2(node))
......@@ -581,16 +571,14 @@ static void his_ghes_list_free(void)
kfree(tmp_node);
tmp_node = NULL;
}
rcu_read_unlock();
}
void hip_sysctl_local_ras_exit(void)
{
unregister_acpi_hed_notifier(&g_sysctl_ghes_hisi_notifier_hed);
sysctl_proc_exit();
sysctl_tdh_deinit();
his_ghes_list_free();
unregister_acpi_hed_notifier(&g_sysctl_ghes_hisi_notifier_hed);
pr_info("[INFO] hip sysctl local ras exit.\n");
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册