Commit f60b8d44 authored by Ingo Tuchscherer's avatar Ingo Tuchscherer Committed by Martin Schwidefsky

s390/zcrypt: Fix invalid domain handling during ap module unload

Added domain checking to prevent reset failures caused by invalid
domains.
Corrected removal sequence of bus attributes and device.
Reviewed-by: default avatarHarald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: default avatarIngo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent b9b4b1ce
...@@ -1950,7 +1950,7 @@ static void ap_reset_domain(void) ...@@ -1950,7 +1950,7 @@ static void ap_reset_domain(void)
{ {
int i; int i;
if (ap_domain_index != -1) if ((ap_domain_index != -1) && (ap_test_config_domain(ap_domain_index)))
for (i = 0; i < AP_DEVICES; i++) for (i = 0; i < AP_DEVICES; i++)
ap_reset_queue(AP_MKQID(i, ap_domain_index)); ap_reset_queue(AP_MKQID(i, ap_domain_index));
} }
...@@ -2095,7 +2095,6 @@ void ap_module_exit(void) ...@@ -2095,7 +2095,6 @@ void ap_module_exit(void)
hrtimer_cancel(&ap_poll_timer); hrtimer_cancel(&ap_poll_timer);
destroy_workqueue(ap_work_queue); destroy_workqueue(ap_work_queue);
tasklet_kill(&ap_tasklet); tasklet_kill(&ap_tasklet);
root_device_unregister(ap_root_device);
while ((dev = bus_find_device(&ap_bus_type, NULL, NULL, while ((dev = bus_find_device(&ap_bus_type, NULL, NULL,
__ap_match_all))) __ap_match_all)))
{ {
...@@ -2104,6 +2103,7 @@ void ap_module_exit(void) ...@@ -2104,6 +2103,7 @@ void ap_module_exit(void)
} }
for (i = 0; ap_bus_attrs[i]; i++) for (i = 0; ap_bus_attrs[i]; i++)
bus_remove_file(&ap_bus_type, ap_bus_attrs[i]); bus_remove_file(&ap_bus_type, ap_bus_attrs[i]);
root_device_unregister(ap_root_device);
bus_unregister(&ap_bus_type); bus_unregister(&ap_bus_type);
unregister_reset_call(&ap_reset_call); unregister_reset_call(&ap_reset_call);
if (ap_using_interrupts()) if (ap_using_interrupts())
......
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