diff options
Diffstat (limited to 'drivers/s390/scsi/zfcp_fsf.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 70 |
1 files changed, 35 insertions, 35 deletions
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; |