aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/crypto')
-rw-r--r--drivers/s390/crypto/ap_asm.h10
-rw-r--r--drivers/s390/crypto/ap_bus.c57
-rw-r--r--drivers/s390/crypto/ap_card.c2
-rw-r--r--drivers/s390/crypto/ap_queue.c2
-rw-r--r--drivers/s390/crypto/zcrypt_api.c15
5 files changed, 19 insertions, 67 deletions
diff --git a/drivers/s390/crypto/ap_asm.h b/drivers/s390/crypto/ap_asm.h
index 7a630047c372..287b4ad0999e 100644
--- a/drivers/s390/crypto/ap_asm.h
+++ b/drivers/s390/crypto/ap_asm.h
@@ -129,7 +129,6 @@ static inline struct ap_queue_status ap_nqap(ap_qid_t qid,
unsigned long long psmid,
void *msg, size_t length)
{
- struct msgblock { char _[length]; };
register unsigned long reg0 asm ("0") = qid | 0x40000000UL;
register struct ap_queue_status reg1 asm ("1");
register unsigned long reg2 asm ("2") = (unsigned long) msg;
@@ -141,8 +140,8 @@ static inline struct ap_queue_status ap_nqap(ap_qid_t qid,
"0: .long 0xb2ad0042\n" /* NQAP */
" brc 2,0b"
: "+d" (reg0), "=d" (reg1), "+d" (reg2), "+d" (reg3)
- : "d" (reg4), "d" (reg5), "m" (*(struct msgblock *) msg)
- : "cc");
+ : "d" (reg4), "d" (reg5)
+ : "cc", "memory");
return reg1;
}
@@ -168,7 +167,6 @@ static inline struct ap_queue_status ap_dqap(ap_qid_t qid,
unsigned long long *psmid,
void *msg, size_t length)
{
- struct msgblock { char _[length]; };
register unsigned long reg0 asm("0") = qid | 0x80000000UL;
register struct ap_queue_status reg1 asm ("1");
register unsigned long reg2 asm("2") = 0UL;
@@ -182,8 +180,8 @@ static inline struct ap_queue_status ap_dqap(ap_qid_t qid,
"0: .long 0xb2ae0064\n" /* DQAP */
" brc 6,0b\n"
: "+d" (reg0), "=d" (reg1), "+d" (reg2),
- "+d" (reg4), "+d" (reg5), "+d" (reg6), "+d" (reg7),
- "=m" (*(struct msgblock *) msg) : : "cc");
+ "+d" (reg4), "+d" (reg5), "+d" (reg6), "+d" (reg7)
+ : : "cc", "memory");
*psmid = (((unsigned long long) reg6) << 32) + reg7;
return reg1;
}
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index 5fa699192864..56db76c05775 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -27,7 +27,7 @@
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
#include <linux/kernel_stat.h>
-#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/err.h>
@@ -54,16 +54,7 @@
#include "ap_debug.h"
/*
- * Module description.
- */
-MODULE_AUTHOR("IBM Corporation");
-MODULE_DESCRIPTION("Adjunct Processor Bus driver, " \
- "Copyright IBM Corp. 2006, 2012");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_CRYPTO("z90crypt");
-
-/*
- * Module parameter
+ * Module parameters; note though this file itself isn't modular.
*/
int ap_domain_index = -1; /* Adjunct Processor Domain Index */
static DEFINE_SPINLOCK(ap_domain_lock);
@@ -86,7 +77,6 @@ static bool initialised;
/*
* AP bus related debug feature things.
*/
-static struct dentry *ap_dbf_root;
debug_info_t *ap_dbf_info;
/*
@@ -1148,7 +1138,6 @@ static struct reset_call ap_reset_call = {
int __init ap_debug_init(void)
{
- ap_dbf_root = debugfs_create_dir("ap", NULL);
ap_dbf_info = debug_register("ap", 1, 1,
DBF_MAX_SPRINTF_ARGS * sizeof(long));
debug_register_view(ap_dbf_info, &debug_sprintf_view);
@@ -1159,7 +1148,6 @@ int __init ap_debug_init(void)
void ap_debug_exit(void)
{
- debugfs_remove(ap_dbf_root);
debug_unregister(ap_dbf_info);
}
@@ -1270,43 +1258,4 @@ out_free:
kfree(ap_configuration);
return rc;
}
-
-/**
- * ap_modules_exit(): The module termination code
- *
- * Terminates the module.
- */
-void ap_module_exit(void)
-{
- int i;
-
- initialised = false;
- ap_reset_domain();
- ap_poll_thread_stop();
- del_timer_sync(&ap_config_timer);
- hrtimer_cancel(&ap_poll_timer);
- tasklet_kill(&ap_tasklet);
-
- /* first remove queue devices */
- bus_for_each_dev(&ap_bus_type, NULL, NULL,
- __ap_queue_devices_unregister);
- /* now remove the card devices */
- bus_for_each_dev(&ap_bus_type, NULL, NULL,
- __ap_card_devices_unregister);
-
- /* remove bus attributes */
- for (i = 0; ap_bus_attrs[i]; i++)
- bus_remove_file(&ap_bus_type, ap_bus_attrs[i]);
- unregister_pm_notifier(&ap_power_notifier);
- root_device_unregister(ap_root_device);
- bus_unregister(&ap_bus_type);
- kfree(ap_configuration);
- unregister_reset_call(&ap_reset_call);
- if (ap_using_interrupts())
- unregister_adapter_interrupt(&ap_airq);
-
- ap_debug_exit();
-}
-
-module_init(ap_module_init);
-module_exit(ap_module_exit);
+device_initcall(ap_module_init);
diff --git a/drivers/s390/crypto/ap_card.c b/drivers/s390/crypto/ap_card.c
index 0110d44172a3..1cd9128593e4 100644
--- a/drivers/s390/crypto/ap_card.c
+++ b/drivers/s390/crypto/ap_card.c
@@ -137,7 +137,7 @@ static const struct attribute_group *ap_card_dev_attr_groups[] = {
NULL
};
-struct device_type ap_card_type = {
+static struct device_type ap_card_type = {
.name = "ap_card",
.groups = ap_card_dev_attr_groups,
};
diff --git a/drivers/s390/crypto/ap_queue.c b/drivers/s390/crypto/ap_queue.c
index b58a917dc510..7be67fa9f224 100644
--- a/drivers/s390/crypto/ap_queue.c
+++ b/drivers/s390/crypto/ap_queue.c
@@ -564,7 +564,7 @@ static const struct attribute_group *ap_queue_dev_attr_groups[] = {
NULL
};
-struct device_type ap_queue_type = {
+static struct device_type ap_queue_type = {
.name = "ap_queue",
.groups = ap_queue_dev_attr_groups,
};
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c
index 51eece9af577..144a17941e6f 100644
--- a/drivers/s390/crypto/zcrypt_api.c
+++ b/drivers/s390/crypto/zcrypt_api.c
@@ -81,7 +81,6 @@ EXPORT_SYMBOL(zcrypt_rescan_req);
static LIST_HEAD(zcrypt_ops_list);
/* Zcrypt related debug feature stuff. */
-static struct dentry *zcrypt_dbf_root;
debug_info_t *zcrypt_dbf_info;
/**
@@ -201,7 +200,7 @@ static inline bool zcrypt_card_compare(struct zcrypt_card *zc,
unsigned weight, unsigned pref_weight)
{
if (!pref_zc)
- return 0;
+ return false;
weight += atomic_read(&zc->load);
pref_weight += atomic_read(&pref_zc->load);
if (weight == pref_weight)
@@ -215,7 +214,7 @@ static inline bool zcrypt_queue_compare(struct zcrypt_queue *zq,
unsigned weight, unsigned pref_weight)
{
if (!pref_zq)
- return 0;
+ return false;
weight += atomic_read(&zq->load);
pref_weight += atomic_read(&pref_zq->load);
if (weight == pref_weight)
@@ -668,6 +667,7 @@ static void zcrypt_qdepth_mask(char qdepth[AP_DEVICES])
memset(qdepth, 0, sizeof(char) * AP_DEVICES);
spin_lock(&zcrypt_list_lock);
+ local_bh_disable();
for_each_zcrypt_card(zc) {
for_each_zcrypt_queue(zq, zc) {
if (AP_QID_QUEUE(zq->queue->qid) != ap_domain_index)
@@ -679,6 +679,7 @@ static void zcrypt_qdepth_mask(char qdepth[AP_DEVICES])
spin_unlock(&zq->queue->lock);
}
}
+ local_bh_enable();
spin_unlock(&zcrypt_list_lock);
}
@@ -689,6 +690,7 @@ static void zcrypt_perdev_reqcnt(int reqcnt[AP_DEVICES])
memset(reqcnt, 0, sizeof(int) * AP_DEVICES);
spin_lock(&zcrypt_list_lock);
+ local_bh_disable();
for_each_zcrypt_card(zc) {
for_each_zcrypt_queue(zq, zc) {
if (AP_QID_QUEUE(zq->queue->qid) != ap_domain_index)
@@ -699,6 +701,7 @@ static void zcrypt_perdev_reqcnt(int reqcnt[AP_DEVICES])
spin_unlock(&zq->queue->lock);
}
}
+ local_bh_enable();
spin_unlock(&zcrypt_list_lock);
}
@@ -710,6 +713,7 @@ static int zcrypt_pendingq_count(void)
pendingq_count = 0;
spin_lock(&zcrypt_list_lock);
+ local_bh_disable();
for_each_zcrypt_card(zc) {
for_each_zcrypt_queue(zq, zc) {
if (AP_QID_QUEUE(zq->queue->qid) != ap_domain_index)
@@ -719,6 +723,7 @@ static int zcrypt_pendingq_count(void)
spin_unlock(&zq->queue->lock);
}
}
+ local_bh_enable();
spin_unlock(&zcrypt_list_lock);
return pendingq_count;
}
@@ -731,6 +736,7 @@ static int zcrypt_requestq_count(void)
requestq_count = 0;
spin_lock(&zcrypt_list_lock);
+ local_bh_disable();
for_each_zcrypt_card(zc) {
for_each_zcrypt_queue(zq, zc) {
if (AP_QID_QUEUE(zq->queue->qid) != ap_domain_index)
@@ -740,6 +746,7 @@ static int zcrypt_requestq_count(void)
spin_unlock(&zq->queue->lock);
}
}
+ local_bh_enable();
spin_unlock(&zcrypt_list_lock);
return requestq_count;
}
@@ -1419,7 +1426,6 @@ void zcrypt_rng_device_remove(void)
int __init zcrypt_debug_init(void)
{
- zcrypt_dbf_root = debugfs_create_dir("zcrypt", NULL);
zcrypt_dbf_info = debug_register("zcrypt", 1, 1,
DBF_MAX_SPRINTF_ARGS * sizeof(long));
debug_register_view(zcrypt_dbf_info, &debug_sprintf_view);
@@ -1430,7 +1436,6 @@ int __init zcrypt_debug_init(void)
void zcrypt_debug_exit(void)
{
- debugfs_remove(zcrypt_dbf_root);
debug_unregister(zcrypt_dbf_info);
}