aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/block/dcssblk.c52
-rw-r--r--drivers/s390/cio/css.c7
-rw-r--r--drivers/s390/cio/idset.c26
-rw-r--r--drivers/s390/cio/idset.h3
-rw-r--r--drivers/s390/crypto/zcrypt_pcixcc.c1
-rw-r--r--drivers/s390/net/qeth_l2_main.c11
-rw-r--r--drivers/s390/net/qeth_l3_main.c11
-rw-r--r--drivers/s390/net/smsgiucv.c2
8 files changed, 58 insertions, 55 deletions
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index a5a55da2a1ac..b6ad0de07930 100644
--- a/drivers/s390/block/dcssblk.c
+++ b/drivers/s390/block/dcssblk.c
@@ -69,23 +69,9 @@ static ssize_t dcssblk_add_store(struct device * dev, struct device_attribute *a
69 size_t count); 69 size_t count);
70static ssize_t dcssblk_remove_store(struct device * dev, struct device_attribute *attr, const char * buf, 70static ssize_t dcssblk_remove_store(struct device * dev, struct device_attribute *attr, const char * buf,
71 size_t count); 71 size_t count);
72static ssize_t dcssblk_save_store(struct device * dev, struct device_attribute *attr, const char * buf,
73 size_t count);
74static ssize_t dcssblk_save_show(struct device *dev, struct device_attribute *attr, char *buf);
75static ssize_t dcssblk_shared_store(struct device * dev, struct device_attribute *attr, const char * buf,
76 size_t count);
77static ssize_t dcssblk_shared_show(struct device *dev, struct device_attribute *attr, char *buf);
78static ssize_t dcssblk_seglist_show(struct device *dev,
79 struct device_attribute *attr,
80 char *buf);
81 72
82static DEVICE_ATTR(add, S_IWUSR, NULL, dcssblk_add_store); 73static DEVICE_ATTR(add, S_IWUSR, NULL, dcssblk_add_store);
83static DEVICE_ATTR(remove, S_IWUSR, NULL, dcssblk_remove_store); 74static DEVICE_ATTR(remove, S_IWUSR, NULL, dcssblk_remove_store);
84static DEVICE_ATTR(save, S_IWUSR | S_IRUSR, dcssblk_save_show,
85 dcssblk_save_store);
86static DEVICE_ATTR(shared, S_IWUSR | S_IRUSR, dcssblk_shared_show,
87 dcssblk_shared_store);
88static DEVICE_ATTR(seglist, S_IRUSR, dcssblk_seglist_show, NULL);
89 75
90static struct device *dcssblk_root_dev; 76static struct device *dcssblk_root_dev;
91 77
@@ -416,6 +402,8 @@ out:
416 up_write(&dcssblk_devices_sem); 402 up_write(&dcssblk_devices_sem);
417 return rc; 403 return rc;
418} 404}
405static DEVICE_ATTR(shared, S_IWUSR | S_IRUSR, dcssblk_shared_show,
406 dcssblk_shared_store);
419 407
420/* 408/*
421 * device attribute for save operation on current copy 409 * device attribute for save operation on current copy
@@ -476,6 +464,8 @@ dcssblk_save_store(struct device *dev, struct device_attribute *attr, const char
476 up_write(&dcssblk_devices_sem); 464 up_write(&dcssblk_devices_sem);
477 return count; 465 return count;
478} 466}
467static DEVICE_ATTR(save, S_IWUSR | S_IRUSR, dcssblk_save_show,
468 dcssblk_save_store);
479 469
480/* 470/*
481 * device attribute for showing all segments in a device 471 * device attribute for showing all segments in a device
@@ -502,6 +492,21 @@ dcssblk_seglist_show(struct device *dev, struct device_attribute *attr,
502 up_read(&dcssblk_devices_sem); 492 up_read(&dcssblk_devices_sem);
503 return i; 493 return i;
504} 494}
495static DEVICE_ATTR(seglist, S_IRUSR, dcssblk_seglist_show, NULL);
496
497static struct attribute *dcssblk_dev_attrs[] = {
498 &dev_attr_shared.attr,
499 &dev_attr_save.attr,
500 &dev_attr_seglist.attr,
501 NULL,
502};
503static struct attribute_group dcssblk_dev_attr_group = {
504 .attrs = dcssblk_dev_attrs,
505};
506static const struct attribute_group *dcssblk_dev_attr_groups[] = {
507 &dcssblk_dev_attr_group,
508 NULL,
509};
505 510
506/* 511/*
507 * device attribute for adding devices 512 * device attribute for adding devices
@@ -590,6 +595,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
590 595
591 dev_set_name(&dev_info->dev, dev_info->segment_name); 596 dev_set_name(&dev_info->dev, dev_info->segment_name);
592 dev_info->dev.release = dcssblk_release_segment; 597 dev_info->dev.release = dcssblk_release_segment;
598 dev_info->dev.groups = dcssblk_dev_attr_groups;
593 INIT_LIST_HEAD(&dev_info->lh); 599 INIT_LIST_HEAD(&dev_info->lh);
594 dev_info->gd = alloc_disk(DCSSBLK_MINORS_PER_DISK); 600 dev_info->gd = alloc_disk(DCSSBLK_MINORS_PER_DISK);
595 if (dev_info->gd == NULL) { 601 if (dev_info->gd == NULL) {
@@ -637,21 +643,10 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
637 * register the device 643 * register the device
638 */ 644 */
639 rc = device_register(&dev_info->dev); 645 rc = device_register(&dev_info->dev);
640 if (rc) {
641 module_put(THIS_MODULE);
642 goto dev_list_del;
643 }
644 get_device(&dev_info->dev);
645 rc = device_create_file(&dev_info->dev, &dev_attr_shared);
646 if (rc)
647 goto unregister_dev;
648 rc = device_create_file(&dev_info->dev, &dev_attr_save);
649 if (rc)
650 goto unregister_dev;
651 rc = device_create_file(&dev_info->dev, &dev_attr_seglist);
652 if (rc) 646 if (rc)
653 goto unregister_dev; 647 goto put_dev;
654 648
649 get_device(&dev_info->dev);
655 add_disk(dev_info->gd); 650 add_disk(dev_info->gd);
656 651
657 switch (dev_info->segment_type) { 652 switch (dev_info->segment_type) {
@@ -668,12 +663,11 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
668 rc = count; 663 rc = count;
669 goto out; 664 goto out;
670 665
671unregister_dev: 666put_dev:
672 list_del(&dev_info->lh); 667 list_del(&dev_info->lh);
673 blk_cleanup_queue(dev_info->dcssblk_queue); 668 blk_cleanup_queue(dev_info->dcssblk_queue);
674 dev_info->gd->queue = NULL; 669 dev_info->gd->queue = NULL;
675 put_disk(dev_info->gd); 670 put_disk(dev_info->gd);
676 device_unregister(&dev_info->dev);
677 list_for_each_entry(seg_info, &dev_info->seg_list, lh) { 671 list_for_each_entry(seg_info, &dev_info->seg_list, lh) {
678 segment_unload(seg_info->segment_name); 672 segment_unload(seg_info->segment_name);
679 } 673 }
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index b4d572f65f07..fd00afd8b850 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -377,7 +377,11 @@ static int css_evaluate_new_subchannel(struct subchannel_id schid, int slow)
377 /* Will be done on the slow path. */ 377 /* Will be done on the slow path. */
378 return -EAGAIN; 378 return -EAGAIN;
379 } 379 }
380 if (stsch_err(schid, &schib) || !css_sch_is_valid(&schib)) { 380 if (stsch_err(schid, &schib)) {
381 /* Subchannel is not provided. */
382 return -ENXIO;
383 }
384 if (!css_sch_is_valid(&schib)) {
381 /* Unusable - ignore. */ 385 /* Unusable - ignore. */
382 return 0; 386 return 0;
383 } 387 }
@@ -536,6 +540,7 @@ static int slow_eval_unknown_fn(struct subchannel_id schid, void *data)
536 case -ENOMEM: 540 case -ENOMEM:
537 case -EIO: 541 case -EIO:
538 /* These should abort looping */ 542 /* These should abort looping */
543 idset_sch_del_subseq(slow_subchannel_set, schid);
539 break; 544 break;
540 default: 545 default:
541 rc = 0; 546 rc = 0;
diff --git a/drivers/s390/cio/idset.c b/drivers/s390/cio/idset.c
index e6d5f8c49524..199bc6791177 100644
--- a/drivers/s390/cio/idset.c
+++ b/drivers/s390/cio/idset.c
@@ -1,9 +1,10 @@
1/* 1/*
2 * Copyright IBM Corp. 2007 2 * Copyright IBM Corp. 2007, 2012
3 * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com> 3 * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
4 */ 4 */
5 5
6#include <linux/vmalloc.h> 6#include <linux/vmalloc.h>
7#include <linux/bitmap.h>
7#include <linux/bitops.h> 8#include <linux/bitops.h>
8#include "idset.h" 9#include "idset.h"
9#include "css.h" 10#include "css.h"
@@ -89,6 +90,14 @@ void idset_sch_del(struct idset *set, struct subchannel_id schid)
89 idset_del(set, schid.ssid, schid.sch_no); 90 idset_del(set, schid.ssid, schid.sch_no);
90} 91}
91 92
93/* Clear ids starting from @schid up to end of subchannel set. */
94void idset_sch_del_subseq(struct idset *set, struct subchannel_id schid)
95{
96 int pos = schid.ssid * set->num_id + schid.sch_no;
97
98 bitmap_clear(set->bitmap, pos, set->num_id - schid.sch_no);
99}
100
92int idset_sch_contains(struct idset *set, struct subchannel_id schid) 101int idset_sch_contains(struct idset *set, struct subchannel_id schid)
93{ 102{
94 return idset_contains(set, schid.ssid, schid.sch_no); 103 return idset_contains(set, schid.ssid, schid.sch_no);
@@ -111,20 +120,13 @@ int idset_sch_get_first(struct idset *set, struct subchannel_id *schid)
111 120
112int idset_is_empty(struct idset *set) 121int idset_is_empty(struct idset *set)
113{ 122{
114 int bitnum; 123 return bitmap_empty(set->bitmap, set->num_ssid * set->num_id);
115
116 bitnum = find_first_bit(set->bitmap, set->num_ssid * set->num_id);
117 if (bitnum >= set->num_ssid * set->num_id)
118 return 1;
119 return 0;
120} 124}
121 125
122void idset_add_set(struct idset *to, struct idset *from) 126void idset_add_set(struct idset *to, struct idset *from)
123{ 127{
124 unsigned long i, len; 128 int len = min(__BITOPS_WORDS(to->num_ssid * to->num_id),
129 __BITOPS_WORDS(from->num_ssid * from->num_id));
125 130
126 len = min(__BITOPS_WORDS(to->num_ssid * to->num_id), 131 bitmap_or(to->bitmap, to->bitmap, from->bitmap, len);
127 __BITOPS_WORDS(from->num_ssid * from->num_id));
128 for (i = 0; i < len ; i++)
129 to->bitmap[i] |= from->bitmap[i];
130} 132}
diff --git a/drivers/s390/cio/idset.h b/drivers/s390/cio/idset.h
index 3d943f03591e..06d3bc01bb09 100644
--- a/drivers/s390/cio/idset.h
+++ b/drivers/s390/cio/idset.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright IBM Corp. 2007 2 * Copyright IBM Corp. 2007, 2012
3 * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com> 3 * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
4 */ 4 */
5 5
@@ -17,6 +17,7 @@ void idset_fill(struct idset *set);
17struct idset *idset_sch_new(void); 17struct idset *idset_sch_new(void);
18void idset_sch_add(struct idset *set, struct subchannel_id id); 18void idset_sch_add(struct idset *set, struct subchannel_id id);
19void idset_sch_del(struct idset *set, struct subchannel_id id); 19void idset_sch_del(struct idset *set, struct subchannel_id id);
20void idset_sch_del_subseq(struct idset *set, struct subchannel_id schid);
20int idset_sch_contains(struct idset *set, struct subchannel_id id); 21int idset_sch_contains(struct idset *set, struct subchannel_id id);
21int idset_sch_get_first(struct idset *set, struct subchannel_id *id); 22int idset_sch_get_first(struct idset *set, struct subchannel_id *id);
22int idset_is_empty(struct idset *set); 23int idset_is_empty(struct idset *set);
diff --git a/drivers/s390/crypto/zcrypt_pcixcc.c b/drivers/s390/crypto/zcrypt_pcixcc.c
index c7275e303a0d..899ffa19f5ec 100644
--- a/drivers/s390/crypto/zcrypt_pcixcc.c
+++ b/drivers/s390/crypto/zcrypt_pcixcc.c
@@ -39,7 +39,6 @@
39#include "zcrypt_msgtype6.h" 39#include "zcrypt_msgtype6.h"
40#include "zcrypt_pcixcc.h" 40#include "zcrypt_pcixcc.h"
41#include "zcrypt_cca_key.h" 41#include "zcrypt_cca_key.h"
42#include "zcrypt_msgtype6.h"
43 42
44#define PCIXCC_MIN_MOD_SIZE 16 /* 128 bits */ 43#define PCIXCC_MIN_MOD_SIZE 16 /* 128 bits */
45#define PCIXCC_MIN_MOD_SIZE_OLD 64 /* 512 bits */ 44#define PCIXCC_MIN_MOD_SIZE_OLD 64 /* 512 bits */
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 2db409330c21..e67e0258aec5 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -1141,11 +1141,12 @@ static int qeth_l2_recover(void *ptr)
1141 dev_info(&card->gdev->dev, 1141 dev_info(&card->gdev->dev,
1142 "Device successfully recovered!\n"); 1142 "Device successfully recovered!\n");
1143 else { 1143 else {
1144 rtnl_lock(); 1144 if (rtnl_trylock()) {
1145 dev_close(card->dev); 1145 dev_close(card->dev);
1146 rtnl_unlock(); 1146 rtnl_unlock();
1147 dev_warn(&card->gdev->dev, "The qeth device driver " 1147 dev_warn(&card->gdev->dev, "The qeth device driver "
1148 "failed to recover an error on the device\n"); 1148 "failed to recover an error on the device\n");
1149 }
1149 } 1150 }
1150 qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); 1151 qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD);
1151 qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD); 1152 qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD);
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 4cd310cb5bdf..5ba390658498 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -3510,11 +3510,12 @@ static int qeth_l3_recover(void *ptr)
3510 dev_info(&card->gdev->dev, 3510 dev_info(&card->gdev->dev,
3511 "Device successfully recovered!\n"); 3511 "Device successfully recovered!\n");
3512 else { 3512 else {
3513 rtnl_lock(); 3513 if (rtnl_trylock()) {
3514 dev_close(card->dev); 3514 dev_close(card->dev);
3515 rtnl_unlock(); 3515 rtnl_unlock();
3516 dev_warn(&card->gdev->dev, "The qeth device driver " 3516 dev_warn(&card->gdev->dev, "The qeth device driver "
3517 "failed to recover an error on the device\n"); 3517 "failed to recover an error on the device\n");
3518 }
3518 } 3519 }
3519 qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); 3520 qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD);
3520 qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD); 3521 qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD);
diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c
index 207b7d742443..d8f990b6b332 100644
--- a/drivers/s390/net/smsgiucv.c
+++ b/drivers/s390/net/smsgiucv.c
@@ -157,7 +157,7 @@ static int smsg_pm_restore_thaw(struct device *dev)
157#ifdef CONFIG_PM_DEBUG 157#ifdef CONFIG_PM_DEBUG
158 printk(KERN_WARNING "smsg_pm_restore_thaw\n"); 158 printk(KERN_WARNING "smsg_pm_restore_thaw\n");
159#endif 159#endif
160 if (smsg_path && iucv_path_connected) { 160 if (smsg_path && !iucv_path_connected) {
161 memset(smsg_path, 0, sizeof(*smsg_path)); 161 memset(smsg_path, 0, sizeof(*smsg_path));
162 smsg_path->msglim = 255; 162 smsg_path->msglim = 255;
163 smsg_path->flags = 0; 163 smsg_path->flags = 0;