From 970ba6ac6a59ff1f1579e472a97765adc50186f9 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Mon, 2 Jan 2017 09:59:40 +0100 Subject: s390: use false/true when using bool Yet another trivial patch to reduce the noise that coccinelle generates. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- drivers/s390/crypto/zcrypt_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/s390/crypto/zcrypt_api.c') diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index 51eece9af577..919f7aa5a09a 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c @@ -201,7 +201,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 +215,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) -- cgit From 7fbe5c0f2af3ab82fe6880af557e98a10d711370 Mon Sep 17 00:00:00 2001 From: Harald Freudenberger Date: Mon, 16 Jan 2017 09:43:29 +0100 Subject: s390/zcrypt: use spin_lock_bh for all queue locks and unlocks. During tests the Kernel complained about inconsistend lock state: inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage. Now all the queue locks use spin_lock_bh/spin_unlock_bh. Signed-off-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky --- drivers/s390/crypto/zcrypt_api.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/s390/crypto/zcrypt_api.c') diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index 919f7aa5a09a..926169c3d9b9 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c @@ -668,6 +668,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 +680,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 +691,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 +702,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 +714,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 +724,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 +737,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 +747,7 @@ static int zcrypt_requestq_count(void) spin_unlock(&zq->queue->lock); } } + local_bh_enable(); spin_unlock(&zcrypt_list_lock); return requestq_count; } -- cgit From 260021e21b8fcc375984ac7733f93509bf9ad100 Mon Sep 17 00:00:00 2001 From: Harald Freudenberger Date: Fri, 17 Feb 2017 08:12:10 +0100 Subject: s390/zcrypt: Removed unneeded debug feature directory creation. The ap bus code and the zcrypt api had invocations to the debug feature debugfs_create_dir() call but never populated these directories in any way. Removed this unneeded code. Signed-off-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky --- drivers/s390/crypto/ap_bus.c | 3 --- drivers/s390/crypto/zcrypt_api.c | 3 --- 2 files changed, 6 deletions(-) (limited to 'drivers/s390/crypto/zcrypt_api.c') diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index 5fa699192864..5a3a18f7b896 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c @@ -86,7 +86,6 @@ static bool initialised; /* * AP bus related debug feature things. */ -static struct dentry *ap_dbf_root; debug_info_t *ap_dbf_info; /* @@ -1148,7 +1147,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 +1157,6 @@ int __init ap_debug_init(void) void ap_debug_exit(void) { - debugfs_remove(ap_dbf_root); debug_unregister(ap_dbf_info); } diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index 926169c3d9b9..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; /** @@ -1427,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); @@ -1438,7 +1436,6 @@ int __init zcrypt_debug_init(void) void zcrypt_debug_exit(void) { - debugfs_remove(zcrypt_dbf_root); debug_unregister(zcrypt_dbf_info); } -- cgit From a1d001e26d5386c934345dc91f16b530e352f8d7 Mon Sep 17 00:00:00 2001 From: Harald Freudenberger Date: Wed, 2 Nov 2016 14:32:32 +0100 Subject: s390/zcrypt: export additional symbols Export the two zcrypt device driver functions zcrypt_send_cprb and zcrypt_device_status_mask to be useable for other kernel code. Signed-off-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky --- drivers/s390/crypto/zcrypt_api.c | 5 +++-- drivers/s390/crypto/zcrypt_api.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/s390/crypto/zcrypt_api.c') diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index 144a17941e6f..93015f85d4a6 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c @@ -374,7 +374,7 @@ out: return rc; } -static long zcrypt_send_cprb(struct ica_xcRB *xcRB) +long zcrypt_send_cprb(struct ica_xcRB *xcRB) { struct zcrypt_card *zc, *pref_zc; struct zcrypt_queue *zq, *pref_zq; @@ -444,6 +444,7 @@ out: AP_QID_CARD(qid), AP_QID_QUEUE(qid)); return rc; } +EXPORT_SYMBOL(zcrypt_send_cprb); static bool is_desired_ep11_card(unsigned int dev_id, unsigned short target_num, @@ -619,7 +620,7 @@ out: return rc; } -static void zcrypt_device_status_mask(struct zcrypt_device_matrix *matrix) +void zcrypt_device_status_mask(struct zcrypt_device_matrix *matrix) { struct zcrypt_card *zc; struct zcrypt_queue *zq; diff --git a/drivers/s390/crypto/zcrypt_api.h b/drivers/s390/crypto/zcrypt_api.h index 274a59051534..6c94efd23eac 100644 --- a/drivers/s390/crypto/zcrypt_api.h +++ b/drivers/s390/crypto/zcrypt_api.h @@ -190,5 +190,7 @@ void zcrypt_msgtype_unregister(struct zcrypt_ops *); struct zcrypt_ops *zcrypt_msgtype(unsigned char *, int); int zcrypt_api_init(void); void zcrypt_api_exit(void); +long zcrypt_send_cprb(struct ica_xcRB *xcRB); +void zcrypt_device_status_mask(struct zcrypt_device_matrix *devstatus); #endif /* _ZCRYPT_API_H_ */ -- cgit