diff options
Diffstat (limited to 'arch/s390/crypto')
-rw-r--r-- | arch/s390/crypto/crypt_s390.h | 4 | ||||
-rw-r--r-- | arch/s390/crypto/prng.c | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/arch/s390/crypto/crypt_s390.h b/arch/s390/crypto/crypt_s390.h index 9992f95ef992..0ef9829f2ad6 100644 --- a/arch/s390/crypto/crypt_s390.h +++ b/arch/s390/crypto/crypt_s390.h | |||
@@ -296,6 +296,10 @@ static inline int crypt_s390_func_available(int func) | |||
296 | unsigned char status[16]; | 296 | unsigned char status[16]; |
297 | int ret; | 297 | int ret; |
298 | 298 | ||
299 | /* check if CPACF facility (bit 17) is available */ | ||
300 | if (!(stfl() & 1ULL << (31 - 17))) | ||
301 | return 0; | ||
302 | |||
299 | switch (func & CRYPT_S390_OP_MASK) { | 303 | switch (func & CRYPT_S390_OP_MASK) { |
300 | case CRYPT_S390_KM: | 304 | case CRYPT_S390_KM: |
301 | ret = crypt_s390_km(KM_QUERY, &status, NULL, NULL, 0); | 305 | ret = crypt_s390_km(KM_QUERY, &status, NULL, NULL, 0); |
diff --git a/arch/s390/crypto/prng.c b/arch/s390/crypto/prng.c index 0cfefddd8375..eca724d229ec 100644 --- a/arch/s390/crypto/prng.c +++ b/arch/s390/crypto/prng.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/fs.h> | 6 | #include <linux/fs.h> |
7 | #include <linux/init.h> | 7 | #include <linux/init.h> |
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/smp_lock.h> | ||
9 | #include <linux/miscdevice.h> | 10 | #include <linux/miscdevice.h> |
10 | #include <linux/module.h> | 11 | #include <linux/module.h> |
11 | #include <linux/moduleparam.h> | 12 | #include <linux/moduleparam.h> |
@@ -48,6 +49,7 @@ static unsigned char parm_block[32] = { | |||
48 | 49 | ||
49 | static int prng_open(struct inode *inode, struct file *file) | 50 | static int prng_open(struct inode *inode, struct file *file) |
50 | { | 51 | { |
52 | cycle_kernel_lock(); | ||
51 | return nonseekable_open(inode, file); | 53 | return nonseekable_open(inode, file); |
52 | } | 54 | } |
53 | 55 | ||
@@ -185,11 +187,8 @@ static int __init prng_init(void) | |||
185 | prng_seed(16); | 187 | prng_seed(16); |
186 | 188 | ||
187 | ret = misc_register(&prng_dev); | 189 | ret = misc_register(&prng_dev); |
188 | if (ret) { | 190 | if (ret) |
189 | printk(KERN_WARNING | ||
190 | "Could not register misc device for PRNG.\n"); | ||
191 | goto out_buf; | 191 | goto out_buf; |
192 | } | ||
193 | return 0; | 192 | return 0; |
194 | 193 | ||
195 | out_buf: | 194 | out_buf: |