diff options
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/cio/css.c | 7 | ||||
-rw-r--r-- | drivers/s390/cio/idset.c | 26 | ||||
-rw-r--r-- | drivers/s390/cio/idset.h | 3 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l2_main.c | 11 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 11 | ||||
-rw-r--r-- | drivers/s390/net/smsgiucv.c | 2 |
6 files changed, 35 insertions, 25 deletions
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. */ | ||
94 | void 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 | |||
92 | int idset_sch_contains(struct idset *set, struct subchannel_id schid) | 101 | int 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 | ||
112 | int idset_is_empty(struct idset *set) | 121 | int 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 | ||
122 | void idset_add_set(struct idset *to, struct idset *from) | 126 | void 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); | |||
17 | struct idset *idset_sch_new(void); | 17 | struct idset *idset_sch_new(void); |
18 | void idset_sch_add(struct idset *set, struct subchannel_id id); | 18 | void idset_sch_add(struct idset *set, struct subchannel_id id); |
19 | void idset_sch_del(struct idset *set, struct subchannel_id id); | 19 | void idset_sch_del(struct idset *set, struct subchannel_id id); |
20 | void idset_sch_del_subseq(struct idset *set, struct subchannel_id schid); | ||
20 | int idset_sch_contains(struct idset *set, struct subchannel_id id); | 21 | int idset_sch_contains(struct idset *set, struct subchannel_id id); |
21 | int idset_sch_get_first(struct idset *set, struct subchannel_id *id); | 22 | int idset_sch_get_first(struct idset *set, struct subchannel_id *id); |
22 | int idset_is_empty(struct idset *set); | 23 | int idset_is_empty(struct idset *set); |
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; |