diff options
Diffstat (limited to 'drivers/s390/scsi/zfcp_erp.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 290 |
1 files changed, 124 insertions, 166 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 387a3af528ac..631bdb1dfd6c 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Error Recovery Procedures (ERP). | 4 | * Error Recovery Procedures (ERP). |
5 | * | 5 | * |
6 | * Copyright IBM Corporation 2002, 2008 | 6 | * Copyright IBM Corporation 2002, 2009 |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #define KMSG_COMPONENT "zfcp" | 9 | #define KMSG_COMPONENT "zfcp" |
@@ -55,7 +55,7 @@ enum zfcp_erp_act_result { | |||
55 | 55 | ||
56 | static void zfcp_erp_adapter_block(struct zfcp_adapter *adapter, int mask) | 56 | static void zfcp_erp_adapter_block(struct zfcp_adapter *adapter, int mask) |
57 | { | 57 | { |
58 | zfcp_erp_modify_adapter_status(adapter, 15, NULL, | 58 | zfcp_erp_modify_adapter_status(adapter, "erablk1", NULL, |
59 | ZFCP_STATUS_COMMON_UNBLOCKED | mask, | 59 | ZFCP_STATUS_COMMON_UNBLOCKED | mask, |
60 | ZFCP_CLEAR); | 60 | ZFCP_CLEAR); |
61 | } | 61 | } |
@@ -75,9 +75,9 @@ static void zfcp_erp_action_ready(struct zfcp_erp_action *act) | |||
75 | struct zfcp_adapter *adapter = act->adapter; | 75 | struct zfcp_adapter *adapter = act->adapter; |
76 | 76 | ||
77 | list_move(&act->list, &act->adapter->erp_ready_head); | 77 | list_move(&act->list, &act->adapter->erp_ready_head); |
78 | zfcp_rec_dbf_event_action(146, act); | 78 | zfcp_rec_dbf_event_action("erardy1", act); |
79 | up(&adapter->erp_ready_sem); | 79 | up(&adapter->erp_ready_sem); |
80 | zfcp_rec_dbf_event_thread(2, adapter); | 80 | zfcp_rec_dbf_event_thread("erardy2", adapter); |
81 | } | 81 | } |
82 | 82 | ||
83 | static void zfcp_erp_action_dismiss(struct zfcp_erp_action *act) | 83 | static void zfcp_erp_action_dismiss(struct zfcp_erp_action *act) |
@@ -208,7 +208,7 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, | |||
208 | 208 | ||
209 | static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, | 209 | static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, |
210 | struct zfcp_port *port, | 210 | struct zfcp_port *port, |
211 | struct zfcp_unit *unit, u8 id, void *ref) | 211 | struct zfcp_unit *unit, char *id, void *ref) |
212 | { | 212 | { |
213 | int retval = 1, need; | 213 | int retval = 1, need; |
214 | struct zfcp_erp_action *act = NULL; | 214 | struct zfcp_erp_action *act = NULL; |
@@ -228,7 +228,7 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, | |||
228 | ++adapter->erp_total_count; | 228 | ++adapter->erp_total_count; |
229 | list_add_tail(&act->list, &adapter->erp_ready_head); | 229 | list_add_tail(&act->list, &adapter->erp_ready_head); |
230 | up(&adapter->erp_ready_sem); | 230 | up(&adapter->erp_ready_sem); |
231 | zfcp_rec_dbf_event_thread(1, adapter); | 231 | zfcp_rec_dbf_event_thread("eracte1", adapter); |
232 | retval = 0; | 232 | retval = 0; |
233 | out: | 233 | out: |
234 | zfcp_rec_dbf_event_trigger(id, ref, want, need, act, | 234 | zfcp_rec_dbf_event_trigger(id, ref, want, need, act, |
@@ -237,13 +237,14 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, | |||
237 | } | 237 | } |
238 | 238 | ||
239 | static int _zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, | 239 | static int _zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, |
240 | int clear_mask, u8 id, void *ref) | 240 | int clear_mask, char *id, void *ref) |
241 | { | 241 | { |
242 | zfcp_erp_adapter_block(adapter, clear_mask); | 242 | zfcp_erp_adapter_block(adapter, clear_mask); |
243 | zfcp_scsi_schedule_rports_block(adapter); | ||
243 | 244 | ||
244 | /* ensure propagation of failed status to new devices */ | 245 | /* ensure propagation of failed status to new devices */ |
245 | if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_FAILED) { | 246 | if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_FAILED) { |
246 | zfcp_erp_adapter_failed(adapter, 13, NULL); | 247 | zfcp_erp_adapter_failed(adapter, "erareo1", NULL); |
247 | return -EIO; | 248 | return -EIO; |
248 | } | 249 | } |
249 | return zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER, | 250 | return zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER, |
@@ -258,7 +259,7 @@ static int _zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, | |||
258 | * @ref: Reference for debug trace event. | 259 | * @ref: Reference for debug trace event. |
259 | */ | 260 | */ |
260 | void zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, int clear, | 261 | void zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, int clear, |
261 | u8 id, void *ref) | 262 | char *id, void *ref) |
262 | { | 263 | { |
263 | unsigned long flags; | 264 | unsigned long flags; |
264 | 265 | ||
@@ -277,7 +278,7 @@ void zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, int clear, | |||
277 | * @ref: Reference for debug trace event. | 278 | * @ref: Reference for debug trace event. |
278 | */ | 279 | */ |
279 | void zfcp_erp_adapter_shutdown(struct zfcp_adapter *adapter, int clear, | 280 | void zfcp_erp_adapter_shutdown(struct zfcp_adapter *adapter, int clear, |
280 | u8 id, void *ref) | 281 | char *id, void *ref) |
281 | { | 282 | { |
282 | int flags = ZFCP_STATUS_COMMON_RUNNING | ZFCP_STATUS_COMMON_ERP_FAILED; | 283 | int flags = ZFCP_STATUS_COMMON_RUNNING | ZFCP_STATUS_COMMON_ERP_FAILED; |
283 | zfcp_erp_adapter_reopen(adapter, clear | flags, id, ref); | 284 | zfcp_erp_adapter_reopen(adapter, clear | flags, id, ref); |
@@ -290,7 +291,8 @@ void zfcp_erp_adapter_shutdown(struct zfcp_adapter *adapter, int clear, | |||
290 | * @id: Id for debug trace event. | 291 | * @id: Id for debug trace event. |
291 | * @ref: Reference for debug trace event. | 292 | * @ref: Reference for debug trace event. |
292 | */ | 293 | */ |
293 | void zfcp_erp_port_shutdown(struct zfcp_port *port, int clear, u8 id, void *ref) | 294 | void zfcp_erp_port_shutdown(struct zfcp_port *port, int clear, char *id, |
295 | void *ref) | ||
294 | { | 296 | { |
295 | int flags = ZFCP_STATUS_COMMON_RUNNING | ZFCP_STATUS_COMMON_ERP_FAILED; | 297 | int flags = ZFCP_STATUS_COMMON_RUNNING | ZFCP_STATUS_COMMON_ERP_FAILED; |
296 | zfcp_erp_port_reopen(port, clear | flags, id, ref); | 298 | zfcp_erp_port_reopen(port, clear | flags, id, ref); |
@@ -303,7 +305,8 @@ void zfcp_erp_port_shutdown(struct zfcp_port *port, int clear, u8 id, void *ref) | |||
303 | * @id: Id for debug trace event. | 305 | * @id: Id for debug trace event. |
304 | * @ref: Reference for debug trace event. | 306 | * @ref: Reference for debug trace event. |
305 | */ | 307 | */ |
306 | void zfcp_erp_unit_shutdown(struct zfcp_unit *unit, int clear, u8 id, void *ref) | 308 | void zfcp_erp_unit_shutdown(struct zfcp_unit *unit, int clear, char *id, |
309 | void *ref) | ||
307 | { | 310 | { |
308 | int flags = ZFCP_STATUS_COMMON_RUNNING | ZFCP_STATUS_COMMON_ERP_FAILED; | 311 | int flags = ZFCP_STATUS_COMMON_RUNNING | ZFCP_STATUS_COMMON_ERP_FAILED; |
309 | zfcp_erp_unit_reopen(unit, clear | flags, id, ref); | 312 | zfcp_erp_unit_reopen(unit, clear | flags, id, ref); |
@@ -311,15 +314,16 @@ void zfcp_erp_unit_shutdown(struct zfcp_unit *unit, int clear, u8 id, void *ref) | |||
311 | 314 | ||
312 | static void zfcp_erp_port_block(struct zfcp_port *port, int clear) | 315 | static void zfcp_erp_port_block(struct zfcp_port *port, int clear) |
313 | { | 316 | { |
314 | zfcp_erp_modify_port_status(port, 17, NULL, | 317 | zfcp_erp_modify_port_status(port, "erpblk1", NULL, |
315 | ZFCP_STATUS_COMMON_UNBLOCKED | clear, | 318 | ZFCP_STATUS_COMMON_UNBLOCKED | clear, |
316 | ZFCP_CLEAR); | 319 | ZFCP_CLEAR); |
317 | } | 320 | } |
318 | 321 | ||
319 | static void _zfcp_erp_port_forced_reopen(struct zfcp_port *port, | 322 | static void _zfcp_erp_port_forced_reopen(struct zfcp_port *port, |
320 | int clear, u8 id, void *ref) | 323 | int clear, char *id, void *ref) |
321 | { | 324 | { |
322 | zfcp_erp_port_block(port, clear); | 325 | zfcp_erp_port_block(port, clear); |
326 | zfcp_scsi_schedule_rport_block(port); | ||
323 | 327 | ||
324 | if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED) | 328 | if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED) |
325 | return; | 329 | return; |
@@ -334,7 +338,7 @@ static void _zfcp_erp_port_forced_reopen(struct zfcp_port *port, | |||
334 | * @id: Id for debug trace event. | 338 | * @id: Id for debug trace event. |
335 | * @ref: Reference for debug trace event. | 339 | * @ref: Reference for debug trace event. |
336 | */ | 340 | */ |
337 | void zfcp_erp_port_forced_reopen(struct zfcp_port *port, int clear, u8 id, | 341 | void zfcp_erp_port_forced_reopen(struct zfcp_port *port, int clear, char *id, |
338 | void *ref) | 342 | void *ref) |
339 | { | 343 | { |
340 | unsigned long flags; | 344 | unsigned long flags; |
@@ -347,14 +351,15 @@ void zfcp_erp_port_forced_reopen(struct zfcp_port *port, int clear, u8 id, | |||
347 | read_unlock_irqrestore(&zfcp_data.config_lock, flags); | 351 | read_unlock_irqrestore(&zfcp_data.config_lock, flags); |
348 | } | 352 | } |
349 | 353 | ||
350 | static int _zfcp_erp_port_reopen(struct zfcp_port *port, int clear, u8 id, | 354 | static int _zfcp_erp_port_reopen(struct zfcp_port *port, int clear, char *id, |
351 | void *ref) | 355 | void *ref) |
352 | { | 356 | { |
353 | zfcp_erp_port_block(port, clear); | 357 | zfcp_erp_port_block(port, clear); |
358 | zfcp_scsi_schedule_rport_block(port); | ||
354 | 359 | ||
355 | if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED) { | 360 | if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED) { |
356 | /* ensure propagation of failed status to new devices */ | 361 | /* ensure propagation of failed status to new devices */ |
357 | zfcp_erp_port_failed(port, 14, NULL); | 362 | zfcp_erp_port_failed(port, "erpreo1", NULL); |
358 | return -EIO; | 363 | return -EIO; |
359 | } | 364 | } |
360 | 365 | ||
@@ -369,7 +374,7 @@ static int _zfcp_erp_port_reopen(struct zfcp_port *port, int clear, u8 id, | |||
369 | * | 374 | * |
370 | * Returns 0 if recovery has been triggered, < 0 if not. | 375 | * Returns 0 if recovery has been triggered, < 0 if not. |
371 | */ | 376 | */ |
372 | int zfcp_erp_port_reopen(struct zfcp_port *port, int clear, u8 id, void *ref) | 377 | int zfcp_erp_port_reopen(struct zfcp_port *port, int clear, char *id, void *ref) |
373 | { | 378 | { |
374 | unsigned long flags; | 379 | unsigned long flags; |
375 | int retval; | 380 | int retval; |
@@ -386,12 +391,12 @@ int zfcp_erp_port_reopen(struct zfcp_port *port, int clear, u8 id, void *ref) | |||
386 | 391 | ||
387 | static void zfcp_erp_unit_block(struct zfcp_unit *unit, int clear_mask) | 392 | static void zfcp_erp_unit_block(struct zfcp_unit *unit, int clear_mask) |
388 | { | 393 | { |
389 | zfcp_erp_modify_unit_status(unit, 19, NULL, | 394 | zfcp_erp_modify_unit_status(unit, "erublk1", NULL, |
390 | ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, | 395 | ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, |
391 | ZFCP_CLEAR); | 396 | ZFCP_CLEAR); |
392 | } | 397 | } |
393 | 398 | ||
394 | static void _zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear, u8 id, | 399 | static void _zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear, char *id, |
395 | void *ref) | 400 | void *ref) |
396 | { | 401 | { |
397 | struct zfcp_adapter *adapter = unit->port->adapter; | 402 | struct zfcp_adapter *adapter = unit->port->adapter; |
@@ -411,7 +416,8 @@ static void _zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear, u8 id, | |||
411 | * @clear_mask: specifies flags in unit status to be cleared | 416 | * @clear_mask: specifies flags in unit status to be cleared |
412 | * Return: 0 on success, < 0 on error | 417 | * Return: 0 on success, < 0 on error |
413 | */ | 418 | */ |
414 | void zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear, u8 id, void *ref) | 419 | void zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear, char *id, |
420 | void *ref) | ||
415 | { | 421 | { |
416 | unsigned long flags; | 422 | unsigned long flags; |
417 | struct zfcp_port *port = unit->port; | 423 | struct zfcp_port *port = unit->port; |
@@ -437,28 +443,28 @@ static int status_change_clear(unsigned long mask, atomic_t *status) | |||
437 | static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter) | 443 | static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter) |
438 | { | 444 | { |
439 | if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status)) | 445 | if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status)) |
440 | zfcp_rec_dbf_event_adapter(16, NULL, adapter); | 446 | zfcp_rec_dbf_event_adapter("eraubl1", NULL, adapter); |
441 | atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status); | 447 | atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status); |
442 | } | 448 | } |
443 | 449 | ||
444 | static void zfcp_erp_port_unblock(struct zfcp_port *port) | 450 | static void zfcp_erp_port_unblock(struct zfcp_port *port) |
445 | { | 451 | { |
446 | if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status)) | 452 | if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status)) |
447 | zfcp_rec_dbf_event_port(18, NULL, port); | 453 | zfcp_rec_dbf_event_port("erpubl1", NULL, port); |
448 | atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status); | 454 | atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status); |
449 | } | 455 | } |
450 | 456 | ||
451 | static void zfcp_erp_unit_unblock(struct zfcp_unit *unit) | 457 | static void zfcp_erp_unit_unblock(struct zfcp_unit *unit) |
452 | { | 458 | { |
453 | if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status)) | 459 | if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status)) |
454 | zfcp_rec_dbf_event_unit(20, NULL, unit); | 460 | zfcp_rec_dbf_event_unit("eruubl1", NULL, unit); |
455 | atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status); | 461 | atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status); |
456 | } | 462 | } |
457 | 463 | ||
458 | static void zfcp_erp_action_to_running(struct zfcp_erp_action *erp_action) | 464 | static void zfcp_erp_action_to_running(struct zfcp_erp_action *erp_action) |
459 | { | 465 | { |
460 | list_move(&erp_action->list, &erp_action->adapter->erp_running_head); | 466 | list_move(&erp_action->list, &erp_action->adapter->erp_running_head); |
461 | zfcp_rec_dbf_event_action(145, erp_action); | 467 | zfcp_rec_dbf_event_action("erator1", erp_action); |
462 | } | 468 | } |
463 | 469 | ||
464 | static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act) | 470 | static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act) |
@@ -474,11 +480,11 @@ static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act) | |||
474 | if (act->status & (ZFCP_STATUS_ERP_DISMISSED | | 480 | if (act->status & (ZFCP_STATUS_ERP_DISMISSED | |
475 | ZFCP_STATUS_ERP_TIMEDOUT)) { | 481 | ZFCP_STATUS_ERP_TIMEDOUT)) { |
476 | act->fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; | 482 | act->fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; |
477 | zfcp_rec_dbf_event_action(142, act); | 483 | zfcp_rec_dbf_event_action("erscf_1", act); |
478 | act->fsf_req->erp_action = NULL; | 484 | act->fsf_req->erp_action = NULL; |
479 | } | 485 | } |
480 | if (act->status & ZFCP_STATUS_ERP_TIMEDOUT) | 486 | if (act->status & ZFCP_STATUS_ERP_TIMEDOUT) |
481 | zfcp_rec_dbf_event_action(143, act); | 487 | zfcp_rec_dbf_event_action("erscf_2", act); |
482 | if (act->fsf_req->status & (ZFCP_STATUS_FSFREQ_COMPLETED | | 488 | if (act->fsf_req->status & (ZFCP_STATUS_FSFREQ_COMPLETED | |
483 | ZFCP_STATUS_FSFREQ_DISMISSED)) | 489 | ZFCP_STATUS_FSFREQ_DISMISSED)) |
484 | act->fsf_req = NULL; | 490 | act->fsf_req = NULL; |
@@ -530,7 +536,7 @@ static void zfcp_erp_strategy_memwait(struct zfcp_erp_action *erp_action) | |||
530 | } | 536 | } |
531 | 537 | ||
532 | static void _zfcp_erp_port_reopen_all(struct zfcp_adapter *adapter, | 538 | static void _zfcp_erp_port_reopen_all(struct zfcp_adapter *adapter, |
533 | int clear, u8 id, void *ref) | 539 | int clear, char *id, void *ref) |
534 | { | 540 | { |
535 | struct zfcp_port *port; | 541 | struct zfcp_port *port; |
536 | 542 | ||
@@ -538,8 +544,8 @@ static void _zfcp_erp_port_reopen_all(struct zfcp_adapter *adapter, | |||
538 | _zfcp_erp_port_reopen(port, clear, id, ref); | 544 | _zfcp_erp_port_reopen(port, clear, id, ref); |
539 | } | 545 | } |
540 | 546 | ||
541 | static void _zfcp_erp_unit_reopen_all(struct zfcp_port *port, int clear, u8 id, | 547 | static void _zfcp_erp_unit_reopen_all(struct zfcp_port *port, int clear, |
542 | void *ref) | 548 | char *id, void *ref) |
543 | { | 549 | { |
544 | struct zfcp_unit *unit; | 550 | struct zfcp_unit *unit; |
545 | 551 | ||
@@ -559,28 +565,28 @@ static void zfcp_erp_strategy_followup_actions(struct zfcp_erp_action *act) | |||
559 | 565 | ||
560 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: | 566 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: |
561 | if (status == ZFCP_ERP_SUCCEEDED) | 567 | if (status == ZFCP_ERP_SUCCEEDED) |
562 | _zfcp_erp_port_reopen_all(adapter, 0, 70, NULL); | 568 | _zfcp_erp_port_reopen_all(adapter, 0, "ersfa_1", NULL); |
563 | else | 569 | else |
564 | _zfcp_erp_adapter_reopen(adapter, 0, 71, NULL); | 570 | _zfcp_erp_adapter_reopen(adapter, 0, "ersfa_2", NULL); |
565 | break; | 571 | break; |
566 | 572 | ||
567 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: | 573 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: |
568 | if (status == ZFCP_ERP_SUCCEEDED) | 574 | if (status == ZFCP_ERP_SUCCEEDED) |
569 | _zfcp_erp_port_reopen(port, 0, 72, NULL); | 575 | _zfcp_erp_port_reopen(port, 0, "ersfa_3", NULL); |
570 | else | 576 | else |
571 | _zfcp_erp_adapter_reopen(adapter, 0, 73, NULL); | 577 | _zfcp_erp_adapter_reopen(adapter, 0, "ersfa_4", NULL); |
572 | break; | 578 | break; |
573 | 579 | ||
574 | case ZFCP_ERP_ACTION_REOPEN_PORT: | 580 | case ZFCP_ERP_ACTION_REOPEN_PORT: |
575 | if (status == ZFCP_ERP_SUCCEEDED) | 581 | if (status == ZFCP_ERP_SUCCEEDED) |
576 | _zfcp_erp_unit_reopen_all(port, 0, 74, NULL); | 582 | _zfcp_erp_unit_reopen_all(port, 0, "ersfa_5", NULL); |
577 | else | 583 | else |
578 | _zfcp_erp_port_forced_reopen(port, 0, 75, NULL); | 584 | _zfcp_erp_port_forced_reopen(port, 0, "ersfa_6", NULL); |
579 | break; | 585 | break; |
580 | 586 | ||
581 | case ZFCP_ERP_ACTION_REOPEN_UNIT: | 587 | case ZFCP_ERP_ACTION_REOPEN_UNIT: |
582 | if (status != ZFCP_ERP_SUCCEEDED) | 588 | if (status != ZFCP_ERP_SUCCEEDED) |
583 | _zfcp_erp_port_reopen(unit->port, 0, 76, NULL); | 589 | _zfcp_erp_port_reopen(unit->port, 0, "ersfa_7", NULL); |
584 | break; | 590 | break; |
585 | } | 591 | } |
586 | } | 592 | } |
@@ -617,7 +623,7 @@ static void zfcp_erp_enqueue_ptp_port(struct zfcp_adapter *adapter) | |||
617 | adapter->peer_d_id); | 623 | adapter->peer_d_id); |
618 | if (IS_ERR(port)) /* error or port already attached */ | 624 | if (IS_ERR(port)) /* error or port already attached */ |
619 | return; | 625 | return; |
620 | _zfcp_erp_port_reopen(port, 0, 150, NULL); | 626 | _zfcp_erp_port_reopen(port, 0, "ereptp1", NULL); |
621 | } | 627 | } |
622 | 628 | ||
623 | static int zfcp_erp_adapter_strat_fsf_xconf(struct zfcp_erp_action *erp_action) | 629 | static int zfcp_erp_adapter_strat_fsf_xconf(struct zfcp_erp_action *erp_action) |
@@ -640,9 +646,9 @@ static int zfcp_erp_adapter_strat_fsf_xconf(struct zfcp_erp_action *erp_action) | |||
640 | return ZFCP_ERP_FAILED; | 646 | return ZFCP_ERP_FAILED; |
641 | } | 647 | } |
642 | 648 | ||
643 | zfcp_rec_dbf_event_thread_lock(6, adapter); | 649 | zfcp_rec_dbf_event_thread_lock("erasfx1", adapter); |
644 | down(&adapter->erp_ready_sem); | 650 | down(&adapter->erp_ready_sem); |
645 | zfcp_rec_dbf_event_thread_lock(7, adapter); | 651 | zfcp_rec_dbf_event_thread_lock("erasfx2", adapter); |
646 | if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) | 652 | if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) |
647 | break; | 653 | break; |
648 | 654 | ||
@@ -681,9 +687,9 @@ static int zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *act) | |||
681 | if (ret) | 687 | if (ret) |
682 | return ZFCP_ERP_FAILED; | 688 | return ZFCP_ERP_FAILED; |
683 | 689 | ||
684 | zfcp_rec_dbf_event_thread_lock(8, adapter); | 690 | zfcp_rec_dbf_event_thread_lock("erasox1", adapter); |
685 | down(&adapter->erp_ready_sem); | 691 | down(&adapter->erp_ready_sem); |
686 | zfcp_rec_dbf_event_thread_lock(9, adapter); | 692 | zfcp_rec_dbf_event_thread_lock("erasox2", adapter); |
687 | if (act->status & ZFCP_STATUS_ERP_TIMEDOUT) | 693 | if (act->status & ZFCP_STATUS_ERP_TIMEDOUT) |
688 | return ZFCP_ERP_FAILED; | 694 | return ZFCP_ERP_FAILED; |
689 | 695 | ||
@@ -705,60 +711,59 @@ static int zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *act) | |||
705 | return ZFCP_ERP_SUCCEEDED; | 711 | return ZFCP_ERP_SUCCEEDED; |
706 | } | 712 | } |
707 | 713 | ||
708 | static int zfcp_erp_adapter_strategy_generic(struct zfcp_erp_action *act, | 714 | static void zfcp_erp_adapter_strategy_close(struct zfcp_erp_action *act) |
709 | int close) | ||
710 | { | 715 | { |
711 | int retval = ZFCP_ERP_SUCCEEDED; | ||
712 | struct zfcp_adapter *adapter = act->adapter; | 716 | struct zfcp_adapter *adapter = act->adapter; |
713 | 717 | ||
714 | if (close) | ||
715 | goto close_only; | ||
716 | |||
717 | retval = zfcp_erp_adapter_strategy_open_qdio(act); | ||
718 | if (retval != ZFCP_ERP_SUCCEEDED) | ||
719 | goto failed_qdio; | ||
720 | |||
721 | retval = zfcp_erp_adapter_strategy_open_fsf(act); | ||
722 | if (retval != ZFCP_ERP_SUCCEEDED) | ||
723 | goto failed_openfcp; | ||
724 | |||
725 | atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &act->adapter->status); | ||
726 | |||
727 | return ZFCP_ERP_SUCCEEDED; | ||
728 | |||
729 | close_only: | ||
730 | atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, | ||
731 | &act->adapter->status); | ||
732 | |||
733 | failed_openfcp: | ||
734 | /* close queues to ensure that buffers are not accessed by adapter */ | 718 | /* close queues to ensure that buffers are not accessed by adapter */ |
735 | zfcp_qdio_close(adapter); | 719 | zfcp_qdio_close(adapter); |
736 | zfcp_fsf_req_dismiss_all(adapter); | 720 | zfcp_fsf_req_dismiss_all(adapter); |
737 | adapter->fsf_req_seq_no = 0; | 721 | adapter->fsf_req_seq_no = 0; |
738 | /* all ports and units are closed */ | 722 | /* all ports and units are closed */ |
739 | zfcp_erp_modify_adapter_status(adapter, 24, NULL, | 723 | zfcp_erp_modify_adapter_status(adapter, "erascl1", NULL, |
740 | ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); | 724 | ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); |
741 | failed_qdio: | 725 | |
742 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK | | 726 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK | |
743 | ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, | 727 | ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status); |
744 | &act->adapter->status); | ||
745 | return retval; | ||
746 | } | 728 | } |
747 | 729 | ||
748 | static int zfcp_erp_adapter_strategy(struct zfcp_erp_action *act) | 730 | static int zfcp_erp_adapter_strategy_open(struct zfcp_erp_action *act) |
749 | { | 731 | { |
750 | int retval; | 732 | struct zfcp_adapter *adapter = act->adapter; |
751 | 733 | ||
752 | zfcp_erp_adapter_strategy_generic(act, 1); /* close */ | 734 | if (zfcp_erp_adapter_strategy_open_qdio(act)) { |
753 | if (act->status & ZFCP_STATUS_ERP_CLOSE_ONLY) | 735 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK | |
754 | return ZFCP_ERP_EXIT; | 736 | ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, |
737 | &adapter->status); | ||
738 | return ZFCP_ERP_FAILED; | ||
739 | } | ||
740 | |||
741 | if (zfcp_erp_adapter_strategy_open_fsf(act)) { | ||
742 | zfcp_erp_adapter_strategy_close(act); | ||
743 | return ZFCP_ERP_FAILED; | ||
744 | } | ||
745 | |||
746 | atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &adapter->status); | ||
747 | |||
748 | return ZFCP_ERP_SUCCEEDED; | ||
749 | } | ||
755 | 750 | ||
756 | retval = zfcp_erp_adapter_strategy_generic(act, 0); /* open */ | 751 | static int zfcp_erp_adapter_strategy(struct zfcp_erp_action *act) |
752 | { | ||
753 | struct zfcp_adapter *adapter = act->adapter; | ||
757 | 754 | ||
758 | if (retval == ZFCP_ERP_FAILED) | 755 | if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_OPEN) { |
756 | zfcp_erp_adapter_strategy_close(act); | ||
757 | if (act->status & ZFCP_STATUS_ERP_CLOSE_ONLY) | ||
758 | return ZFCP_ERP_EXIT; | ||
759 | } | ||
760 | |||
761 | if (zfcp_erp_adapter_strategy_open(act)) { | ||
759 | ssleep(8); | 762 | ssleep(8); |
763 | return ZFCP_ERP_FAILED; | ||
764 | } | ||
760 | 765 | ||
761 | return retval; | 766 | return ZFCP_ERP_SUCCEEDED; |
762 | } | 767 | } |
763 | 768 | ||
764 | static int zfcp_erp_port_forced_strategy_close(struct zfcp_erp_action *act) | 769 | static int zfcp_erp_port_forced_strategy_close(struct zfcp_erp_action *act) |
@@ -777,10 +782,7 @@ static int zfcp_erp_port_forced_strategy_close(struct zfcp_erp_action *act) | |||
777 | 782 | ||
778 | static void zfcp_erp_port_strategy_clearstati(struct zfcp_port *port) | 783 | static void zfcp_erp_port_strategy_clearstati(struct zfcp_port *port) |
779 | { | 784 | { |
780 | atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | | 785 | atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, &port->status); |
781 | ZFCP_STATUS_PORT_PHYS_CLOSING | | ||
782 | ZFCP_STATUS_PORT_INVALID_WWPN, | ||
783 | &port->status); | ||
784 | } | 786 | } |
785 | 787 | ||
786 | static int zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action) | 788 | static int zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action) |
@@ -836,7 +838,7 @@ static int zfcp_erp_open_ptp_port(struct zfcp_erp_action *act) | |||
836 | struct zfcp_port *port = act->port; | 838 | struct zfcp_port *port = act->port; |
837 | 839 | ||
838 | if (port->wwpn != adapter->peer_wwpn) { | 840 | if (port->wwpn != adapter->peer_wwpn) { |
839 | zfcp_erp_port_failed(port, 25, NULL); | 841 | zfcp_erp_port_failed(port, "eroptp1", NULL); |
840 | return ZFCP_ERP_FAILED; | 842 | return ZFCP_ERP_FAILED; |
841 | } | 843 | } |
842 | port->d_id = adapter->peer_d_id; | 844 | port->d_id = adapter->peer_d_id; |
@@ -855,7 +857,7 @@ void zfcp_erp_port_strategy_open_lookup(struct work_struct *work) | |||
855 | port->erp_action.step = ZFCP_ERP_STEP_NAMESERVER_LOOKUP; | 857 | port->erp_action.step = ZFCP_ERP_STEP_NAMESERVER_LOOKUP; |
856 | if (retval) | 858 | if (retval) |
857 | zfcp_erp_notify(&port->erp_action, ZFCP_ERP_FAILED); | 859 | zfcp_erp_notify(&port->erp_action, ZFCP_ERP_FAILED); |
858 | 860 | zfcp_port_put(port); | |
859 | } | 861 | } |
860 | 862 | ||
861 | static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act) | 863 | static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act) |
@@ -871,17 +873,15 @@ static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act) | |||
871 | if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_PTP) | 873 | if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_PTP) |
872 | return zfcp_erp_open_ptp_port(act); | 874 | return zfcp_erp_open_ptp_port(act); |
873 | if (!port->d_id) { | 875 | if (!port->d_id) { |
874 | queue_work(zfcp_data.work_queue, &port->gid_pn_work); | 876 | zfcp_port_get(port); |
877 | if (!queue_work(zfcp_data.work_queue, | ||
878 | &port->gid_pn_work)) | ||
879 | zfcp_port_put(port); | ||
875 | return ZFCP_ERP_CONTINUES; | 880 | return ZFCP_ERP_CONTINUES; |
876 | } | 881 | } |
877 | case ZFCP_ERP_STEP_NAMESERVER_LOOKUP: | 882 | case ZFCP_ERP_STEP_NAMESERVER_LOOKUP: |
878 | if (!port->d_id) { | 883 | if (!port->d_id) |
879 | if (p_status & (ZFCP_STATUS_PORT_INVALID_WWPN)) { | ||
880 | zfcp_erp_port_failed(port, 26, NULL); | ||
881 | return ZFCP_ERP_EXIT; | ||
882 | } | ||
883 | return ZFCP_ERP_FAILED; | 884 | return ZFCP_ERP_FAILED; |
884 | } | ||
885 | return zfcp_erp_port_strategy_open_port(act); | 885 | return zfcp_erp_port_strategy_open_port(act); |
886 | 886 | ||
887 | case ZFCP_ERP_STEP_PORT_OPENING: | 887 | case ZFCP_ERP_STEP_PORT_OPENING: |
@@ -995,7 +995,7 @@ static int zfcp_erp_strategy_check_unit(struct zfcp_unit *unit, int result) | |||
995 | "port 0x%016Lx\n", | 995 | "port 0x%016Lx\n", |
996 | (unsigned long long)unit->fcp_lun, | 996 | (unsigned long long)unit->fcp_lun, |
997 | (unsigned long long)unit->port->wwpn); | 997 | (unsigned long long)unit->port->wwpn); |
998 | zfcp_erp_unit_failed(unit, 21, NULL); | 998 | zfcp_erp_unit_failed(unit, "erusck1", NULL); |
999 | } | 999 | } |
1000 | break; | 1000 | break; |
1001 | } | 1001 | } |
@@ -1025,7 +1025,7 @@ static int zfcp_erp_strategy_check_port(struct zfcp_port *port, int result) | |||
1025 | dev_err(&port->adapter->ccw_device->dev, | 1025 | dev_err(&port->adapter->ccw_device->dev, |
1026 | "ERP failed for remote port 0x%016Lx\n", | 1026 | "ERP failed for remote port 0x%016Lx\n", |
1027 | (unsigned long long)port->wwpn); | 1027 | (unsigned long long)port->wwpn); |
1028 | zfcp_erp_port_failed(port, 22, NULL); | 1028 | zfcp_erp_port_failed(port, "erpsck1", NULL); |
1029 | } | 1029 | } |
1030 | break; | 1030 | break; |
1031 | } | 1031 | } |
@@ -1052,7 +1052,7 @@ static int zfcp_erp_strategy_check_adapter(struct zfcp_adapter *adapter, | |||
1052 | dev_err(&adapter->ccw_device->dev, | 1052 | dev_err(&adapter->ccw_device->dev, |
1053 | "ERP cannot recover an error " | 1053 | "ERP cannot recover an error " |
1054 | "on the FCP device\n"); | 1054 | "on the FCP device\n"); |
1055 | zfcp_erp_adapter_failed(adapter, 23, NULL); | 1055 | zfcp_erp_adapter_failed(adapter, "erasck1", NULL); |
1056 | } | 1056 | } |
1057 | break; | 1057 | break; |
1058 | } | 1058 | } |
@@ -1117,7 +1117,7 @@ static int zfcp_erp_strategy_statechange(struct zfcp_erp_action *act, int ret) | |||
1117 | if (zfcp_erp_strat_change_det(&adapter->status, erp_status)) { | 1117 | if (zfcp_erp_strat_change_det(&adapter->status, erp_status)) { |
1118 | _zfcp_erp_adapter_reopen(adapter, | 1118 | _zfcp_erp_adapter_reopen(adapter, |
1119 | ZFCP_STATUS_COMMON_ERP_FAILED, | 1119 | ZFCP_STATUS_COMMON_ERP_FAILED, |
1120 | 67, NULL); | 1120 | "ersscg1", NULL); |
1121 | return ZFCP_ERP_EXIT; | 1121 | return ZFCP_ERP_EXIT; |
1122 | } | 1122 | } |
1123 | break; | 1123 | break; |
@@ -1127,7 +1127,7 @@ static int zfcp_erp_strategy_statechange(struct zfcp_erp_action *act, int ret) | |||
1127 | if (zfcp_erp_strat_change_det(&port->status, erp_status)) { | 1127 | if (zfcp_erp_strat_change_det(&port->status, erp_status)) { |
1128 | _zfcp_erp_port_reopen(port, | 1128 | _zfcp_erp_port_reopen(port, |
1129 | ZFCP_STATUS_COMMON_ERP_FAILED, | 1129 | ZFCP_STATUS_COMMON_ERP_FAILED, |
1130 | 68, NULL); | 1130 | "ersscg2", NULL); |
1131 | return ZFCP_ERP_EXIT; | 1131 | return ZFCP_ERP_EXIT; |
1132 | } | 1132 | } |
1133 | break; | 1133 | break; |
@@ -1136,7 +1136,7 @@ static int zfcp_erp_strategy_statechange(struct zfcp_erp_action *act, int ret) | |||
1136 | if (zfcp_erp_strat_change_det(&unit->status, erp_status)) { | 1136 | if (zfcp_erp_strat_change_det(&unit->status, erp_status)) { |
1137 | _zfcp_erp_unit_reopen(unit, | 1137 | _zfcp_erp_unit_reopen(unit, |
1138 | ZFCP_STATUS_COMMON_ERP_FAILED, | 1138 | ZFCP_STATUS_COMMON_ERP_FAILED, |
1139 | 69, NULL); | 1139 | "ersscg3", NULL); |
1140 | return ZFCP_ERP_EXIT; | 1140 | return ZFCP_ERP_EXIT; |
1141 | } | 1141 | } |
1142 | break; | 1142 | break; |
@@ -1155,7 +1155,7 @@ static void zfcp_erp_action_dequeue(struct zfcp_erp_action *erp_action) | |||
1155 | } | 1155 | } |
1156 | 1156 | ||
1157 | list_del(&erp_action->list); | 1157 | list_del(&erp_action->list); |
1158 | zfcp_rec_dbf_event_action(144, erp_action); | 1158 | zfcp_rec_dbf_event_action("eractd1", erp_action); |
1159 | 1159 | ||
1160 | switch (erp_action->action) { | 1160 | switch (erp_action->action) { |
1161 | case ZFCP_ERP_ACTION_REOPEN_UNIT: | 1161 | case ZFCP_ERP_ACTION_REOPEN_UNIT: |
@@ -1214,38 +1214,8 @@ static void zfcp_erp_schedule_work(struct zfcp_unit *unit) | |||
1214 | atomic_set_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status); | 1214 | atomic_set_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status); |
1215 | INIT_WORK(&p->work, zfcp_erp_scsi_scan); | 1215 | INIT_WORK(&p->work, zfcp_erp_scsi_scan); |
1216 | p->unit = unit; | 1216 | p->unit = unit; |
1217 | queue_work(zfcp_data.work_queue, &p->work); | 1217 | if (!queue_work(zfcp_data.work_queue, &p->work)) |
1218 | } | 1218 | zfcp_unit_put(unit); |
1219 | |||
1220 | static void zfcp_erp_rport_register(struct zfcp_port *port) | ||
1221 | { | ||
1222 | struct fc_rport_identifiers ids; | ||
1223 | ids.node_name = port->wwnn; | ||
1224 | ids.port_name = port->wwpn; | ||
1225 | ids.port_id = port->d_id; | ||
1226 | ids.roles = FC_RPORT_ROLE_FCP_TARGET; | ||
1227 | port->rport = fc_remote_port_add(port->adapter->scsi_host, 0, &ids); | ||
1228 | if (!port->rport) { | ||
1229 | dev_err(&port->adapter->ccw_device->dev, | ||
1230 | "Registering port 0x%016Lx failed\n", | ||
1231 | (unsigned long long)port->wwpn); | ||
1232 | return; | ||
1233 | } | ||
1234 | |||
1235 | scsi_target_unblock(&port->rport->dev); | ||
1236 | port->rport->maxframe_size = port->maxframe_size; | ||
1237 | port->rport->supported_classes = port->supported_classes; | ||
1238 | } | ||
1239 | |||
1240 | static void zfcp_erp_rports_del(struct zfcp_adapter *adapter) | ||
1241 | { | ||
1242 | struct zfcp_port *port; | ||
1243 | list_for_each_entry(port, &adapter->port_list_head, list) { | ||
1244 | if (!port->rport) | ||
1245 | continue; | ||
1246 | fc_remote_port_delete(port->rport); | ||
1247 | port->rport = NULL; | ||
1248 | } | ||
1249 | } | 1219 | } |
1250 | 1220 | ||
1251 | static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) | 1221 | static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) |
@@ -1256,10 +1226,8 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) | |||
1256 | 1226 | ||
1257 | switch (act->action) { | 1227 | switch (act->action) { |
1258 | case ZFCP_ERP_ACTION_REOPEN_UNIT: | 1228 | case ZFCP_ERP_ACTION_REOPEN_UNIT: |
1259 | if ((result == ZFCP_ERP_SUCCEEDED) && | 1229 | flush_work(&port->rport_work); |
1260 | !unit->device && port->rport) { | 1230 | if ((result == ZFCP_ERP_SUCCEEDED) && !unit->device) { |
1261 | atomic_set_mask(ZFCP_STATUS_UNIT_REGISTERED, | ||
1262 | &unit->status); | ||
1263 | if (!(atomic_read(&unit->status) & | 1231 | if (!(atomic_read(&unit->status) & |
1264 | ZFCP_STATUS_UNIT_SCSI_WORK_PENDING)) | 1232 | ZFCP_STATUS_UNIT_SCSI_WORK_PENDING)) |
1265 | zfcp_erp_schedule_work(unit); | 1233 | zfcp_erp_schedule_work(unit); |
@@ -1269,27 +1237,17 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) | |||
1269 | 1237 | ||
1270 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: | 1238 | case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: |
1271 | case ZFCP_ERP_ACTION_REOPEN_PORT: | 1239 | case ZFCP_ERP_ACTION_REOPEN_PORT: |
1272 | if (atomic_read(&port->status) & ZFCP_STATUS_PORT_NO_WWPN) { | 1240 | if (result == ZFCP_ERP_SUCCEEDED) |
1273 | zfcp_port_put(port); | 1241 | zfcp_scsi_schedule_rport_register(port); |
1274 | return; | ||
1275 | } | ||
1276 | if ((result == ZFCP_ERP_SUCCEEDED) && !port->rport) | ||
1277 | zfcp_erp_rport_register(port); | ||
1278 | if ((result != ZFCP_ERP_SUCCEEDED) && port->rport) { | ||
1279 | fc_remote_port_delete(port->rport); | ||
1280 | port->rport = NULL; | ||
1281 | } | ||
1282 | zfcp_port_put(port); | 1242 | zfcp_port_put(port); |
1283 | break; | 1243 | break; |
1284 | 1244 | ||
1285 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: | 1245 | case ZFCP_ERP_ACTION_REOPEN_ADAPTER: |
1286 | if (result != ZFCP_ERP_SUCCEEDED) { | 1246 | if (result == ZFCP_ERP_SUCCEEDED) { |
1287 | unregister_service_level(&adapter->service_level); | ||
1288 | zfcp_erp_rports_del(adapter); | ||
1289 | } else { | ||
1290 | register_service_level(&adapter->service_level); | 1247 | register_service_level(&adapter->service_level); |
1291 | schedule_work(&adapter->scan_work); | 1248 | schedule_work(&adapter->scan_work); |
1292 | } | 1249 | } else |
1250 | unregister_service_level(&adapter->service_level); | ||
1293 | zfcp_adapter_put(adapter); | 1251 | zfcp_adapter_put(adapter); |
1294 | break; | 1252 | break; |
1295 | } | 1253 | } |
@@ -1346,7 +1304,7 @@ static int zfcp_erp_strategy(struct zfcp_erp_action *erp_action) | |||
1346 | erp_action->status |= ZFCP_STATUS_ERP_LOWMEM; | 1304 | erp_action->status |= ZFCP_STATUS_ERP_LOWMEM; |
1347 | } | 1305 | } |
1348 | if (adapter->erp_total_count == adapter->erp_low_mem_count) | 1306 | if (adapter->erp_total_count == adapter->erp_low_mem_count) |
1349 | _zfcp_erp_adapter_reopen(adapter, 0, 66, NULL); | 1307 | _zfcp_erp_adapter_reopen(adapter, 0, "erstgy1", NULL); |
1350 | else { | 1308 | else { |
1351 | zfcp_erp_strategy_memwait(erp_action); | 1309 | zfcp_erp_strategy_memwait(erp_action); |
1352 | retval = ZFCP_ERP_CONTINUES; | 1310 | retval = ZFCP_ERP_CONTINUES; |
@@ -1406,9 +1364,9 @@ static int zfcp_erp_thread(void *data) | |||
1406 | zfcp_erp_wakeup(adapter); | 1364 | zfcp_erp_wakeup(adapter); |
1407 | } | 1365 | } |
1408 | 1366 | ||
1409 | zfcp_rec_dbf_event_thread_lock(4, adapter); | 1367 | zfcp_rec_dbf_event_thread_lock("erthrd1", adapter); |
1410 | ignore = down_interruptible(&adapter->erp_ready_sem); | 1368 | ignore = down_interruptible(&adapter->erp_ready_sem); |
1411 | zfcp_rec_dbf_event_thread_lock(5, adapter); | 1369 | zfcp_rec_dbf_event_thread_lock("erthrd2", adapter); |
1412 | } | 1370 | } |
1413 | 1371 | ||
1414 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status); | 1372 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status); |
@@ -1453,7 +1411,7 @@ void zfcp_erp_thread_kill(struct zfcp_adapter *adapter) | |||
1453 | { | 1411 | { |
1454 | atomic_set_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL, &adapter->status); | 1412 | atomic_set_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL, &adapter->status); |
1455 | up(&adapter->erp_ready_sem); | 1413 | up(&adapter->erp_ready_sem); |
1456 | zfcp_rec_dbf_event_thread_lock(3, adapter); | 1414 | zfcp_rec_dbf_event_thread_lock("erthrk1", adapter); |
1457 | 1415 | ||
1458 | wait_event(adapter->erp_thread_wqh, | 1416 | wait_event(adapter->erp_thread_wqh, |
1459 | !(atomic_read(&adapter->status) & | 1417 | !(atomic_read(&adapter->status) & |
@@ -1469,7 +1427,7 @@ void zfcp_erp_thread_kill(struct zfcp_adapter *adapter) | |||
1469 | * @id: Event id for debug trace. | 1427 | * @id: Event id for debug trace. |
1470 | * @ref: Reference for debug trace. | 1428 | * @ref: Reference for debug trace. |
1471 | */ | 1429 | */ |
1472 | void zfcp_erp_adapter_failed(struct zfcp_adapter *adapter, u8 id, void *ref) | 1430 | void zfcp_erp_adapter_failed(struct zfcp_adapter *adapter, char *id, void *ref) |
1473 | { | 1431 | { |
1474 | zfcp_erp_modify_adapter_status(adapter, id, ref, | 1432 | zfcp_erp_modify_adapter_status(adapter, id, ref, |
1475 | ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); | 1433 | ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); |
@@ -1481,7 +1439,7 @@ void zfcp_erp_adapter_failed(struct zfcp_adapter *adapter, u8 id, void *ref) | |||
1481 | * @id: Event id for debug trace. | 1439 | * @id: Event id for debug trace. |
1482 | * @ref: Reference for debug trace. | 1440 | * @ref: Reference for debug trace. |
1483 | */ | 1441 | */ |
1484 | void zfcp_erp_port_failed(struct zfcp_port *port, u8 id, void *ref) | 1442 | void zfcp_erp_port_failed(struct zfcp_port *port, char *id, void *ref) |
1485 | { | 1443 | { |
1486 | zfcp_erp_modify_port_status(port, id, ref, | 1444 | zfcp_erp_modify_port_status(port, id, ref, |
1487 | ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); | 1445 | ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); |
@@ -1493,7 +1451,7 @@ void zfcp_erp_port_failed(struct zfcp_port *port, u8 id, void *ref) | |||
1493 | * @id: Event id for debug trace. | 1451 | * @id: Event id for debug trace. |
1494 | * @ref: Reference for debug trace. | 1452 | * @ref: Reference for debug trace. |
1495 | */ | 1453 | */ |
1496 | void zfcp_erp_unit_failed(struct zfcp_unit *unit, u8 id, void *ref) | 1454 | void zfcp_erp_unit_failed(struct zfcp_unit *unit, char *id, void *ref) |
1497 | { | 1455 | { |
1498 | zfcp_erp_modify_unit_status(unit, id, ref, | 1456 | zfcp_erp_modify_unit_status(unit, id, ref, |
1499 | ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); | 1457 | ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); |
@@ -1520,7 +1478,7 @@ void zfcp_erp_wait(struct zfcp_adapter *adapter) | |||
1520 | * | 1478 | * |
1521 | * Changes in common status bits are propagated to attached ports and units. | 1479 | * Changes in common status bits are propagated to attached ports and units. |
1522 | */ | 1480 | */ |
1523 | void zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, u8 id, | 1481 | void zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, char *id, |
1524 | void *ref, u32 mask, int set_or_clear) | 1482 | void *ref, u32 mask, int set_or_clear) |
1525 | { | 1483 | { |
1526 | struct zfcp_port *port; | 1484 | struct zfcp_port *port; |
@@ -1554,7 +1512,7 @@ void zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, u8 id, | |||
1554 | * | 1512 | * |
1555 | * Changes in common status bits are propagated to attached units. | 1513 | * Changes in common status bits are propagated to attached units. |
1556 | */ | 1514 | */ |
1557 | void zfcp_erp_modify_port_status(struct zfcp_port *port, u8 id, void *ref, | 1515 | void zfcp_erp_modify_port_status(struct zfcp_port *port, char *id, void *ref, |
1558 | u32 mask, int set_or_clear) | 1516 | u32 mask, int set_or_clear) |
1559 | { | 1517 | { |
1560 | struct zfcp_unit *unit; | 1518 | struct zfcp_unit *unit; |
@@ -1586,7 +1544,7 @@ void zfcp_erp_modify_port_status(struct zfcp_port *port, u8 id, void *ref, | |||
1586 | * @mask: status bits to change | 1544 | * @mask: status bits to change |
1587 | * @set_or_clear: ZFCP_SET or ZFCP_CLEAR | 1545 | * @set_or_clear: ZFCP_SET or ZFCP_CLEAR |
1588 | */ | 1546 | */ |
1589 | void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, u8 id, void *ref, | 1547 | void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, char *id, void *ref, |
1590 | u32 mask, int set_or_clear) | 1548 | u32 mask, int set_or_clear) |
1591 | { | 1549 | { |
1592 | if (set_or_clear == ZFCP_SET) { | 1550 | if (set_or_clear == ZFCP_SET) { |
@@ -1609,7 +1567,7 @@ void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, u8 id, void *ref, | |||
1609 | * @id: The debug trace id. | 1567 | * @id: The debug trace id. |
1610 | * @id: Reference for the debug trace. | 1568 | * @id: Reference for the debug trace. |
1611 | */ | 1569 | */ |
1612 | void zfcp_erp_port_boxed(struct zfcp_port *port, u8 id, void *ref) | 1570 | void zfcp_erp_port_boxed(struct zfcp_port *port, char *id, void *ref) |
1613 | { | 1571 | { |
1614 | unsigned long flags; | 1572 | unsigned long flags; |
1615 | 1573 | ||
@@ -1626,7 +1584,7 @@ void zfcp_erp_port_boxed(struct zfcp_port *port, u8 id, void *ref) | |||
1626 | * @id: The debug trace id. | 1584 | * @id: The debug trace id. |
1627 | * @id: Reference for the debug trace. | 1585 | * @id: Reference for the debug trace. |
1628 | */ | 1586 | */ |
1629 | void zfcp_erp_unit_boxed(struct zfcp_unit *unit, u8 id, void *ref) | 1587 | void zfcp_erp_unit_boxed(struct zfcp_unit *unit, char *id, void *ref) |
1630 | { | 1588 | { |
1631 | zfcp_erp_modify_unit_status(unit, id, ref, | 1589 | zfcp_erp_modify_unit_status(unit, id, ref, |
1632 | ZFCP_STATUS_COMMON_ACCESS_BOXED, ZFCP_SET); | 1590 | ZFCP_STATUS_COMMON_ACCESS_BOXED, ZFCP_SET); |
@@ -1642,7 +1600,7 @@ void zfcp_erp_unit_boxed(struct zfcp_unit *unit, u8 id, void *ref) | |||
1642 | * Since the adapter has denied access, stop using the port and the | 1600 | * Since the adapter has denied access, stop using the port and the |
1643 | * attached units. | 1601 | * attached units. |
1644 | */ | 1602 | */ |
1645 | void zfcp_erp_port_access_denied(struct zfcp_port *port, u8 id, void *ref) | 1603 | void zfcp_erp_port_access_denied(struct zfcp_port *port, char *id, void *ref) |
1646 | { | 1604 | { |
1647 | unsigned long flags; | 1605 | unsigned long flags; |
1648 | 1606 | ||
@@ -1661,14 +1619,14 @@ void zfcp_erp_port_access_denied(struct zfcp_port *port, u8 id, void *ref) | |||
1661 | * | 1619 | * |
1662 | * Since the adapter has denied access, stop using the unit. | 1620 | * Since the adapter has denied access, stop using the unit. |
1663 | */ | 1621 | */ |
1664 | void zfcp_erp_unit_access_denied(struct zfcp_unit *unit, u8 id, void *ref) | 1622 | void zfcp_erp_unit_access_denied(struct zfcp_unit *unit, char *id, void *ref) |
1665 | { | 1623 | { |
1666 | zfcp_erp_modify_unit_status(unit, id, ref, | 1624 | zfcp_erp_modify_unit_status(unit, id, ref, |
1667 | ZFCP_STATUS_COMMON_ERP_FAILED | | 1625 | ZFCP_STATUS_COMMON_ERP_FAILED | |
1668 | ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); | 1626 | ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); |
1669 | } | 1627 | } |
1670 | 1628 | ||
1671 | static void zfcp_erp_unit_access_changed(struct zfcp_unit *unit, u8 id, | 1629 | static void zfcp_erp_unit_access_changed(struct zfcp_unit *unit, char *id, |
1672 | void *ref) | 1630 | void *ref) |
1673 | { | 1631 | { |
1674 | int status = atomic_read(&unit->status); | 1632 | int status = atomic_read(&unit->status); |
@@ -1679,7 +1637,7 @@ static void zfcp_erp_unit_access_changed(struct zfcp_unit *unit, u8 id, | |||
1679 | zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED, id, ref); | 1637 | zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED, id, ref); |
1680 | } | 1638 | } |
1681 | 1639 | ||
1682 | static void zfcp_erp_port_access_changed(struct zfcp_port *port, u8 id, | 1640 | static void zfcp_erp_port_access_changed(struct zfcp_port *port, char *id, |
1683 | void *ref) | 1641 | void *ref) |
1684 | { | 1642 | { |
1685 | struct zfcp_unit *unit; | 1643 | struct zfcp_unit *unit; |
@@ -1701,7 +1659,7 @@ static void zfcp_erp_port_access_changed(struct zfcp_port *port, u8 id, | |||
1701 | * @id: Id for debug trace | 1659 | * @id: Id for debug trace |
1702 | * @ref: Reference for debug trace | 1660 | * @ref: Reference for debug trace |
1703 | */ | 1661 | */ |
1704 | void zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter, u8 id, | 1662 | void zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter, char *id, |
1705 | void *ref) | 1663 | void *ref) |
1706 | { | 1664 | { |
1707 | struct zfcp_port *port; | 1665 | struct zfcp_port *port; |