提交 56bbe686 编写于 作者: I Ingo Tuchscherer 提交者: Martin Schwidefsky

s390/zcrypt: ap bus rescan problem when toggle crypto adapters on/off

The bus rescan process was called simultaneously on
every device failure. This finally leads into race
conditions (double device add/remove actions).

This patch protects the rescan area by mutual exclusion
and improves ap_config_timer handling
Signed-off-by: NIngo Tuchscherer <ingo.tuchscherer@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 15535560
...@@ -954,15 +954,11 @@ EXPORT_SYMBOL(ap_driver_unregister); ...@@ -954,15 +954,11 @@ EXPORT_SYMBOL(ap_driver_unregister);
void ap_bus_force_rescan(void) void ap_bus_force_rescan(void)
{ {
/* Delete the AP bus rescan timer. */ /* reconfigure the AP bus rescan timer. */
del_timer(&ap_config_timer); mod_timer(&ap_config_timer, jiffies + ap_config_time * HZ);
/* processing a asynchronous bus rescan */
/* processing a synchonuous bus rescan */ queue_work(ap_work_queue, &ap_config_work);
ap_scan_bus(NULL); flush_work(&ap_config_work);
/* Setup the AP bus rescan timer again. */
ap_config_timer.expires = jiffies + ap_config_time * HZ;
add_timer(&ap_config_timer);
} }
EXPORT_SYMBOL(ap_bus_force_rescan); EXPORT_SYMBOL(ap_bus_force_rescan);
...@@ -1305,8 +1301,9 @@ static void ap_scan_bus(struct work_struct *unused) ...@@ -1305,8 +1301,9 @@ static void ap_scan_bus(struct work_struct *unused)
int rc, i; int rc, i;
ap_query_configuration(); ap_query_configuration();
if (ap_select_domain() != 0) if (ap_select_domain() != 0) {
return; return;
}
for (i = 0; i < AP_DEVICES; i++) { for (i = 0; i < AP_DEVICES; i++) {
qid = AP_MKQID(i, ap_domain_index); qid = AP_MKQID(i, ap_domain_index);
dev = bus_find_device(&ap_bus_type, NULL, dev = bus_find_device(&ap_bus_type, NULL,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册