aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/s390/crypto/ap_bus.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index e4dc947e74e9..ad60afe5dd11 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -33,6 +33,7 @@
33#include <linux/kthread.h> 33#include <linux/kthread.h>
34#include <linux/mutex.h> 34#include <linux/mutex.h>
35#include <asm/s390_rdev.h> 35#include <asm/s390_rdev.h>
36#include <asm/reset.h>
36 37
37#include "ap_bus.h" 38#include "ap_bus.h"
38 39
@@ -1128,6 +1129,19 @@ static void ap_poll_thread_stop(void)
1128 mutex_unlock(&ap_poll_thread_mutex); 1129 mutex_unlock(&ap_poll_thread_mutex);
1129} 1130}
1130 1131
1132static void ap_reset(void)
1133{
1134 int i, j;
1135
1136 for (i = 0; i < AP_DOMAINS; i++)
1137 for (j = 0; j < AP_DEVICES; j++)
1138 ap_reset_queue(AP_MKQID(j, i));
1139}
1140
1141static struct reset_call ap_reset_call = {
1142 .fn = ap_reset,
1143};
1144
1131/** 1145/**
1132 * The module initialization code. 1146 * The module initialization code.
1133 */ 1147 */
@@ -1144,6 +1158,7 @@ int __init ap_module_init(void)
1144 printk(KERN_WARNING "AP instructions not installed.\n"); 1158 printk(KERN_WARNING "AP instructions not installed.\n");
1145 return -ENODEV; 1159 return -ENODEV;
1146 } 1160 }
1161 register_reset_call(&ap_reset_call);
1147 1162
1148 /* Create /sys/bus/ap. */ 1163 /* Create /sys/bus/ap. */
1149 rc = bus_register(&ap_bus_type); 1164 rc = bus_register(&ap_bus_type);
@@ -1197,6 +1212,7 @@ out_bus:
1197 bus_remove_file(&ap_bus_type, ap_bus_attrs[i]); 1212 bus_remove_file(&ap_bus_type, ap_bus_attrs[i]);
1198 bus_unregister(&ap_bus_type); 1213 bus_unregister(&ap_bus_type);
1199out: 1214out:
1215 unregister_reset_call(&ap_reset_call);
1200 return rc; 1216 return rc;
1201} 1217}
1202 1218
@@ -1227,6 +1243,7 @@ void ap_module_exit(void)
1227 for (i = 0; ap_bus_attrs[i]; i++) 1243 for (i = 0; ap_bus_attrs[i]; i++)
1228 bus_remove_file(&ap_bus_type, ap_bus_attrs[i]); 1244 bus_remove_file(&ap_bus_type, ap_bus_attrs[i]);
1229 bus_unregister(&ap_bus_type); 1245 bus_unregister(&ap_bus_type);
1246 unregister_reset_call(&ap_reset_call);
1230} 1247}
1231 1248
1232#ifndef CONFIG_ZCRYPT_MONOLITHIC 1249#ifndef CONFIG_ZCRYPT_MONOLITHIC