File tree Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -769,6 +769,7 @@ struct qeth_card {
769
769
unsigned long thread_start_mask ;
770
770
unsigned long thread_allowed_mask ;
771
771
unsigned long thread_running_mask ;
772
+ struct task_struct * recovery_task ;
772
773
spinlock_t ip_lock ;
773
774
struct list_head ip_list ;
774
775
struct list_head * ip_tbd_list ;
@@ -862,6 +863,8 @@ extern struct qeth_card_list_struct qeth_core_card_list;
862
863
extern struct kmem_cache * qeth_core_header_cache ;
863
864
extern struct qeth_dbf_info qeth_dbf [QETH_DBF_INFOS ];
864
865
866
+ void qeth_set_recovery_task (struct qeth_card * );
867
+ void qeth_clear_recovery_task (struct qeth_card * );
865
868
void qeth_set_allowed_threads (struct qeth_card * , unsigned long , int );
866
869
int qeth_threads_running (struct qeth_card * , unsigned long );
867
870
int qeth_wait_for_threads (struct qeth_card * , unsigned long );
Original file line number Diff line number Diff line change @@ -177,6 +177,23 @@ const char *qeth_get_cardname_short(struct qeth_card *card)
177
177
return "n/a" ;
178
178
}
179
179
180
+ void qeth_set_recovery_task (struct qeth_card * card )
181
+ {
182
+ card -> recovery_task = current ;
183
+ }
184
+ EXPORT_SYMBOL_GPL (qeth_set_recovery_task );
185
+
186
+ void qeth_clear_recovery_task (struct qeth_card * card )
187
+ {
188
+ card -> recovery_task = NULL ;
189
+ }
190
+ EXPORT_SYMBOL_GPL (qeth_clear_recovery_task );
191
+
192
+ static bool qeth_is_recovery_task (const struct qeth_card * card )
193
+ {
194
+ return card -> recovery_task == current ;
195
+ }
196
+
180
197
void qeth_set_allowed_threads (struct qeth_card * card , unsigned long threads ,
181
198
int clear_start_mask )
182
199
{
@@ -205,6 +222,8 @@ EXPORT_SYMBOL_GPL(qeth_threads_running);
205
222
206
223
int qeth_wait_for_threads (struct qeth_card * card , unsigned long threads )
207
224
{
225
+ if (qeth_is_recovery_task (card ))
226
+ return 0 ;
208
227
return wait_event_interruptible (card -> wait_q ,
209
228
qeth_threads_running (card , threads ) == 0 );
210
229
}
Original file line number Diff line number Diff line change @@ -1143,6 +1143,7 @@ static int qeth_l2_recover(void *ptr)
1143
1143
QETH_CARD_TEXT (card , 2 , "recover2" );
1144
1144
dev_warn (& card -> gdev -> dev ,
1145
1145
"A recovery process has been started for the device\n" );
1146
+ qeth_set_recovery_task (card );
1146
1147
__qeth_l2_set_offline (card -> gdev , 1 );
1147
1148
rc = __qeth_l2_set_online (card -> gdev , 1 );
1148
1149
if (!rc )
@@ -1153,6 +1154,7 @@ static int qeth_l2_recover(void *ptr)
1153
1154
dev_warn (& card -> gdev -> dev , "The qeth device driver "
1154
1155
"failed to recover an error on the device\n" );
1155
1156
}
1157
+ qeth_clear_recovery_task (card );
1156
1158
qeth_clear_thread_start_bit (card , QETH_RECOVER_THREAD );
1157
1159
qeth_clear_thread_running_bit (card , QETH_RECOVER_THREAD );
1158
1160
return 0 ;
Original file line number Diff line number Diff line change @@ -3515,6 +3515,7 @@ static int qeth_l3_recover(void *ptr)
3515
3515
QETH_CARD_TEXT (card , 2 , "recover2" );
3516
3516
dev_warn (& card -> gdev -> dev ,
3517
3517
"A recovery process has been started for the device\n" );
3518
+ qeth_set_recovery_task (card );
3518
3519
__qeth_l3_set_offline (card -> gdev , 1 );
3519
3520
rc = __qeth_l3_set_online (card -> gdev , 1 );
3520
3521
if (!rc )
@@ -3525,6 +3526,7 @@ static int qeth_l3_recover(void *ptr)
3525
3526
dev_warn (& card -> gdev -> dev , "The qeth device driver "
3526
3527
"failed to recover an error on the device\n" );
3527
3528
}
3529
+ qeth_clear_recovery_task (card );
3528
3530
qeth_clear_thread_start_bit (card , QETH_RECOVER_THREAD );
3529
3531
qeth_clear_thread_running_bit (card , QETH_RECOVER_THREAD );
3530
3532
return 0 ;
You can’t perform that action at this time.
0 commit comments