aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c2
-rw-r--r--drivers/s390/scsi/zfcp_ccw.c3
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c6
-rw-r--r--drivers/s390/scsi/zfcp_def.h22
-rw-r--r--drivers/s390/scsi/zfcp_erp.c14
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c70
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c24
7 files changed, 72 insertions, 69 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 00118499018b..874b55ed00a3 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -844,8 +844,6 @@ zfcp_unit_enqueue(struct zfcp_port *port, fcp_lun_t fcp_lun)
844 unit->sysfs_device.release = zfcp_sysfs_unit_release; 844 unit->sysfs_device.release = zfcp_sysfs_unit_release;
845 dev_set_drvdata(&unit->sysfs_device, unit); 845 dev_set_drvdata(&unit->sysfs_device, unit);
846 846
847 init_waitqueue_head(&unit->scsi_scan_wq);
848
849 /* mark unit unusable as long as sysfs registration is not complete */ 847 /* mark unit unusable as long as sysfs registration is not complete */
850 atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &unit->status); 848 atomic_set_mask(ZFCP_STATUS_COMMON_REMOVE, &unit->status);
851 849
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c
index 86c3f6539a7d..edc5015e920d 100644
--- a/drivers/s390/scsi/zfcp_ccw.c
+++ b/drivers/s390/scsi/zfcp_ccw.c
@@ -123,6 +123,9 @@ zfcp_ccw_remove(struct ccw_device *ccw_device)
123 123
124 list_for_each_entry_safe(port, p, &adapter->port_remove_lh, list) { 124 list_for_each_entry_safe(port, p, &adapter->port_remove_lh, list) {
125 list_for_each_entry_safe(unit, u, &port->unit_remove_lh, list) { 125 list_for_each_entry_safe(unit, u, &port->unit_remove_lh, list) {
126 if (atomic_test_mask(ZFCP_STATUS_UNIT_REGISTERED,
127 &unit->status))
128 scsi_remove_device(unit->device);
126 zfcp_unit_dequeue(unit); 129 zfcp_unit_dequeue(unit);
127 } 130 }
128 zfcp_port_dequeue(port); 131 zfcp_port_dequeue(port);
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index ffa3bf756943..701046c9bb33 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -161,12 +161,6 @@ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req)
161 (fsf_req->fsf_command == FSF_QTCB_OPEN_LUN)) { 161 (fsf_req->fsf_command == FSF_QTCB_OPEN_LUN)) {
162 strncpy(rec->tag2, "open", ZFCP_DBF_TAG_SIZE); 162 strncpy(rec->tag2, "open", ZFCP_DBF_TAG_SIZE);
163 level = 4; 163 level = 4;
164 } else if ((prot_status_qual->doubleword[0] != 0) ||
165 (prot_status_qual->doubleword[1] != 0) ||
166 (fsf_status_qual->doubleword[0] != 0) ||
167 (fsf_status_qual->doubleword[1] != 0)) {
168 strncpy(rec->tag2, "qual", ZFCP_DBF_TAG_SIZE);
169 level = 3;
170 } else { 164 } else {
171 strncpy(rec->tag2, "norm", ZFCP_DBF_TAG_SIZE); 165 strncpy(rec->tag2, "norm", ZFCP_DBF_TAG_SIZE);
172 level = 6; 166 level = 6;
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index e268f79bdbd2..9e9f6c1e4e5d 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -118,7 +118,7 @@ zfcp_address_to_sg(void *address, struct scatterlist *list, unsigned int size)
118 118
119#define ZFCP_SBAL_TIMEOUT (5*HZ) 119#define ZFCP_SBAL_TIMEOUT (5*HZ)
120 120
121#define ZFCP_TYPE2_RECOVERY_TIME (8*HZ) 121#define ZFCP_TYPE2_RECOVERY_TIME 8 /* seconds */
122 122
123/* queue polling (values in microseconds) */ 123/* queue polling (values in microseconds) */
124#define ZFCP_MAX_INPUT_THRESHOLD 5000 /* FIXME: tune */ 124#define ZFCP_MAX_INPUT_THRESHOLD 5000 /* FIXME: tune */
@@ -139,7 +139,7 @@ zfcp_address_to_sg(void *address, struct scatterlist *list, unsigned int size)
139#define ZFCP_STATUS_READS_RECOM FSF_STATUS_READS_RECOM 139#define ZFCP_STATUS_READS_RECOM FSF_STATUS_READS_RECOM
140 140
141/* Do 1st retry in 1 second, then double the timeout for each following retry */ 141/* Do 1st retry in 1 second, then double the timeout for each following retry */
142#define ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP 100 142#define ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP 1
143#define ZFCP_EXCHANGE_CONFIG_DATA_RETRIES 7 143#define ZFCP_EXCHANGE_CONFIG_DATA_RETRIES 7
144 144
145/* timeout value for "default timer" for fsf requests */ 145/* timeout value for "default timer" for fsf requests */
@@ -983,10 +983,6 @@ struct zfcp_unit {
983 struct scsi_device *device; /* scsi device struct pointer */ 983 struct scsi_device *device; /* scsi device struct pointer */
984 struct zfcp_erp_action erp_action; /* pending error recovery */ 984 struct zfcp_erp_action erp_action; /* pending error recovery */
985 atomic_t erp_counter; 985 atomic_t erp_counter;
986 wait_queue_head_t scsi_scan_wq; /* can be used to wait until
987 all scsi_scan_target
988 requests have been
989 completed. */
990}; 986};
991 987
992/* FSF request */ 988/* FSF request */
@@ -1127,6 +1123,20 @@ zfcp_reqlist_find(struct zfcp_adapter *adapter, unsigned long req_id)
1127 return NULL; 1123 return NULL;
1128} 1124}
1129 1125
1126static inline struct zfcp_fsf_req *
1127zfcp_reqlist_find_safe(struct zfcp_adapter *adapter, struct zfcp_fsf_req *req)
1128{
1129 struct zfcp_fsf_req *request;
1130 unsigned int idx;
1131
1132 for (idx = 0; idx < REQUEST_LIST_SIZE; idx++) {
1133 list_for_each_entry(request, &adapter->req_list[idx], list)
1134 if (request == req)
1135 return request;
1136 }
1137 return NULL;
1138}
1139
1130/* 1140/*
1131 * functions needed for reference/usage counting 1141 * functions needed for reference/usage counting
1132 */ 1142 */
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index 07fa824d179f..4f86c0e12961 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -131,7 +131,7 @@ static void zfcp_close_qdio(struct zfcp_adapter *adapter)
131 debug_text_event(adapter->erp_dbf, 3, "qdio_down2a"); 131 debug_text_event(adapter->erp_dbf, 3, "qdio_down2a");
132 while (qdio_shutdown(adapter->ccw_device, 132 while (qdio_shutdown(adapter->ccw_device,
133 QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS) 133 QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS)
134 msleep(1000); 134 ssleep(1);
135 debug_text_event(adapter->erp_dbf, 3, "qdio_down2b"); 135 debug_text_event(adapter->erp_dbf, 3, "qdio_down2b");
136 136
137 /* cleanup used outbound sbals */ 137 /* cleanup used outbound sbals */
@@ -456,7 +456,7 @@ zfcp_test_link(struct zfcp_port *port)
456 456
457 zfcp_port_get(port); 457 zfcp_port_get(port);
458 retval = zfcp_erp_adisc(port); 458 retval = zfcp_erp_adisc(port);
459 if (retval != 0) { 459 if (retval != 0 && retval != -EBUSY) {
460 zfcp_port_put(port); 460 zfcp_port_put(port);
461 ZFCP_LOG_NORMAL("reopen needed for port 0x%016Lx " 461 ZFCP_LOG_NORMAL("reopen needed for port 0x%016Lx "
462 "on adapter %s\n ", port->wwpn, 462 "on adapter %s\n ", port->wwpn,
@@ -846,7 +846,8 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action)
846 if (erp_action->fsf_req) { 846 if (erp_action->fsf_req) {
847 /* take lock to ensure that request is not deleted meanwhile */ 847 /* take lock to ensure that request is not deleted meanwhile */
848 spin_lock(&adapter->req_list_lock); 848 spin_lock(&adapter->req_list_lock);
849 if (zfcp_reqlist_find(adapter, erp_action->fsf_req->req_id)) { 849 if (zfcp_reqlist_find_safe(adapter, erp_action->fsf_req) &&
850 erp_action->fsf_req->erp_action == erp_action) {
850 /* fsf_req still exists */ 851 /* fsf_req still exists */
851 debug_text_event(adapter->erp_dbf, 3, "a_ca_req"); 852 debug_text_event(adapter->erp_dbf, 3, "a_ca_req");
852 debug_event(adapter->erp_dbf, 3, &erp_action->fsf_req, 853 debug_event(adapter->erp_dbf, 3, &erp_action->fsf_req,
@@ -1609,7 +1610,6 @@ static void zfcp_erp_scsi_scan(struct work_struct *work)
1609 scsi_scan_target(&rport->dev, 0, rport->scsi_target_id, 1610 scsi_scan_target(&rport->dev, 0, rport->scsi_target_id,
1610 unit->scsi_lun, 0); 1611 unit->scsi_lun, 0);
1611 atomic_clear_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status); 1612 atomic_clear_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status);
1612 wake_up(&unit->scsi_scan_wq);
1613 zfcp_unit_put(unit); 1613 zfcp_unit_put(unit);
1614 kfree(p); 1614 kfree(p);
1615} 1615}
@@ -1900,7 +1900,7 @@ zfcp_erp_adapter_strategy(struct zfcp_erp_action *erp_action)
1900 ZFCP_LOG_INFO("Waiting to allow the adapter %s " 1900 ZFCP_LOG_INFO("Waiting to allow the adapter %s "
1901 "to recover itself\n", 1901 "to recover itself\n",
1902 zfcp_get_busid_by_adapter(adapter)); 1902 zfcp_get_busid_by_adapter(adapter));
1903 msleep(jiffies_to_msecs(ZFCP_TYPE2_RECOVERY_TIME)); 1903 ssleep(ZFCP_TYPE2_RECOVERY_TIME);
1904 } 1904 }
1905 1905
1906 return retval; 1906 return retval;
@@ -2080,7 +2080,7 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action)
2080 debug_text_event(adapter->erp_dbf, 3, "qdio_down1a"); 2080 debug_text_event(adapter->erp_dbf, 3, "qdio_down1a");
2081 while (qdio_shutdown(adapter->ccw_device, 2081 while (qdio_shutdown(adapter->ccw_device,
2082 QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS) 2082 QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS)
2083 msleep(1000); 2083 ssleep(1);
2084 debug_text_event(adapter->erp_dbf, 3, "qdio_down1b"); 2084 debug_text_event(adapter->erp_dbf, 3, "qdio_down1b");
2085 2085
2086 failed_qdio_establish: 2086 failed_qdio_establish:
@@ -2165,7 +2165,7 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
2165 ZFCP_LOG_DEBUG("host connection still initialising... " 2165 ZFCP_LOG_DEBUG("host connection still initialising... "
2166 "waiting and retrying...\n"); 2166 "waiting and retrying...\n");
2167 /* sleep a little bit before retry */ 2167 /* sleep a little bit before retry */
2168 msleep(jiffies_to_msecs(sleep)); 2168 ssleep(sleep);
2169 sleep *= 2; 2169 sleep *= 2;
2170 } 2170 }
2171 2171
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index ff866ebd44ac..fe57941ab55d 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -1116,6 +1116,10 @@ zfcp_fsf_abort_fcp_command(unsigned long old_req_id,
1116 goto out; 1116 goto out;
1117 } 1117 }
1118 1118
1119 if (unlikely(!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
1120 &unit->status)))
1121 goto unit_blocked;
1122
1119 sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0); 1123 sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0);
1120 sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; 1124 sbale[0].flags |= SBAL_FLAGS0_TYPE_READ;
1121 sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; 1125 sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY;
@@ -1131,22 +1135,13 @@ zfcp_fsf_abort_fcp_command(unsigned long old_req_id,
1131 1135
1132 zfcp_fsf_start_timer(fsf_req, ZFCP_SCSI_ER_TIMEOUT); 1136 zfcp_fsf_start_timer(fsf_req, ZFCP_SCSI_ER_TIMEOUT);
1133 retval = zfcp_fsf_req_send(fsf_req); 1137 retval = zfcp_fsf_req_send(fsf_req);
1134 if (retval) { 1138 if (!retval)
1135 ZFCP_LOG_INFO("error: Failed to send abort command request " 1139 goto out;
1136 "on adapter %s, port 0x%016Lx, unit 0x%016Lx\n", 1140
1137 zfcp_get_busid_by_adapter(adapter), 1141 unit_blocked:
1138 unit->port->wwpn, unit->fcp_lun);
1139 zfcp_fsf_req_free(fsf_req); 1142 zfcp_fsf_req_free(fsf_req);
1140 fsf_req = NULL; 1143 fsf_req = NULL;
1141 goto out;
1142 }
1143 1144
1144 ZFCP_LOG_DEBUG("Abort FCP Command request initiated "
1145 "(adapter%s, port d_id=0x%06x, "
1146 "unit x%016Lx, old_req_id=0x%lx)\n",
1147 zfcp_get_busid_by_adapter(adapter),
1148 unit->port->d_id,
1149 unit->fcp_lun, old_req_id);
1150 out: 1145 out:
1151 write_unlock_irqrestore(&adapter->request_queue.queue_lock, lock_flags); 1146 write_unlock_irqrestore(&adapter->request_queue.queue_lock, lock_flags);
1152 return fsf_req; 1147 return fsf_req;
@@ -1164,8 +1159,8 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1164{ 1159{
1165 int retval = -EINVAL; 1160 int retval = -EINVAL;
1166 struct zfcp_unit *unit; 1161 struct zfcp_unit *unit;
1167 unsigned char status_qual = 1162 union fsf_status_qual *fsf_stat_qual =
1168 new_fsf_req->qtcb->header.fsf_status_qual.word[0]; 1163 &new_fsf_req->qtcb->header.fsf_status_qual;
1169 1164
1170 if (new_fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) { 1165 if (new_fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) {
1171 /* do not set ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED */ 1166 /* do not set ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED */
@@ -1178,7 +1173,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1178 switch (new_fsf_req->qtcb->header.fsf_status) { 1173 switch (new_fsf_req->qtcb->header.fsf_status) {
1179 1174
1180 case FSF_PORT_HANDLE_NOT_VALID: 1175 case FSF_PORT_HANDLE_NOT_VALID:
1181 if (status_qual >> 4 != status_qual % 0xf) { 1176 if (fsf_stat_qual->word[0] != fsf_stat_qual->word[1]) {
1182 debug_text_event(new_fsf_req->adapter->erp_dbf, 3, 1177 debug_text_event(new_fsf_req->adapter->erp_dbf, 3,
1183 "fsf_s_phand_nv0"); 1178 "fsf_s_phand_nv0");
1184 /* 1179 /*
@@ -1207,8 +1202,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1207 break; 1202 break;
1208 1203
1209 case FSF_LUN_HANDLE_NOT_VALID: 1204 case FSF_LUN_HANDLE_NOT_VALID:
1210 if (status_qual >> 4 != status_qual % 0xf) { 1205 if (fsf_stat_qual->word[0] != fsf_stat_qual->word[1]) {
1211 /* 2 */
1212 debug_text_event(new_fsf_req->adapter->erp_dbf, 3, 1206 debug_text_event(new_fsf_req->adapter->erp_dbf, 3,
1213 "fsf_s_lhand_nv0"); 1207 "fsf_s_lhand_nv0");
1214 /* 1208 /*
@@ -1674,6 +1668,12 @@ zfcp_fsf_send_els(struct zfcp_send_els *els)
1674 goto failed_req; 1668 goto failed_req;
1675 } 1669 }
1676 1670
1671 if (unlikely(!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
1672 &els->port->status))) {
1673 ret = -EBUSY;
1674 goto port_blocked;
1675 }
1676
1677 sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0); 1677 sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0);
1678 if (zfcp_use_one_sbal(els->req, els->req_count, 1678 if (zfcp_use_one_sbal(els->req, els->req_count,
1679 els->resp, els->resp_count)){ 1679 els->resp, els->resp_count)){
@@ -1755,6 +1755,7 @@ zfcp_fsf_send_els(struct zfcp_send_els *els)
1755 "0x%06x)\n", zfcp_get_busid_by_adapter(adapter), d_id); 1755 "0x%06x)\n", zfcp_get_busid_by_adapter(adapter), d_id);
1756 goto out; 1756 goto out;
1757 1757
1758 port_blocked:
1758 failed_send: 1759 failed_send:
1759 zfcp_fsf_req_free(fsf_req); 1760 zfcp_fsf_req_free(fsf_req);
1760 1761
@@ -3592,6 +3593,12 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
3592 goto failed_req_create; 3593 goto failed_req_create;
3593 } 3594 }
3594 3595
3596 if (unlikely(!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
3597 &unit->status))) {
3598 retval = -EBUSY;
3599 goto unit_blocked;
3600 }
3601
3595 zfcp_unit_get(unit); 3602 zfcp_unit_get(unit);
3596 fsf_req->unit = unit; 3603 fsf_req->unit = unit;
3597 3604
@@ -3732,6 +3739,7 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
3732 send_failed: 3739 send_failed:
3733 no_fit: 3740 no_fit:
3734 failed_scsi_cmnd: 3741 failed_scsi_cmnd:
3742 unit_blocked:
3735 zfcp_unit_put(unit); 3743 zfcp_unit_put(unit);
3736 zfcp_fsf_req_free(fsf_req); 3744 zfcp_fsf_req_free(fsf_req);
3737 fsf_req = NULL; 3745 fsf_req = NULL;
@@ -3766,6 +3774,10 @@ zfcp_fsf_send_fcp_command_task_management(struct zfcp_adapter *adapter,
3766 goto out; 3774 goto out;
3767 } 3775 }
3768 3776
3777 if (unlikely(!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
3778 &unit->status)))
3779 goto unit_blocked;
3780
3769 /* 3781 /*
3770 * Used to decide on proper handler in the return path, 3782 * Used to decide on proper handler in the return path,
3771 * could be either zfcp_fsf_send_fcp_command_task_handler or 3783 * could be either zfcp_fsf_send_fcp_command_task_handler or
@@ -3799,25 +3811,13 @@ zfcp_fsf_send_fcp_command_task_management(struct zfcp_adapter *adapter,
3799 3811
3800 zfcp_fsf_start_timer(fsf_req, ZFCP_SCSI_ER_TIMEOUT); 3812 zfcp_fsf_start_timer(fsf_req, ZFCP_SCSI_ER_TIMEOUT);
3801 retval = zfcp_fsf_req_send(fsf_req); 3813 retval = zfcp_fsf_req_send(fsf_req);
3802 if (retval) { 3814 if (!retval)
3803 ZFCP_LOG_INFO("error: Could not send an FCP-command (task "
3804 "management) on adapter %s, port 0x%016Lx for "
3805 "unit LUN 0x%016Lx\n",
3806 zfcp_get_busid_by_adapter(adapter),
3807 unit->port->wwpn,
3808 unit->fcp_lun);
3809 zfcp_fsf_req_free(fsf_req);
3810 fsf_req = NULL;
3811 goto out; 3815 goto out;
3812 }
3813 3816
3814 ZFCP_LOG_TRACE("Send FCP Command (task management function) initiated " 3817 unit_blocked:
3815 "(adapter %s, port 0x%016Lx, unit 0x%016Lx, " 3818 zfcp_fsf_req_free(fsf_req);
3816 "tm_flags=0x%x)\n", 3819 fsf_req = NULL;
3817 zfcp_get_busid_by_adapter(adapter), 3820
3818 unit->port->wwpn,
3819 unit->fcp_lun,
3820 tm_flags);
3821 out: 3821 out:
3822 write_unlock_irqrestore(&adapter->request_queue.queue_lock, lock_flags); 3822 write_unlock_irqrestore(&adapter->request_queue.queue_lock, lock_flags);
3823 return fsf_req; 3823 return fsf_req;
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index abae2027f7e5..b9daf5c05862 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -51,7 +51,6 @@ struct zfcp_data zfcp_data = {
51 .queuecommand = zfcp_scsi_queuecommand, 51 .queuecommand = zfcp_scsi_queuecommand,
52 .eh_abort_handler = zfcp_scsi_eh_abort_handler, 52 .eh_abort_handler = zfcp_scsi_eh_abort_handler,
53 .eh_device_reset_handler = zfcp_scsi_eh_device_reset_handler, 53 .eh_device_reset_handler = zfcp_scsi_eh_device_reset_handler,
54 .eh_bus_reset_handler = zfcp_scsi_eh_host_reset_handler,
55 .eh_host_reset_handler = zfcp_scsi_eh_host_reset_handler, 54 .eh_host_reset_handler = zfcp_scsi_eh_host_reset_handler,
56 .can_queue = 4096, 55 .can_queue = 4096,
57 .this_id = -1, 56 .this_id = -1,
@@ -181,9 +180,6 @@ static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt)
181 180
182 if (unit) { 181 if (unit) {
183 zfcp_erp_wait(unit->port->adapter); 182 zfcp_erp_wait(unit->port->adapter);
184 wait_event(unit->scsi_scan_wq,
185 atomic_test_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING,
186 &unit->status) == 0);
187 atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status); 183 atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status);
188 sdpnt->hostdata = NULL; 184 sdpnt->hostdata = NULL;
189 unit->device = NULL; 185 unit->device = NULL;
@@ -262,8 +258,9 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit,
262 goto out; 258 goto out;
263 } 259 }
264 260
265 if (unlikely( 261 tmp = zfcp_fsf_send_fcp_command_task(adapter, unit, scpnt, use_timer,
266 !atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status))) { 262 ZFCP_REQ_AUTO_CLEANUP);
263 if (unlikely(tmp == -EBUSY)) {
267 ZFCP_LOG_DEBUG("adapter %s not ready or unit 0x%016Lx " 264 ZFCP_LOG_DEBUG("adapter %s not ready or unit 0x%016Lx "
268 "on port 0x%016Lx in recovery\n", 265 "on port 0x%016Lx in recovery\n",
269 zfcp_get_busid_by_unit(unit), 266 zfcp_get_busid_by_unit(unit),
@@ -272,9 +269,6 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit,
272 goto out; 269 goto out;
273 } 270 }
274 271
275 tmp = zfcp_fsf_send_fcp_command_task(adapter, unit, scpnt, use_timer,
276 ZFCP_REQ_AUTO_CLEANUP);
277
278 if (unlikely(tmp < 0)) { 272 if (unlikely(tmp < 0)) {
279 ZFCP_LOG_DEBUG("error: initiation of Send FCP Cmnd failed\n"); 273 ZFCP_LOG_DEBUG("error: initiation of Send FCP Cmnd failed\n");
280 retval = SCSI_MLQUEUE_HOST_BUSY; 274 retval = SCSI_MLQUEUE_HOST_BUSY;
@@ -459,7 +453,9 @@ zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt)
459 retval = SUCCESS; 453 retval = SUCCESS;
460 goto out; 454 goto out;
461 } 455 }
462 ZFCP_LOG_NORMAL("resetting unit 0x%016Lx\n", unit->fcp_lun); 456 ZFCP_LOG_NORMAL("resetting unit 0x%016Lx on port 0x%016Lx, adapter %s\n",
457 unit->fcp_lun, unit->port->wwpn,
458 zfcp_get_busid_by_adapter(unit->port->adapter));
463 459
464 /* 460 /*
465 * If we do not know whether the unit supports 'logical unit reset' 461 * If we do not know whether the unit supports 'logical unit reset'
@@ -542,7 +538,7 @@ zfcp_task_management_function(struct zfcp_unit *unit, u8 tm_flags,
542} 538}
543 539
544/** 540/**
545 * zfcp_scsi_eh_host_reset_handler - handler for host and bus reset 541 * zfcp_scsi_eh_host_reset_handler - handler for host reset
546 */ 542 */
547static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt) 543static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt)
548{ 544{
@@ -552,8 +548,10 @@ static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt)
552 unit = (struct zfcp_unit*) scpnt->device->hostdata; 548 unit = (struct zfcp_unit*) scpnt->device->hostdata;
553 adapter = unit->port->adapter; 549 adapter = unit->port->adapter;
554 550
555 ZFCP_LOG_NORMAL("host/bus reset because of problems with " 551 ZFCP_LOG_NORMAL("host reset because of problems with "
556 "unit 0x%016Lx\n", unit->fcp_lun); 552 "unit 0x%016Lx on port 0x%016Lx, adapter %s\n",
553 unit->fcp_lun, unit->port->wwpn,
554 zfcp_get_busid_by_adapter(unit->port->adapter));
557 555
558 zfcp_erp_adapter_reopen(adapter, 0); 556 zfcp_erp_adapter_reopen(adapter, 0);
559 zfcp_erp_wait(adapter); 557 zfcp_erp_wait(adapter);