diff options
author | Martin Peschke <mp3@de.ibm.com> | 2008-03-27 09:22:02 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-07 13:19:04 -0400 |
commit | 698ec01635819c5ae60090bb4efcbeffc41642fb (patch) | |
tree | 8800461be45c3efa65558441a3d049fd0a38bf52 /drivers | |
parent | 348447e85749120ad600a5c8e23b6bb7058b931d (diff) |
[SCSI] zfcp: Add traces for state changes.
This patch writes a trace record which provides information about state
changes for adapters, ports and units, e.g. target failure, targets becoming
online, targets being temporarily blocked due to pending recovery, targets
which have been recovered successfully etc.
Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/scsi/zfcp_ccw.c | 6 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_dbf.c | 126 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 11 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 153 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_ext.h | 24 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 70 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 2 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_sysfs_adapter.c | 4 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_sysfs_port.c | 3 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_sysfs_unit.c | 3 |
10 files changed, 288 insertions, 114 deletions
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index edc5015e920d..dd40b1c350b9 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c | |||
@@ -170,8 +170,8 @@ zfcp_ccw_set_online(struct ccw_device *ccw_device) | |||
170 | BUG_ON(!zfcp_reqlist_isempty(adapter)); | 170 | BUG_ON(!zfcp_reqlist_isempty(adapter)); |
171 | adapter->req_no = 0; | 171 | adapter->req_no = 0; |
172 | 172 | ||
173 | zfcp_erp_modify_adapter_status(adapter, ZFCP_STATUS_COMMON_RUNNING, | 173 | zfcp_erp_modify_adapter_status(adapter, 10, 0, |
174 | ZFCP_SET); | 174 | ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); |
175 | zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED); | 175 | zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED); |
176 | zfcp_erp_wait(adapter); | 176 | zfcp_erp_wait(adapter); |
177 | goto out; | 177 | goto out; |
@@ -236,7 +236,7 @@ zfcp_ccw_notify(struct ccw_device *ccw_device, int event) | |||
236 | ZFCP_LOG_NORMAL("adapter %s: operational again\n", | 236 | ZFCP_LOG_NORMAL("adapter %s: operational again\n", |
237 | zfcp_get_busid_by_adapter(adapter)); | 237 | zfcp_get_busid_by_adapter(adapter)); |
238 | debug_text_event(adapter->erp_dbf,1,"dev_oper"); | 238 | debug_text_event(adapter->erp_dbf,1,"dev_oper"); |
239 | zfcp_erp_modify_adapter_status(adapter, | 239 | zfcp_erp_modify_adapter_status(adapter, 11, 0, |
240 | ZFCP_STATUS_COMMON_RUNNING, | 240 | ZFCP_STATUS_COMMON_RUNNING, |
241 | ZFCP_SET); | 241 | ZFCP_SET); |
242 | zfcp_erp_adapter_reopen(adapter, | 242 | zfcp_erp_adapter_reopen(adapter, |
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 5a4b1e9a8b50..2fcfe9bec554 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c | |||
@@ -522,6 +522,7 @@ static struct debug_view zfcp_hba_dbf_view = { | |||
522 | 522 | ||
523 | static const char *zfcp_rec_dbf_tags[] = { | 523 | static const char *zfcp_rec_dbf_tags[] = { |
524 | [ZFCP_REC_DBF_ID_THREAD] = "thread", | 524 | [ZFCP_REC_DBF_ID_THREAD] = "thread", |
525 | [ZFCP_REC_DBF_ID_TARGET] = "target", | ||
525 | }; | 526 | }; |
526 | 527 | ||
527 | static const char *zfcp_rec_dbf_ids[] = { | 528 | static const char *zfcp_rec_dbf_ids[] = { |
@@ -534,6 +535,58 @@ static const char *zfcp_rec_dbf_ids[] = { | |||
534 | [7] = "down wakeup ecd", | 535 | [7] = "down wakeup ecd", |
535 | [8] = "down sleep epd", | 536 | [8] = "down sleep epd", |
536 | [9] = "down wakeup epd", | 537 | [9] = "down wakeup epd", |
538 | [10] = "online", | ||
539 | [11] = "operational", | ||
540 | [12] = "scsi slave destroy", | ||
541 | [13] = "propagate failed adapter", | ||
542 | [14] = "propagate failed port", | ||
543 | [15] = "block adapter", | ||
544 | [16] = "unblock adapter", | ||
545 | [17] = "block port", | ||
546 | [18] = "unblock port", | ||
547 | [19] = "block unit", | ||
548 | [20] = "unblock unit", | ||
549 | [21] = "unit recovery failed", | ||
550 | [22] = "port recovery failed", | ||
551 | [23] = "adapter recovery failed", | ||
552 | [24] = "qdio queues down", | ||
553 | [25] = "p2p failed", | ||
554 | [26] = "nameserver lookup failed", | ||
555 | [27] = "nameserver port failed", | ||
556 | [28] = "link up", | ||
557 | [29] = "link down", | ||
558 | [30] = "link up status read", | ||
559 | [31] = "open port failed", | ||
560 | [32] = "open port failed", | ||
561 | [33] = "close port", | ||
562 | [34] = "open unit failed", | ||
563 | [35] = "exclusive open unit failed", | ||
564 | [36] = "shared open unit failed", | ||
565 | [37] = "link down", | ||
566 | [38] = "link down status read no link", | ||
567 | [39] = "link down status read fdisc login", | ||
568 | [40] = "link down status read firmware update", | ||
569 | [41] = "link down status read unknown reason", | ||
570 | [42] = "link down ecd incomplete", | ||
571 | [43] = "link down epd incomplete", | ||
572 | [44] = "sysfs adapter recovery", | ||
573 | [45] = "sysfs port recovery", | ||
574 | [46] = "sysfs unit recovery", | ||
575 | [47] = "port boxed abort", | ||
576 | [48] = "unit boxed abort", | ||
577 | [49] = "port boxed ct", | ||
578 | [50] = "port boxed close physical", | ||
579 | [51] = "port boxed open unit", | ||
580 | [52] = "port boxed close unit", | ||
581 | [53] = "port boxed fcp", | ||
582 | [54] = "unit boxed fcp", | ||
583 | [55] = "port access denied ct", | ||
584 | [56] = "port access denied els", | ||
585 | [57] = "port access denied open port", | ||
586 | [58] = "port access denied close physical", | ||
587 | [59] = "unit access denied open unit", | ||
588 | [60] = "shared unit access denied open unit", | ||
589 | [61] = "unit access denied fcp", | ||
537 | }; | 590 | }; |
538 | 591 | ||
539 | static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, | 592 | static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, |
@@ -552,6 +605,14 @@ static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, | |||
552 | zfcp_dbf_out(&p, "ready", "%d", r->u.thread.ready); | 605 | zfcp_dbf_out(&p, "ready", "%d", r->u.thread.ready); |
553 | zfcp_dbf_out(&p, "running", "%d", r->u.thread.running); | 606 | zfcp_dbf_out(&p, "running", "%d", r->u.thread.running); |
554 | break; | 607 | break; |
608 | case ZFCP_REC_DBF_ID_TARGET: | ||
609 | zfcp_dbf_out(&p, "reference", "0x%016Lx", r->u.target.ref); | ||
610 | zfcp_dbf_out(&p, "status", "0x%08x", r->u.target.status); | ||
611 | zfcp_dbf_out(&p, "erp_count", "%d", r->u.target.erp_count); | ||
612 | zfcp_dbf_out(&p, "d_id", "0x%06x", r->u.target.d_id); | ||
613 | zfcp_dbf_out(&p, "wwpn", "0x%016Lx", r->u.target.wwpn); | ||
614 | zfcp_dbf_out(&p, "fcp_lun", "0x%016Lx", r->u.target.fcp_lun); | ||
615 | break; | ||
555 | } | 616 | } |
556 | sprintf(p, "\n"); | 617 | sprintf(p, "\n"); |
557 | return (p - buf) + 1; | 618 | return (p - buf) + 1; |
@@ -601,6 +662,71 @@ void zfcp_rec_dbf_event_thread(u8 id2, struct zfcp_adapter *adapter, int lock) | |||
601 | spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); | 662 | spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); |
602 | } | 663 | } |
603 | 664 | ||
665 | static void zfcp_rec_dbf_event_target(u8 id2, u64 ref, | ||
666 | struct zfcp_adapter *adapter, | ||
667 | atomic_t *status, atomic_t *erp_count, | ||
668 | u64 wwpn, u32 d_id, u64 fcp_lun) | ||
669 | { | ||
670 | struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf; | ||
671 | unsigned long flags; | ||
672 | |||
673 | spin_lock_irqsave(&adapter->rec_dbf_lock, flags); | ||
674 | memset(r, 0, sizeof(*r)); | ||
675 | r->id = ZFCP_REC_DBF_ID_TARGET; | ||
676 | r->id2 = id2; | ||
677 | r->u.target.ref = ref; | ||
678 | r->u.target.status = atomic_read(status); | ||
679 | r->u.target.wwpn = wwpn; | ||
680 | r->u.target.d_id = d_id; | ||
681 | r->u.target.fcp_lun = fcp_lun; | ||
682 | r->u.target.erp_count = atomic_read(erp_count); | ||
683 | debug_event(adapter->rec_dbf, 3, r, sizeof(*r)); | ||
684 | spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); | ||
685 | } | ||
686 | |||
687 | /** | ||
688 | * zfcp_rec_dbf_event_adapter - trace event for adapter state change | ||
689 | * @id: identifier for trigger of state change | ||
690 | * @ref: additional reference (e.g. request) | ||
691 | * @adapter: adapter | ||
692 | */ | ||
693 | void zfcp_rec_dbf_event_adapter(u8 id, u64 ref, struct zfcp_adapter *adapter) | ||
694 | { | ||
695 | zfcp_rec_dbf_event_target(id, ref, adapter, &adapter->status, | ||
696 | &adapter->erp_counter, 0, 0, 0); | ||
697 | } | ||
698 | |||
699 | /** | ||
700 | * zfcp_rec_dbf_event_port - trace event for port state change | ||
701 | * @id: identifier for trigger of state change | ||
702 | * @ref: additional reference (e.g. request) | ||
703 | * @port: port | ||
704 | */ | ||
705 | void zfcp_rec_dbf_event_port(u8 id, u64 ref, struct zfcp_port *port) | ||
706 | { | ||
707 | struct zfcp_adapter *adapter = port->adapter; | ||
708 | |||
709 | zfcp_rec_dbf_event_target(id, ref, adapter, &port->status, | ||
710 | &port->erp_counter, port->wwpn, port->d_id, | ||
711 | 0); | ||
712 | } | ||
713 | |||
714 | /** | ||
715 | * zfcp_rec_dbf_event_unit - trace event for unit state change | ||
716 | * @id: identifier for trigger of state change | ||
717 | * @ref: additional reference (e.g. request) | ||
718 | * @unit: unit | ||
719 | */ | ||
720 | void zfcp_rec_dbf_event_unit(u8 id, u64 ref, struct zfcp_unit *unit) | ||
721 | { | ||
722 | struct zfcp_port *port = unit->port; | ||
723 | struct zfcp_adapter *adapter = port->adapter; | ||
724 | |||
725 | zfcp_rec_dbf_event_target(id, ref, adapter, &unit->status, | ||
726 | &unit->erp_counter, port->wwpn, port->d_id, | ||
727 | unit->fcp_lun); | ||
728 | } | ||
729 | |||
604 | static void | 730 | static void |
605 | _zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req, | 731 | _zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req, |
606 | u32 s_id, u32 d_id, void *buffer, int buflen) | 732 | u32 s_id, u32 d_id, void *buffer, int buflen) |
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 332c83eba6c7..659ec739706a 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -286,16 +286,27 @@ struct zfcp_rec_dbf_record_thread { | |||
286 | u32 running; | 286 | u32 running; |
287 | } __attribute__ ((packed)); | 287 | } __attribute__ ((packed)); |
288 | 288 | ||
289 | struct zfcp_rec_dbf_record_target { | ||
290 | u64 ref; | ||
291 | u32 status; | ||
292 | u32 d_id; | ||
293 | u64 wwpn; | ||
294 | u64 fcp_lun; | ||
295 | u32 erp_count; | ||
296 | } __attribute__ ((packed)); | ||
297 | |||
289 | struct zfcp_rec_dbf_record { | 298 | struct zfcp_rec_dbf_record { |
290 | u8 id; | 299 | u8 id; |
291 | u8 id2; | 300 | u8 id2; |
292 | union { | 301 | union { |
293 | struct zfcp_rec_dbf_record_thread thread; | 302 | struct zfcp_rec_dbf_record_thread thread; |
303 | struct zfcp_rec_dbf_record_target target; | ||
294 | } u; | 304 | } u; |
295 | } __attribute__ ((packed)); | 305 | } __attribute__ ((packed)); |
296 | 306 | ||
297 | enum { | 307 | enum { |
298 | ZFCP_REC_DBF_ID_THREAD, | 308 | ZFCP_REC_DBF_ID_THREAD, |
309 | ZFCP_REC_DBF_ID_TARGET, | ||
299 | }; | 310 | }; |
300 | 311 | ||
301 | struct zfcp_hba_dbf_record_response { | 312 | struct zfcp_hba_dbf_record_response { |
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index f9383f068169..bee03443efd4 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -163,7 +163,7 @@ static void zfcp_close_fsf(struct zfcp_adapter *adapter) | |||
163 | /* reset FSF request sequence number */ | 163 | /* reset FSF request sequence number */ |
164 | adapter->fsf_req_seq_no = 0; | 164 | adapter->fsf_req_seq_no = 0; |
165 | /* all ports and units are closed */ | 165 | /* all ports and units are closed */ |
166 | zfcp_erp_modify_adapter_status(adapter, | 166 | zfcp_erp_modify_adapter_status(adapter, 24, 0, |
167 | ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); | 167 | ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); |
168 | } | 168 | } |
169 | 169 | ||
@@ -216,7 +216,7 @@ zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter, int clear_mask) | |||
216 | zfcp_get_busid_by_adapter(adapter)); | 216 | zfcp_get_busid_by_adapter(adapter)); |
217 | debug_text_event(adapter->erp_dbf, 5, "a_ro_f"); | 217 | debug_text_event(adapter->erp_dbf, 5, "a_ro_f"); |
218 | /* ensure propagation of failed status to new devices */ | 218 | /* ensure propagation of failed status to new devices */ |
219 | zfcp_erp_adapter_failed(adapter); | 219 | zfcp_erp_adapter_failed(adapter, 13, 0); |
220 | retval = -EIO; | 220 | retval = -EIO; |
221 | goto out; | 221 | goto out; |
222 | } | 222 | } |
@@ -572,7 +572,7 @@ zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask) | |||
572 | debug_text_event(adapter->erp_dbf, 5, "p_ro_f"); | 572 | debug_text_event(adapter->erp_dbf, 5, "p_ro_f"); |
573 | debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); | 573 | debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); |
574 | /* ensure propagation of failed status to new devices */ | 574 | /* ensure propagation of failed status to new devices */ |
575 | zfcp_erp_port_failed(port); | 575 | zfcp_erp_port_failed(port, 14, 0); |
576 | retval = -EIO; | 576 | retval = -EIO; |
577 | goto out; | 577 | goto out; |
578 | } | 578 | } |
@@ -688,18 +688,44 @@ zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear_mask) | |||
688 | static void zfcp_erp_adapter_block(struct zfcp_adapter *adapter, int clear_mask) | 688 | static void zfcp_erp_adapter_block(struct zfcp_adapter *adapter, int clear_mask) |
689 | { | 689 | { |
690 | debug_text_event(adapter->erp_dbf, 6, "a_bl"); | 690 | debug_text_event(adapter->erp_dbf, 6, "a_bl"); |
691 | zfcp_erp_modify_adapter_status(adapter, | 691 | zfcp_erp_modify_adapter_status(adapter, 15, 0, |
692 | ZFCP_STATUS_COMMON_UNBLOCKED | | 692 | ZFCP_STATUS_COMMON_UNBLOCKED | |
693 | clear_mask, ZFCP_CLEAR); | 693 | clear_mask, ZFCP_CLEAR); |
694 | } | 694 | } |
695 | 695 | ||
696 | /* FIXME: isn't really atomic */ | ||
697 | /* | ||
698 | * returns the mask which has not been set so far, i.e. | ||
699 | * 0 if no bit has been changed, !0 if some bit has been changed | ||
700 | */ | ||
701 | static int atomic_test_and_set_mask(unsigned long mask, atomic_t *v) | ||
702 | { | ||
703 | int changed_bits = (atomic_read(v) /*XOR*/^ mask) & mask; | ||
704 | atomic_set_mask(mask, v); | ||
705 | return changed_bits; | ||
706 | } | ||
707 | |||
708 | /* FIXME: isn't really atomic */ | ||
709 | /* | ||
710 | * returns the mask which has not been cleared so far, i.e. | ||
711 | * 0 if no bit has been changed, !0 if some bit has been changed | ||
712 | */ | ||
713 | static int atomic_test_and_clear_mask(unsigned long mask, atomic_t *v) | ||
714 | { | ||
715 | int changed_bits = atomic_read(v) & mask; | ||
716 | atomic_clear_mask(mask, v); | ||
717 | return changed_bits; | ||
718 | } | ||
719 | |||
696 | /** | 720 | /** |
697 | * zfcp_erp_adapter_unblock - mark adapter as unblocked, allow scsi requests | 721 | * zfcp_erp_adapter_unblock - mark adapter as unblocked, allow scsi requests |
698 | */ | 722 | */ |
699 | static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter) | 723 | static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter) |
700 | { | 724 | { |
701 | debug_text_event(adapter->erp_dbf, 6, "a_ubl"); | 725 | debug_text_event(adapter->erp_dbf, 6, "a_ubl"); |
702 | atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status); | 726 | if (atomic_test_and_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, |
727 | &adapter->status)) | ||
728 | zfcp_rec_dbf_event_adapter(16, 0, adapter); | ||
703 | } | 729 | } |
704 | 730 | ||
705 | /* | 731 | /* |
@@ -718,7 +744,7 @@ zfcp_erp_port_block(struct zfcp_port *port, int clear_mask) | |||
718 | 744 | ||
719 | debug_text_event(adapter->erp_dbf, 6, "p_bl"); | 745 | debug_text_event(adapter->erp_dbf, 6, "p_bl"); |
720 | debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t)); | 746 | debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t)); |
721 | zfcp_erp_modify_port_status(port, | 747 | zfcp_erp_modify_port_status(port, 17, 0, |
722 | ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, | 748 | ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, |
723 | ZFCP_CLEAR); | 749 | ZFCP_CLEAR); |
724 | } | 750 | } |
@@ -737,7 +763,9 @@ zfcp_erp_port_unblock(struct zfcp_port *port) | |||
737 | 763 | ||
738 | debug_text_event(adapter->erp_dbf, 6, "p_ubl"); | 764 | debug_text_event(adapter->erp_dbf, 6, "p_ubl"); |
739 | debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t)); | 765 | debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t)); |
740 | atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status); | 766 | if (atomic_test_and_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, |
767 | &port->status)) | ||
768 | zfcp_rec_dbf_event_port(18, 0, port); | ||
741 | } | 769 | } |
742 | 770 | ||
743 | /* | 771 | /* |
@@ -756,7 +784,7 @@ zfcp_erp_unit_block(struct zfcp_unit *unit, int clear_mask) | |||
756 | 784 | ||
757 | debug_text_event(adapter->erp_dbf, 6, "u_bl"); | 785 | debug_text_event(adapter->erp_dbf, 6, "u_bl"); |
758 | debug_event(adapter->erp_dbf, 6, &unit->fcp_lun, sizeof (fcp_lun_t)); | 786 | debug_event(adapter->erp_dbf, 6, &unit->fcp_lun, sizeof (fcp_lun_t)); |
759 | zfcp_erp_modify_unit_status(unit, | 787 | zfcp_erp_modify_unit_status(unit, 19, 0, |
760 | ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, | 788 | ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, |
761 | ZFCP_CLEAR); | 789 | ZFCP_CLEAR); |
762 | } | 790 | } |
@@ -775,7 +803,9 @@ zfcp_erp_unit_unblock(struct zfcp_unit *unit) | |||
775 | 803 | ||
776 | debug_text_event(adapter->erp_dbf, 6, "u_ubl"); | 804 | debug_text_event(adapter->erp_dbf, 6, "u_ubl"); |
777 | debug_event(adapter->erp_dbf, 6, &unit->fcp_lun, sizeof (fcp_lun_t)); | 805 | debug_event(adapter->erp_dbf, 6, &unit->fcp_lun, sizeof (fcp_lun_t)); |
778 | atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status); | 806 | if (atomic_test_and_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, |
807 | &unit->status)) | ||
808 | zfcp_rec_dbf_event_unit(20, 0, unit); | ||
779 | } | 809 | } |
780 | 810 | ||
781 | static void | 811 | static void |
@@ -1357,9 +1387,9 @@ zfcp_erp_strategy_memwait(struct zfcp_erp_action *erp_action) | |||
1357 | * | 1387 | * |
1358 | */ | 1388 | */ |
1359 | void | 1389 | void |
1360 | zfcp_erp_adapter_failed(struct zfcp_adapter *adapter) | 1390 | zfcp_erp_adapter_failed(struct zfcp_adapter *adapter, u8 id, u64 ref) |
1361 | { | 1391 | { |
1362 | zfcp_erp_modify_adapter_status(adapter, | 1392 | zfcp_erp_modify_adapter_status(adapter, id, ref, |
1363 | ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); | 1393 | ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); |
1364 | ZFCP_LOG_NORMAL("adapter erp failed on adapter %s\n", | 1394 | ZFCP_LOG_NORMAL("adapter erp failed on adapter %s\n", |
1365 | zfcp_get_busid_by_adapter(adapter)); | 1395 | zfcp_get_busid_by_adapter(adapter)); |
@@ -1373,9 +1403,9 @@ zfcp_erp_adapter_failed(struct zfcp_adapter *adapter) | |||
1373 | * | 1403 | * |
1374 | */ | 1404 | */ |
1375 | void | 1405 | void |
1376 | zfcp_erp_port_failed(struct zfcp_port *port) | 1406 | zfcp_erp_port_failed(struct zfcp_port *port, u8 id, u64 ref) |
1377 | { | 1407 | { |
1378 | zfcp_erp_modify_port_status(port, | 1408 | zfcp_erp_modify_port_status(port, id, ref, |
1379 | ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); | 1409 | ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); |
1380 | 1410 | ||
1381 | if (atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status)) | 1411 | if (atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status)) |
@@ -1397,9 +1427,9 @@ zfcp_erp_port_failed(struct zfcp_port *port) | |||
1397 | * | 1427 | * |
1398 | */ | 1428 | */ |
1399 | void | 1429 | void |
1400 | zfcp_erp_unit_failed(struct zfcp_unit *unit) | 1430 | zfcp_erp_unit_failed(struct zfcp_unit *unit, u8 id, u64 ref) |
1401 | { | 1431 | { |
1402 | zfcp_erp_modify_unit_status(unit, | 1432 | zfcp_erp_modify_unit_status(unit, id, ref, |
1403 | ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); | 1433 | ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); |
1404 | 1434 | ||
1405 | ZFCP_LOG_NORMAL("unit erp failed on unit 0x%016Lx on port 0x%016Lx " | 1435 | ZFCP_LOG_NORMAL("unit erp failed on unit 0x%016Lx on port 0x%016Lx " |
@@ -1522,7 +1552,7 @@ zfcp_erp_strategy_check_unit(struct zfcp_unit *unit, int result) | |||
1522 | case ZFCP_ERP_FAILED : | 1552 | case ZFCP_ERP_FAILED : |
1523 | atomic_inc(&unit->erp_counter); | 1553 | atomic_inc(&unit->erp_counter); |
1524 | if (atomic_read(&unit->erp_counter) > ZFCP_MAX_ERPS) | 1554 | if (atomic_read(&unit->erp_counter) > ZFCP_MAX_ERPS) |
1525 | zfcp_erp_unit_failed(unit); | 1555 | zfcp_erp_unit_failed(unit, 21, 0); |
1526 | break; | 1556 | break; |
1527 | case ZFCP_ERP_EXIT : | 1557 | case ZFCP_ERP_EXIT : |
1528 | /* nothing */ | 1558 | /* nothing */ |
@@ -1551,7 +1581,7 @@ zfcp_erp_strategy_check_port(struct zfcp_port *port, int result) | |||
1551 | case ZFCP_ERP_FAILED : | 1581 | case ZFCP_ERP_FAILED : |
1552 | atomic_inc(&port->erp_counter); | 1582 | atomic_inc(&port->erp_counter); |
1553 | if (atomic_read(&port->erp_counter) > ZFCP_MAX_ERPS) | 1583 | if (atomic_read(&port->erp_counter) > ZFCP_MAX_ERPS) |
1554 | zfcp_erp_port_failed(port); | 1584 | zfcp_erp_port_failed(port, 22, 0); |
1555 | break; | 1585 | break; |
1556 | case ZFCP_ERP_EXIT : | 1586 | case ZFCP_ERP_EXIT : |
1557 | /* nothing */ | 1587 | /* nothing */ |
@@ -1579,7 +1609,7 @@ zfcp_erp_strategy_check_adapter(struct zfcp_adapter *adapter, int result) | |||
1579 | case ZFCP_ERP_FAILED : | 1609 | case ZFCP_ERP_FAILED : |
1580 | atomic_inc(&adapter->erp_counter); | 1610 | atomic_inc(&adapter->erp_counter); |
1581 | if (atomic_read(&adapter->erp_counter) > ZFCP_MAX_ERPS) | 1611 | if (atomic_read(&adapter->erp_counter) > ZFCP_MAX_ERPS) |
1582 | zfcp_erp_adapter_failed(adapter); | 1612 | zfcp_erp_adapter_failed(adapter, 23, 0); |
1583 | break; | 1613 | break; |
1584 | case ZFCP_ERP_EXIT : | 1614 | case ZFCP_ERP_EXIT : |
1585 | /* nothing */ | 1615 | /* nothing */ |
@@ -1737,29 +1767,30 @@ zfcp_erp_wait(struct zfcp_adapter *adapter) | |||
1737 | return retval; | 1767 | return retval; |
1738 | } | 1768 | } |
1739 | 1769 | ||
1740 | void | 1770 | void zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, u8 id, |
1741 | zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, | 1771 | u64 ref, u32 mask, int set_or_clear) |
1742 | u32 mask, int set_or_clear) | ||
1743 | { | 1772 | { |
1744 | struct zfcp_port *port; | 1773 | struct zfcp_port *port; |
1745 | u32 common_mask = mask & ZFCP_COMMON_FLAGS; | 1774 | u32 changed, common_mask = mask & ZFCP_COMMON_FLAGS; |
1746 | 1775 | ||
1747 | if (set_or_clear == ZFCP_SET) { | 1776 | if (set_or_clear == ZFCP_SET) { |
1748 | atomic_set_mask(mask, &adapter->status); | 1777 | changed = atomic_test_and_set_mask(mask, &adapter->status); |
1749 | debug_text_event(adapter->erp_dbf, 3, "a_mod_as_s"); | 1778 | debug_text_event(adapter->erp_dbf, 3, "a_mod_as_s"); |
1750 | } else { | 1779 | } else { |
1751 | atomic_clear_mask(mask, &adapter->status); | 1780 | changed = atomic_test_and_clear_mask(mask, &adapter->status); |
1752 | if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) | 1781 | if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) |
1753 | atomic_set(&adapter->erp_counter, 0); | 1782 | atomic_set(&adapter->erp_counter, 0); |
1754 | debug_text_event(adapter->erp_dbf, 3, "a_mod_as_c"); | 1783 | debug_text_event(adapter->erp_dbf, 3, "a_mod_as_c"); |
1755 | } | 1784 | } |
1785 | if (changed) | ||
1786 | zfcp_rec_dbf_event_adapter(id, ref, adapter); | ||
1756 | debug_event(adapter->erp_dbf, 3, &mask, sizeof (u32)); | 1787 | debug_event(adapter->erp_dbf, 3, &mask, sizeof (u32)); |
1757 | 1788 | ||
1758 | /* Deal with all underlying devices, only pass common_mask */ | 1789 | /* Deal with all underlying devices, only pass common_mask */ |
1759 | if (common_mask) | 1790 | if (common_mask) |
1760 | list_for_each_entry(port, &adapter->port_list_head, list) | 1791 | list_for_each_entry(port, &adapter->port_list_head, list) |
1761 | zfcp_erp_modify_port_status(port, common_mask, | 1792 | zfcp_erp_modify_port_status(port, id, ref, common_mask, |
1762 | set_or_clear); | 1793 | set_or_clear); |
1763 | } | 1794 | } |
1764 | 1795 | ||
1765 | /* | 1796 | /* |
@@ -1768,29 +1799,31 @@ zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, | |||
1768 | * purpose: sets the port and all underlying devices to ERP_FAILED | 1799 | * purpose: sets the port and all underlying devices to ERP_FAILED |
1769 | * | 1800 | * |
1770 | */ | 1801 | */ |
1771 | void | 1802 | void zfcp_erp_modify_port_status(struct zfcp_port *port, u8 id, u64 ref, |
1772 | zfcp_erp_modify_port_status(struct zfcp_port *port, u32 mask, int set_or_clear) | 1803 | u32 mask, int set_or_clear) |
1773 | { | 1804 | { |
1774 | struct zfcp_unit *unit; | 1805 | struct zfcp_unit *unit; |
1775 | u32 common_mask = mask & ZFCP_COMMON_FLAGS; | 1806 | u32 changed, common_mask = mask & ZFCP_COMMON_FLAGS; |
1776 | 1807 | ||
1777 | if (set_or_clear == ZFCP_SET) { | 1808 | if (set_or_clear == ZFCP_SET) { |
1778 | atomic_set_mask(mask, &port->status); | 1809 | changed = atomic_test_and_set_mask(mask, &port->status); |
1779 | debug_text_event(port->adapter->erp_dbf, 3, "p_mod_ps_s"); | 1810 | debug_text_event(port->adapter->erp_dbf, 3, "p_mod_ps_s"); |
1780 | } else { | 1811 | } else { |
1781 | atomic_clear_mask(mask, &port->status); | 1812 | changed = atomic_test_and_clear_mask(mask, &port->status); |
1782 | if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) | 1813 | if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) |
1783 | atomic_set(&port->erp_counter, 0); | 1814 | atomic_set(&port->erp_counter, 0); |
1784 | debug_text_event(port->adapter->erp_dbf, 3, "p_mod_ps_c"); | 1815 | debug_text_event(port->adapter->erp_dbf, 3, "p_mod_ps_c"); |
1785 | } | 1816 | } |
1817 | if (changed) | ||
1818 | zfcp_rec_dbf_event_port(id, ref, port); | ||
1786 | debug_event(port->adapter->erp_dbf, 3, &port->wwpn, sizeof (wwn_t)); | 1819 | debug_event(port->adapter->erp_dbf, 3, &port->wwpn, sizeof (wwn_t)); |
1787 | debug_event(port->adapter->erp_dbf, 3, &mask, sizeof (u32)); | 1820 | debug_event(port->adapter->erp_dbf, 3, &mask, sizeof (u32)); |
1788 | 1821 | ||
1789 | /* Modify status of all underlying devices, only pass common mask */ | 1822 | /* Modify status of all underlying devices, only pass common mask */ |
1790 | if (common_mask) | 1823 | if (common_mask) |
1791 | list_for_each_entry(unit, &port->unit_list_head, list) | 1824 | list_for_each_entry(unit, &port->unit_list_head, list) |
1792 | zfcp_erp_modify_unit_status(unit, common_mask, | 1825 | zfcp_erp_modify_unit_status(unit, id, ref, common_mask, |
1793 | set_or_clear); | 1826 | set_or_clear); |
1794 | } | 1827 | } |
1795 | 1828 | ||
1796 | /* | 1829 | /* |
@@ -1799,19 +1832,23 @@ zfcp_erp_modify_port_status(struct zfcp_port *port, u32 mask, int set_or_clear) | |||
1799 | * purpose: sets the unit to ERP_FAILED | 1832 | * purpose: sets the unit to ERP_FAILED |
1800 | * | 1833 | * |
1801 | */ | 1834 | */ |
1802 | void | 1835 | void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, u8 id, u64 ref, |
1803 | zfcp_erp_modify_unit_status(struct zfcp_unit *unit, u32 mask, int set_or_clear) | 1836 | u32 mask, int set_or_clear) |
1804 | { | 1837 | { |
1838 | u32 changed; | ||
1839 | |||
1805 | if (set_or_clear == ZFCP_SET) { | 1840 | if (set_or_clear == ZFCP_SET) { |
1806 | atomic_set_mask(mask, &unit->status); | 1841 | changed = atomic_test_and_set_mask(mask, &unit->status); |
1807 | debug_text_event(unit->port->adapter->erp_dbf, 3, "u_mod_us_s"); | 1842 | debug_text_event(unit->port->adapter->erp_dbf, 3, "u_mod_us_s"); |
1808 | } else { | 1843 | } else { |
1809 | atomic_clear_mask(mask, &unit->status); | 1844 | changed = atomic_test_and_clear_mask(mask, &unit->status); |
1810 | if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) { | 1845 | if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) { |
1811 | atomic_set(&unit->erp_counter, 0); | 1846 | atomic_set(&unit->erp_counter, 0); |
1812 | } | 1847 | } |
1813 | debug_text_event(unit->port->adapter->erp_dbf, 3, "u_mod_us_c"); | 1848 | debug_text_event(unit->port->adapter->erp_dbf, 3, "u_mod_us_c"); |
1814 | } | 1849 | } |
1850 | if (changed) | ||
1851 | zfcp_rec_dbf_event_unit(id, ref, unit); | ||
1815 | debug_event(unit->port->adapter->erp_dbf, 3, &unit->fcp_lun, | 1852 | debug_event(unit->port->adapter->erp_dbf, 3, &unit->fcp_lun, |
1816 | sizeof (fcp_lun_t)); | 1853 | sizeof (fcp_lun_t)); |
1817 | debug_event(unit->port->adapter->erp_dbf, 3, &mask, sizeof (u32)); | 1854 | debug_event(unit->port->adapter->erp_dbf, 3, &mask, sizeof (u32)); |
@@ -2403,7 +2440,7 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) | |||
2403 | port->wwpn, | 2440 | port->wwpn, |
2404 | zfcp_get_busid_by_adapter(adapter), | 2441 | zfcp_get_busid_by_adapter(adapter), |
2405 | adapter->peer_wwpn); | 2442 | adapter->peer_wwpn); |
2406 | zfcp_erp_port_failed(port); | 2443 | zfcp_erp_port_failed(port, 25, 0); |
2407 | retval = ZFCP_ERP_FAILED; | 2444 | retval = ZFCP_ERP_FAILED; |
2408 | break; | 2445 | break; |
2409 | } | 2446 | } |
@@ -2461,7 +2498,7 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) | |||
2461 | "for port 0x%016Lx " | 2498 | "for port 0x%016Lx " |
2462 | "(misconfigured WWPN?)\n", | 2499 | "(misconfigured WWPN?)\n", |
2463 | port->wwpn); | 2500 | port->wwpn); |
2464 | zfcp_erp_port_failed(port); | 2501 | zfcp_erp_port_failed(port, 26, 0); |
2465 | retval = ZFCP_ERP_EXIT; | 2502 | retval = ZFCP_ERP_EXIT; |
2466 | } else { | 2503 | } else { |
2467 | ZFCP_LOG_DEBUG("nameserver look-up failed for " | 2504 | ZFCP_LOG_DEBUG("nameserver look-up failed for " |
@@ -2567,7 +2604,7 @@ zfcp_erp_port_strategy_open_nameserver_wakeup(struct zfcp_erp_action | |||
2567 | if (atomic_test_mask( | 2604 | if (atomic_test_mask( |
2568 | ZFCP_STATUS_COMMON_ERP_FAILED, | 2605 | ZFCP_STATUS_COMMON_ERP_FAILED, |
2569 | &adapter->nameserver_port->status)) | 2606 | &adapter->nameserver_port->status)) |
2570 | zfcp_erp_port_failed(erp_action->port); | 2607 | zfcp_erp_port_failed(erp_action->port, 27, 0); |
2571 | zfcp_erp_action_ready(erp_action); | 2608 | zfcp_erp_action_ready(erp_action); |
2572 | } | 2609 | } |
2573 | } | 2610 | } |
@@ -3274,8 +3311,7 @@ static void zfcp_erp_action_to_ready(struct zfcp_erp_action *erp_action) | |||
3274 | list_move(&erp_action->list, &erp_action->adapter->erp_ready_head); | 3311 | list_move(&erp_action->list, &erp_action->adapter->erp_ready_head); |
3275 | } | 3312 | } |
3276 | 3313 | ||
3277 | void | 3314 | void zfcp_erp_port_boxed(struct zfcp_port *port, u8 id, u64 ref) |
3278 | zfcp_erp_port_boxed(struct zfcp_port *port) | ||
3279 | { | 3315 | { |
3280 | struct zfcp_adapter *adapter = port->adapter; | 3316 | struct zfcp_adapter *adapter = port->adapter; |
3281 | unsigned long flags; | 3317 | unsigned long flags; |
@@ -3283,28 +3319,24 @@ zfcp_erp_port_boxed(struct zfcp_port *port) | |||
3283 | debug_text_event(adapter->erp_dbf, 3, "p_access_boxed"); | 3319 | debug_text_event(adapter->erp_dbf, 3, "p_access_boxed"); |
3284 | debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); | 3320 | debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); |
3285 | read_lock_irqsave(&zfcp_data.config_lock, flags); | 3321 | read_lock_irqsave(&zfcp_data.config_lock, flags); |
3286 | zfcp_erp_modify_port_status(port, | 3322 | zfcp_erp_modify_port_status(port, id, ref, |
3287 | ZFCP_STATUS_COMMON_ACCESS_BOXED, | 3323 | ZFCP_STATUS_COMMON_ACCESS_BOXED, ZFCP_SET); |
3288 | ZFCP_SET); | ||
3289 | read_unlock_irqrestore(&zfcp_data.config_lock, flags); | 3324 | read_unlock_irqrestore(&zfcp_data.config_lock, flags); |
3290 | zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED); | 3325 | zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED); |
3291 | } | 3326 | } |
3292 | 3327 | ||
3293 | void | 3328 | void zfcp_erp_unit_boxed(struct zfcp_unit *unit, u8 id, u64 ref) |
3294 | zfcp_erp_unit_boxed(struct zfcp_unit *unit) | ||
3295 | { | 3329 | { |
3296 | struct zfcp_adapter *adapter = unit->port->adapter; | 3330 | struct zfcp_adapter *adapter = unit->port->adapter; |
3297 | 3331 | ||
3298 | debug_text_event(adapter->erp_dbf, 3, "u_access_boxed"); | 3332 | debug_text_event(adapter->erp_dbf, 3, "u_access_boxed"); |
3299 | debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); | 3333 | debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); |
3300 | zfcp_erp_modify_unit_status(unit, | 3334 | zfcp_erp_modify_unit_status(unit, id, ref, |
3301 | ZFCP_STATUS_COMMON_ACCESS_BOXED, | 3335 | ZFCP_STATUS_COMMON_ACCESS_BOXED, ZFCP_SET); |
3302 | ZFCP_SET); | ||
3303 | zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED); | 3336 | zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED); |
3304 | } | 3337 | } |
3305 | 3338 | ||
3306 | void | 3339 | void zfcp_erp_port_access_denied(struct zfcp_port *port, u8 id, u64 ref) |
3307 | zfcp_erp_port_access_denied(struct zfcp_port *port) | ||
3308 | { | 3340 | { |
3309 | struct zfcp_adapter *adapter = port->adapter; | 3341 | struct zfcp_adapter *adapter = port->adapter; |
3310 | unsigned long flags; | 3342 | unsigned long flags; |
@@ -3312,24 +3344,21 @@ zfcp_erp_port_access_denied(struct zfcp_port *port) | |||
3312 | debug_text_event(adapter->erp_dbf, 3, "p_access_denied"); | 3344 | debug_text_event(adapter->erp_dbf, 3, "p_access_denied"); |
3313 | debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); | 3345 | debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); |
3314 | read_lock_irqsave(&zfcp_data.config_lock, flags); | 3346 | read_lock_irqsave(&zfcp_data.config_lock, flags); |
3315 | zfcp_erp_modify_port_status(port, | 3347 | zfcp_erp_modify_port_status(port, id, ref, |
3316 | ZFCP_STATUS_COMMON_ERP_FAILED | | 3348 | ZFCP_STATUS_COMMON_ERP_FAILED | |
3317 | ZFCP_STATUS_COMMON_ACCESS_DENIED, | 3349 | ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); |
3318 | ZFCP_SET); | ||
3319 | read_unlock_irqrestore(&zfcp_data.config_lock, flags); | 3350 | read_unlock_irqrestore(&zfcp_data.config_lock, flags); |
3320 | } | 3351 | } |
3321 | 3352 | ||
3322 | void | 3353 | void zfcp_erp_unit_access_denied(struct zfcp_unit *unit, u8 id, u64 ref) |
3323 | zfcp_erp_unit_access_denied(struct zfcp_unit *unit) | ||
3324 | { | 3354 | { |
3325 | struct zfcp_adapter *adapter = unit->port->adapter; | 3355 | struct zfcp_adapter *adapter = unit->port->adapter; |
3326 | 3356 | ||
3327 | debug_text_event(adapter->erp_dbf, 3, "u_access_denied"); | 3357 | debug_text_event(adapter->erp_dbf, 3, "u_access_denied"); |
3328 | debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); | 3358 | debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); |
3329 | zfcp_erp_modify_unit_status(unit, | 3359 | zfcp_erp_modify_unit_status(unit, id, ref, |
3330 | ZFCP_STATUS_COMMON_ERP_FAILED | | 3360 | ZFCP_STATUS_COMMON_ERP_FAILED | |
3331 | ZFCP_STATUS_COMMON_ACCESS_DENIED, | 3361 | ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); |
3332 | ZFCP_SET); | ||
3333 | } | 3362 | } |
3334 | 3363 | ||
3335 | void | 3364 | void |
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index f64951ba98c7..20ad6fde2e22 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h | |||
@@ -131,22 +131,23 @@ extern int zfcp_scsi_command_sync(struct zfcp_unit *, struct scsi_cmnd *, int); | |||
131 | extern struct fc_function_template zfcp_transport_functions; | 131 | extern struct fc_function_template zfcp_transport_functions; |
132 | 132 | ||
133 | /******************************** ERP ****************************************/ | 133 | /******************************** ERP ****************************************/ |
134 | extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, u32, int); | 134 | extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, u8, u64, u32, |
135 | int); | ||
135 | extern int zfcp_erp_adapter_reopen(struct zfcp_adapter *, int); | 136 | extern int zfcp_erp_adapter_reopen(struct zfcp_adapter *, int); |
136 | extern int zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int); | 137 | extern int zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int); |
137 | extern void zfcp_erp_adapter_failed(struct zfcp_adapter *); | 138 | extern void zfcp_erp_adapter_failed(struct zfcp_adapter *, u8, u64); |
138 | 139 | ||
139 | extern void zfcp_erp_modify_port_status(struct zfcp_port *, u32, int); | 140 | extern void zfcp_erp_modify_port_status(struct zfcp_port *, u8, u64, u32, int); |
140 | extern int zfcp_erp_port_reopen(struct zfcp_port *, int); | 141 | extern int zfcp_erp_port_reopen(struct zfcp_port *, int); |
141 | extern int zfcp_erp_port_shutdown(struct zfcp_port *, int); | 142 | extern int zfcp_erp_port_shutdown(struct zfcp_port *, int); |
142 | extern int zfcp_erp_port_forced_reopen(struct zfcp_port *, int); | 143 | extern int zfcp_erp_port_forced_reopen(struct zfcp_port *, int); |
143 | extern void zfcp_erp_port_failed(struct zfcp_port *); | 144 | extern void zfcp_erp_port_failed(struct zfcp_port *, u8, u64); |
144 | extern int zfcp_erp_port_reopen_all(struct zfcp_adapter *, int); | 145 | extern int zfcp_erp_port_reopen_all(struct zfcp_adapter *, int); |
145 | 146 | ||
146 | extern void zfcp_erp_modify_unit_status(struct zfcp_unit *, u32, int); | 147 | extern void zfcp_erp_modify_unit_status(struct zfcp_unit *, u8, u64, u32, int); |
147 | extern int zfcp_erp_unit_reopen(struct zfcp_unit *, int); | 148 | extern int zfcp_erp_unit_reopen(struct zfcp_unit *, int); |
148 | extern int zfcp_erp_unit_shutdown(struct zfcp_unit *, int); | 149 | extern int zfcp_erp_unit_shutdown(struct zfcp_unit *, int); |
149 | extern void zfcp_erp_unit_failed(struct zfcp_unit *); | 150 | extern void zfcp_erp_unit_failed(struct zfcp_unit *, u8, u64); |
150 | 151 | ||
151 | extern int zfcp_erp_thread_setup(struct zfcp_adapter *); | 152 | extern int zfcp_erp_thread_setup(struct zfcp_adapter *); |
152 | extern int zfcp_erp_thread_kill(struct zfcp_adapter *); | 153 | extern int zfcp_erp_thread_kill(struct zfcp_adapter *); |
@@ -155,10 +156,10 @@ extern void zfcp_erp_async_handler(struct zfcp_erp_action *, unsigned long); | |||
155 | 156 | ||
156 | extern int zfcp_test_link(struct zfcp_port *); | 157 | extern int zfcp_test_link(struct zfcp_port *); |
157 | 158 | ||
158 | extern void zfcp_erp_port_boxed(struct zfcp_port *); | 159 | extern void zfcp_erp_port_boxed(struct zfcp_port *, u8 id, u64 ref); |
159 | extern void zfcp_erp_unit_boxed(struct zfcp_unit *); | 160 | extern void zfcp_erp_unit_boxed(struct zfcp_unit *, u8 id, u64 ref); |
160 | extern void zfcp_erp_port_access_denied(struct zfcp_port *); | 161 | extern void zfcp_erp_port_access_denied(struct zfcp_port *, u8 id, u64 ref); |
161 | extern void zfcp_erp_unit_access_denied(struct zfcp_unit *); | 162 | extern void zfcp_erp_unit_access_denied(struct zfcp_unit *, u8 id, u64 ref); |
162 | extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *); | 163 | extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *); |
163 | extern void zfcp_erp_port_access_changed(struct zfcp_port *); | 164 | extern void zfcp_erp_port_access_changed(struct zfcp_port *); |
164 | extern void zfcp_erp_unit_access_changed(struct zfcp_unit *); | 165 | extern void zfcp_erp_unit_access_changed(struct zfcp_unit *); |
@@ -166,6 +167,9 @@ extern void zfcp_erp_unit_access_changed(struct zfcp_unit *); | |||
166 | /******************************** AUX ****************************************/ | 167 | /******************************** AUX ****************************************/ |
167 | extern void zfcp_rec_dbf_event_thread(u8 id, struct zfcp_adapter *adapter, | 168 | extern void zfcp_rec_dbf_event_thread(u8 id, struct zfcp_adapter *adapter, |
168 | int lock); | 169 | int lock); |
170 | extern void zfcp_rec_dbf_event_adapter(u8 id, u64 ref, struct zfcp_adapter *); | ||
171 | extern void zfcp_rec_dbf_event_port(u8 id, u64 ref, struct zfcp_port *port); | ||
172 | extern void zfcp_rec_dbf_event_unit(u8 id, u64 ref, struct zfcp_unit *unit); | ||
169 | 173 | ||
170 | extern void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *); | 174 | extern void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *); |
171 | extern void zfcp_hba_dbf_event_fsf_unsol(const char *, struct zfcp_adapter *, | 175 | extern void zfcp_hba_dbf_event_fsf_unsol(const char *, struct zfcp_adapter *, |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 264f5f1bdde6..2b7ddb78767c 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -46,7 +46,7 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *); | |||
46 | static int zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *); | 46 | static int zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *); |
47 | static int zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *); | 47 | static int zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *); |
48 | static int zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *); | 48 | static int zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *); |
49 | static void zfcp_fsf_link_down_info_eval(struct zfcp_adapter *, | 49 | static void zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *, u8, |
50 | struct fsf_link_down_info *); | 50 | struct fsf_link_down_info *); |
51 | static int zfcp_fsf_req_dispatch(struct zfcp_fsf_req *); | 51 | static int zfcp_fsf_req_dispatch(struct zfcp_fsf_req *); |
52 | 52 | ||
@@ -342,7 +342,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) | |||
342 | break; | 342 | break; |
343 | 343 | ||
344 | case FSF_PROT_LINK_DOWN: | 344 | case FSF_PROT_LINK_DOWN: |
345 | zfcp_fsf_link_down_info_eval(adapter, | 345 | zfcp_fsf_link_down_info_eval(fsf_req, 37, |
346 | &prot_status_qual->link_down_info); | 346 | &prot_status_qual->link_down_info); |
347 | zfcp_erp_adapter_reopen(adapter, 0); | 347 | zfcp_erp_adapter_reopen(adapter, 0); |
348 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 348 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
@@ -354,8 +354,8 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) | |||
354 | "Re-starting operations on this adapter.\n", | 354 | "Re-starting operations on this adapter.\n", |
355 | zfcp_get_busid_by_adapter(adapter)); | 355 | zfcp_get_busid_by_adapter(adapter)); |
356 | /* All ports should be marked as ready to run again */ | 356 | /* All ports should be marked as ready to run again */ |
357 | zfcp_erp_modify_adapter_status(adapter, | 357 | zfcp_erp_modify_adapter_status(adapter, 28, |
358 | ZFCP_STATUS_COMMON_RUNNING, | 358 | 0, ZFCP_STATUS_COMMON_RUNNING, |
359 | ZFCP_SET); | 359 | ZFCP_SET); |
360 | zfcp_erp_adapter_reopen(adapter, | 360 | zfcp_erp_adapter_reopen(adapter, |
361 | ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED | 361 | ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED |
@@ -506,9 +506,11 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req) | |||
506 | * zfcp_fsf_link_down_info_eval - evaluate link down information block | 506 | * zfcp_fsf_link_down_info_eval - evaluate link down information block |
507 | */ | 507 | */ |
508 | static void | 508 | static void |
509 | zfcp_fsf_link_down_info_eval(struct zfcp_adapter *adapter, | 509 | zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *fsf_req, u8 id, |
510 | struct fsf_link_down_info *link_down) | 510 | struct fsf_link_down_info *link_down) |
511 | { | 511 | { |
512 | struct zfcp_adapter *adapter = fsf_req->adapter; | ||
513 | |||
512 | if (atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, | 514 | if (atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, |
513 | &adapter->status)) | 515 | &adapter->status)) |
514 | return; | 516 | return; |
@@ -599,7 +601,7 @@ zfcp_fsf_link_down_info_eval(struct zfcp_adapter *adapter, | |||
599 | link_down->vendor_specific_code); | 601 | link_down->vendor_specific_code); |
600 | 602 | ||
601 | out: | 603 | out: |
602 | zfcp_erp_adapter_failed(adapter); | 604 | zfcp_erp_adapter_failed(adapter, id, (u64)fsf_req); |
603 | } | 605 | } |
604 | 606 | ||
605 | /* | 607 | /* |
@@ -897,7 +899,7 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) | |||
897 | case FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK: | 899 | case FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK: |
898 | ZFCP_LOG_INFO("Physical link to adapter %s is down\n", | 900 | ZFCP_LOG_INFO("Physical link to adapter %s is down\n", |
899 | zfcp_get_busid_by_adapter(adapter)); | 901 | zfcp_get_busid_by_adapter(adapter)); |
900 | zfcp_fsf_link_down_info_eval(adapter, | 902 | zfcp_fsf_link_down_info_eval(fsf_req, 38, |
901 | (struct fsf_link_down_info *) | 903 | (struct fsf_link_down_info *) |
902 | &status_buffer->payload); | 904 | &status_buffer->payload); |
903 | break; | 905 | break; |
@@ -905,7 +907,7 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) | |||
905 | ZFCP_LOG_INFO("Local link to adapter %s is down " | 907 | ZFCP_LOG_INFO("Local link to adapter %s is down " |
906 | "due to failed FDISC login\n", | 908 | "due to failed FDISC login\n", |
907 | zfcp_get_busid_by_adapter(adapter)); | 909 | zfcp_get_busid_by_adapter(adapter)); |
908 | zfcp_fsf_link_down_info_eval(adapter, | 910 | zfcp_fsf_link_down_info_eval(fsf_req, 39, |
909 | (struct fsf_link_down_info *) | 911 | (struct fsf_link_down_info *) |
910 | &status_buffer->payload); | 912 | &status_buffer->payload); |
911 | break; | 913 | break; |
@@ -913,13 +915,13 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) | |||
913 | ZFCP_LOG_INFO("Local link to adapter %s is down " | 915 | ZFCP_LOG_INFO("Local link to adapter %s is down " |
914 | "due to firmware update on adapter\n", | 916 | "due to firmware update on adapter\n", |
915 | zfcp_get_busid_by_adapter(adapter)); | 917 | zfcp_get_busid_by_adapter(adapter)); |
916 | zfcp_fsf_link_down_info_eval(adapter, NULL); | 918 | zfcp_fsf_link_down_info_eval(fsf_req, 40, NULL); |
917 | break; | 919 | break; |
918 | default: | 920 | default: |
919 | ZFCP_LOG_INFO("Local link to adapter %s is down " | 921 | ZFCP_LOG_INFO("Local link to adapter %s is down " |
920 | "due to unknown reason\n", | 922 | "due to unknown reason\n", |
921 | zfcp_get_busid_by_adapter(adapter)); | 923 | zfcp_get_busid_by_adapter(adapter)); |
922 | zfcp_fsf_link_down_info_eval(adapter, NULL); | 924 | zfcp_fsf_link_down_info_eval(fsf_req, 41, NULL); |
923 | }; | 925 | }; |
924 | break; | 926 | break; |
925 | 927 | ||
@@ -928,7 +930,7 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) | |||
928 | "Restarting operations on this adapter\n", | 930 | "Restarting operations on this adapter\n", |
929 | zfcp_get_busid_by_adapter(adapter)); | 931 | zfcp_get_busid_by_adapter(adapter)); |
930 | /* All ports should be marked as ready to run again */ | 932 | /* All ports should be marked as ready to run again */ |
931 | zfcp_erp_modify_adapter_status(adapter, | 933 | zfcp_erp_modify_adapter_status(adapter, 30, 0, |
932 | ZFCP_STATUS_COMMON_RUNNING, | 934 | ZFCP_STATUS_COMMON_RUNNING, |
933 | ZFCP_SET); | 935 | ZFCP_SET); |
934 | zfcp_erp_adapter_reopen(adapter, | 936 | zfcp_erp_adapter_reopen(adapter, |
@@ -1215,7 +1217,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) | |||
1215 | zfcp_get_busid_by_unit(unit)); | 1217 | zfcp_get_busid_by_unit(unit)); |
1216 | debug_text_event(new_fsf_req->adapter->erp_dbf, 2, | 1218 | debug_text_event(new_fsf_req->adapter->erp_dbf, 2, |
1217 | "fsf_s_pboxed"); | 1219 | "fsf_s_pboxed"); |
1218 | zfcp_erp_port_boxed(unit->port); | 1220 | zfcp_erp_port_boxed(unit->port, 47, (u64)new_fsf_req); |
1219 | new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 1221 | new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
1220 | | ZFCP_STATUS_FSFREQ_RETRY; | 1222 | | ZFCP_STATUS_FSFREQ_RETRY; |
1221 | break; | 1223 | break; |
@@ -1227,7 +1229,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) | |||
1227 | unit->fcp_lun, unit->port->wwpn, | 1229 | unit->fcp_lun, unit->port->wwpn, |
1228 | zfcp_get_busid_by_unit(unit)); | 1230 | zfcp_get_busid_by_unit(unit)); |
1229 | debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); | 1231 | debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); |
1230 | zfcp_erp_unit_boxed(unit); | 1232 | zfcp_erp_unit_boxed(unit, 48, (u64)new_fsf_req); |
1231 | new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 1233 | new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
1232 | | ZFCP_STATUS_FSFREQ_RETRY; | 1234 | | ZFCP_STATUS_FSFREQ_RETRY; |
1233 | break; | 1235 | break; |
@@ -1519,7 +1521,7 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) | |||
1519 | } | 1521 | } |
1520 | } | 1522 | } |
1521 | debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); | 1523 | debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); |
1522 | zfcp_erp_port_access_denied(port); | 1524 | zfcp_erp_port_access_denied(port, 55, (u64)fsf_req); |
1523 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 1525 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
1524 | break; | 1526 | break; |
1525 | 1527 | ||
@@ -1554,7 +1556,7 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) | |||
1554 | "(adapter %s, port d_id=0x%06x)\n", | 1556 | "(adapter %s, port d_id=0x%06x)\n", |
1555 | zfcp_get_busid_by_port(port), port->d_id); | 1557 | zfcp_get_busid_by_port(port), port->d_id); |
1556 | debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); | 1558 | debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); |
1557 | zfcp_erp_port_boxed(port); | 1559 | zfcp_erp_port_boxed(port, 49, (u64)fsf_req); |
1558 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 1560 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
1559 | | ZFCP_STATUS_FSFREQ_RETRY; | 1561 | | ZFCP_STATUS_FSFREQ_RETRY; |
1560 | break; | 1562 | break; |
@@ -1880,7 +1882,7 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) | |||
1880 | } | 1882 | } |
1881 | debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); | 1883 | debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); |
1882 | if (port != NULL) | 1884 | if (port != NULL) |
1883 | zfcp_erp_port_access_denied(port); | 1885 | zfcp_erp_port_access_denied(port, 56, (u64)fsf_req); |
1884 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 1886 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
1885 | break; | 1887 | break; |
1886 | 1888 | ||
@@ -2210,7 +2212,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) | |||
2210 | atomic_set_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, | 2212 | atomic_set_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, |
2211 | &adapter->status); | 2213 | &adapter->status); |
2212 | 2214 | ||
2213 | zfcp_fsf_link_down_info_eval(adapter, | 2215 | zfcp_fsf_link_down_info_eval(fsf_req, 42, |
2214 | &qtcb->header.fsf_status_qual.link_down_info); | 2216 | &qtcb->header.fsf_status_qual.link_down_info); |
2215 | break; | 2217 | break; |
2216 | default: | 2218 | default: |
@@ -2393,7 +2395,7 @@ zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req) | |||
2393 | case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: | 2395 | case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: |
2394 | zfcp_fsf_exchange_port_evaluate(fsf_req, 0); | 2396 | zfcp_fsf_exchange_port_evaluate(fsf_req, 0); |
2395 | atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); | 2397 | atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); |
2396 | zfcp_fsf_link_down_info_eval(adapter, | 2398 | zfcp_fsf_link_down_info_eval(fsf_req, 43, |
2397 | &qtcb->header.fsf_status_qual.link_down_info); | 2399 | &qtcb->header.fsf_status_qual.link_down_info); |
2398 | break; | 2400 | break; |
2399 | default: | 2401 | default: |
@@ -2523,7 +2525,7 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) | |||
2523 | } | 2525 | } |
2524 | } | 2526 | } |
2525 | debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_access"); | 2527 | debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_access"); |
2526 | zfcp_erp_port_access_denied(port); | 2528 | zfcp_erp_port_access_denied(port, 57, (u64)fsf_req); |
2527 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 2529 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
2528 | break; | 2530 | break; |
2529 | 2531 | ||
@@ -2534,7 +2536,7 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) | |||
2534 | port->wwpn, zfcp_get_busid_by_port(port)); | 2536 | port->wwpn, zfcp_get_busid_by_port(port)); |
2535 | debug_text_event(fsf_req->adapter->erp_dbf, 1, | 2537 | debug_text_event(fsf_req->adapter->erp_dbf, 1, |
2536 | "fsf_s_max_ports"); | 2538 | "fsf_s_max_ports"); |
2537 | zfcp_erp_port_failed(port); | 2539 | zfcp_erp_port_failed(port, 31, (u64)fsf_req); |
2538 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 2540 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
2539 | break; | 2541 | break; |
2540 | 2542 | ||
@@ -2560,7 +2562,7 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) | |||
2560 | zfcp_get_busid_by_port(port)); | 2562 | zfcp_get_busid_by_port(port)); |
2561 | debug_text_exception(fsf_req->adapter->erp_dbf, 0, | 2563 | debug_text_exception(fsf_req->adapter->erp_dbf, 0, |
2562 | "fsf_sq_no_retry"); | 2564 | "fsf_sq_no_retry"); |
2563 | zfcp_erp_port_failed(port); | 2565 | zfcp_erp_port_failed(port, 32, (u64)fsf_req); |
2564 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 2566 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
2565 | break; | 2567 | break; |
2566 | default: | 2568 | default: |
@@ -2773,7 +2775,7 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req) | |||
2773 | ZFCP_LOG_TRACE("remote port 0x016%Lx on adapter %s closed, " | 2775 | ZFCP_LOG_TRACE("remote port 0x016%Lx on adapter %s closed, " |
2774 | "port handle 0x%x\n", port->wwpn, | 2776 | "port handle 0x%x\n", port->wwpn, |
2775 | zfcp_get_busid_by_port(port), port->handle); | 2777 | zfcp_get_busid_by_port(port), port->handle); |
2776 | zfcp_erp_modify_port_status(port, | 2778 | zfcp_erp_modify_port_status(port, 33, (u64)fsf_req, |
2777 | ZFCP_STATUS_COMMON_OPEN, | 2779 | ZFCP_STATUS_COMMON_OPEN, |
2778 | ZFCP_CLEAR); | 2780 | ZFCP_CLEAR); |
2779 | retval = 0; | 2781 | retval = 0; |
@@ -2923,7 +2925,7 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) | |||
2923 | } | 2925 | } |
2924 | } | 2926 | } |
2925 | debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_access"); | 2927 | debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_access"); |
2926 | zfcp_erp_port_access_denied(port); | 2928 | zfcp_erp_port_access_denied(port, 58, (u64)fsf_req); |
2927 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 2929 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
2928 | break; | 2930 | break; |
2929 | 2931 | ||
@@ -2934,7 +2936,7 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) | |||
2934 | port->wwpn, | 2936 | port->wwpn, |
2935 | zfcp_get_busid_by_port(port)); | 2937 | zfcp_get_busid_by_port(port)); |
2936 | debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_pboxed"); | 2938 | debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_pboxed"); |
2937 | zfcp_erp_port_boxed(port); | 2939 | zfcp_erp_port_boxed(port, 50, (u64)fsf_req); |
2938 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | | 2940 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | |
2939 | ZFCP_STATUS_FSFREQ_RETRY; | 2941 | ZFCP_STATUS_FSFREQ_RETRY; |
2940 | 2942 | ||
@@ -3159,7 +3161,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) | |||
3159 | } | 3161 | } |
3160 | } | 3162 | } |
3161 | debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); | 3163 | debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); |
3162 | zfcp_erp_unit_access_denied(unit); | 3164 | zfcp_erp_unit_access_denied(unit, 59, (u64)fsf_req); |
3163 | atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status); | 3165 | atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status); |
3164 | atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status); | 3166 | atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status); |
3165 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 3167 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
@@ -3170,7 +3172,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) | |||
3170 | "needs to be reopened\n", | 3172 | "needs to be reopened\n", |
3171 | unit->port->wwpn, zfcp_get_busid_by_unit(unit)); | 3173 | unit->port->wwpn, zfcp_get_busid_by_unit(unit)); |
3172 | debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); | 3174 | debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); |
3173 | zfcp_erp_port_boxed(unit->port); | 3175 | zfcp_erp_port_boxed(unit->port, 51, (u64)fsf_req); |
3174 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | | 3176 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | |
3175 | ZFCP_STATUS_FSFREQ_RETRY; | 3177 | ZFCP_STATUS_FSFREQ_RETRY; |
3176 | break; | 3178 | break; |
@@ -3212,7 +3214,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) | |||
3212 | sizeof (union fsf_status_qual)); | 3214 | sizeof (union fsf_status_qual)); |
3213 | debug_text_event(adapter->erp_dbf, 2, | 3215 | debug_text_event(adapter->erp_dbf, 2, |
3214 | "fsf_s_l_sh_vio"); | 3216 | "fsf_s_l_sh_vio"); |
3215 | zfcp_erp_unit_access_denied(unit); | 3217 | zfcp_erp_unit_access_denied(unit, 60, (u64)fsf_req); |
3216 | atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status); | 3218 | atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status); |
3217 | atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status); | 3219 | atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status); |
3218 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 3220 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
@@ -3228,7 +3230,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) | |||
3228 | zfcp_get_busid_by_unit(unit)); | 3230 | zfcp_get_busid_by_unit(unit)); |
3229 | debug_text_event(adapter->erp_dbf, 1, | 3231 | debug_text_event(adapter->erp_dbf, 1, |
3230 | "fsf_s_max_units"); | 3232 | "fsf_s_max_units"); |
3231 | zfcp_erp_unit_failed(unit); | 3233 | zfcp_erp_unit_failed(unit, 34, (u64)fsf_req); |
3232 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 3234 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
3233 | break; | 3235 | break; |
3234 | 3236 | ||
@@ -3307,13 +3309,13 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) | |||
3307 | if (exclusive && !readwrite) { | 3309 | if (exclusive && !readwrite) { |
3308 | ZFCP_LOG_NORMAL("exclusive access of read-only " | 3310 | ZFCP_LOG_NORMAL("exclusive access of read-only " |
3309 | "unit not supported\n"); | 3311 | "unit not supported\n"); |
3310 | zfcp_erp_unit_failed(unit); | 3312 | zfcp_erp_unit_failed(unit, 35, (u64)fsf_req); |
3311 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 3313 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
3312 | zfcp_erp_unit_shutdown(unit, 0); | 3314 | zfcp_erp_unit_shutdown(unit, 0); |
3313 | } else if (!exclusive && readwrite) { | 3315 | } else if (!exclusive && readwrite) { |
3314 | ZFCP_LOG_NORMAL("shared access of read-write " | 3316 | ZFCP_LOG_NORMAL("shared access of read-write " |
3315 | "unit not supported\n"); | 3317 | "unit not supported\n"); |
3316 | zfcp_erp_unit_failed(unit); | 3318 | zfcp_erp_unit_failed(unit, 36, (u64)fsf_req); |
3317 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 3319 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
3318 | zfcp_erp_unit_shutdown(unit, 0); | 3320 | zfcp_erp_unit_shutdown(unit, 0); |
3319 | } | 3321 | } |
@@ -3471,7 +3473,7 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) | |||
3471 | unit->port->wwpn, | 3473 | unit->port->wwpn, |
3472 | zfcp_get_busid_by_unit(unit)); | 3474 | zfcp_get_busid_by_unit(unit)); |
3473 | debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); | 3475 | debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); |
3474 | zfcp_erp_port_boxed(unit->port); | 3476 | zfcp_erp_port_boxed(unit->port, 52, (u64)fsf_req); |
3475 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | | 3477 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | |
3476 | ZFCP_STATUS_FSFREQ_RETRY; | 3478 | ZFCP_STATUS_FSFREQ_RETRY; |
3477 | break; | 3479 | break; |
@@ -3928,7 +3930,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) | |||
3928 | } | 3930 | } |
3929 | } | 3931 | } |
3930 | debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_access"); | 3932 | debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_access"); |
3931 | zfcp_erp_unit_access_denied(unit); | 3933 | zfcp_erp_unit_access_denied(unit, 61, (u64)fsf_req); |
3932 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; | 3934 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; |
3933 | break; | 3935 | break; |
3934 | 3936 | ||
@@ -3967,7 +3969,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) | |||
3967 | "needs to be reopened\n", | 3969 | "needs to be reopened\n", |
3968 | unit->port->wwpn, zfcp_get_busid_by_unit(unit)); | 3970 | unit->port->wwpn, zfcp_get_busid_by_unit(unit)); |
3969 | debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); | 3971 | debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); |
3970 | zfcp_erp_port_boxed(unit->port); | 3972 | zfcp_erp_port_boxed(unit->port, 53, (u64)fsf_req); |
3971 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | | 3973 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | |
3972 | ZFCP_STATUS_FSFREQ_RETRY; | 3974 | ZFCP_STATUS_FSFREQ_RETRY; |
3973 | break; | 3975 | break; |
@@ -3978,7 +3980,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) | |||
3978 | zfcp_get_busid_by_unit(unit), | 3980 | zfcp_get_busid_by_unit(unit), |
3979 | unit->port->wwpn, unit->fcp_lun); | 3981 | unit->port->wwpn, unit->fcp_lun); |
3980 | debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); | 3982 | debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); |
3981 | zfcp_erp_unit_boxed(unit); | 3983 | zfcp_erp_unit_boxed(unit, 54, (u64)fsf_req); |
3982 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 3984 | fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
3983 | | ZFCP_STATUS_FSFREQ_RETRY; | 3985 | | ZFCP_STATUS_FSFREQ_RETRY; |
3984 | break; | 3986 | break; |
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index ff97a61ad964..1198f0b27e3a 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -185,7 +185,7 @@ static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) | |||
185 | atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status); | 185 | atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status); |
186 | sdpnt->hostdata = NULL; | 186 | sdpnt->hostdata = NULL; |
187 | unit->device = NULL; | 187 | unit->device = NULL; |
188 | zfcp_erp_unit_failed(unit); | 188 | zfcp_erp_unit_failed(unit, 12, 0); |
189 | zfcp_unit_put(unit); | 189 | zfcp_unit_put(unit); |
190 | } else | 190 | } else |
191 | ZFCP_LOG_NORMAL("bug: no unit associated with SCSI device at " | 191 | ZFCP_LOG_NORMAL("bug: no unit associated with SCSI device at " |
diff --git a/drivers/s390/scsi/zfcp_sysfs_adapter.c b/drivers/s390/scsi/zfcp_sysfs_adapter.c index 705c6d4428f3..ec340530c824 100644 --- a/drivers/s390/scsi/zfcp_sysfs_adapter.c +++ b/drivers/s390/scsi/zfcp_sysfs_adapter.c | |||
@@ -191,8 +191,8 @@ zfcp_sysfs_adapter_failed_store(struct device *dev, struct device_attribute *att | |||
191 | goto out; | 191 | goto out; |
192 | } | 192 | } |
193 | 193 | ||
194 | zfcp_erp_modify_adapter_status(adapter, ZFCP_STATUS_COMMON_RUNNING, | 194 | zfcp_erp_modify_adapter_status(adapter, 44, 0, |
195 | ZFCP_SET); | 195 | ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); |
196 | zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED); | 196 | zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED); |
197 | zfcp_erp_wait(adapter); | 197 | zfcp_erp_wait(adapter); |
198 | out: | 198 | out: |
diff --git a/drivers/s390/scsi/zfcp_sysfs_port.c b/drivers/s390/scsi/zfcp_sysfs_port.c index 1320c0591431..9cc2bc5be724 100644 --- a/drivers/s390/scsi/zfcp_sysfs_port.c +++ b/drivers/s390/scsi/zfcp_sysfs_port.c | |||
@@ -193,7 +193,8 @@ zfcp_sysfs_port_failed_store(struct device *dev, struct device_attribute *attr, | |||
193 | goto out; | 193 | goto out; |
194 | } | 194 | } |
195 | 195 | ||
196 | zfcp_erp_modify_port_status(port, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); | 196 | zfcp_erp_modify_port_status(port, 45, 0, |
197 | ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); | ||
197 | zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED); | 198 | zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED); |
198 | zfcp_erp_wait(port->adapter); | 199 | zfcp_erp_wait(port->adapter); |
199 | out: | 200 | out: |
diff --git a/drivers/s390/scsi/zfcp_sysfs_unit.c b/drivers/s390/scsi/zfcp_sysfs_unit.c index 63f75ee95c33..52a5f6a25ff9 100644 --- a/drivers/s390/scsi/zfcp_sysfs_unit.c +++ b/drivers/s390/scsi/zfcp_sysfs_unit.c | |||
@@ -94,7 +94,8 @@ zfcp_sysfs_unit_failed_store(struct device *dev, struct device_attribute *attr, | |||
94 | goto out; | 94 | goto out; |
95 | } | 95 | } |
96 | 96 | ||
97 | zfcp_erp_modify_unit_status(unit, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); | 97 | zfcp_erp_modify_unit_status(unit, 46, 0, |
98 | ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); | ||
98 | zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED); | 99 | zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED); |
99 | zfcp_erp_wait(unit->port->adapter); | 100 | zfcp_erp_wait(unit->port->adapter); |
100 | out: | 101 | out: |