aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorChristof Schmitt <christof.schmitt@de.ibm.com>2009-11-24 10:54:15 -0500
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:02:16 -0500
commit4c571c659e9d41332b6981ca5379047681ce9d2f (patch)
tree57221fdc1d2e0450dbed56e0255ff1ddf14a861a /drivers/s390
parentee744622c65cd66824e8dd1b9509e515c800de14 (diff)
[SCSI] zfcp: Update FSF error reporting
The SCSI midlayer retries commands based on the remote port state and the command status reported by the driver. Returning DID_TRANSPORT_DISRUPTED is a better approach, use this for reporting FSF errors back to the SCSI midlayer. See http://marc.info/?l=linux-scsi&m=125668044215051&w=2 as reference. There is also no need in special treatment of ABORTED commands, so remove the ZFCP_STATUS_FSFREQ_ABORTED, the commands are then returned with DID_TRANSPORT_DISRUPTED. Also remove the ZFCP_STATUS_FSFREQ_RETRY: It is useless, no retry is happening in the FSF layer and nobody checks the state of this flag. Reviewed-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/scsi/zfcp_def.h2
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c38
2 files changed, 11 insertions, 29 deletions
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 469d57f105db..e43c6334bf69 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -110,10 +110,8 @@
110#define ZFCP_STATUS_FSFREQ_CLEANUP 0x00000010 110#define ZFCP_STATUS_FSFREQ_CLEANUP 0x00000010
111#define ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED 0x00000040 111#define ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED 0x00000040
112#define ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED 0x00000080 112#define ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED 0x00000080
113#define ZFCP_STATUS_FSFREQ_ABORTED 0x00000100
114#define ZFCP_STATUS_FSFREQ_TMFUNCFAILED 0x00000200 113#define ZFCP_STATUS_FSFREQ_TMFUNCFAILED 0x00000200
115#define ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP 0x00000400 114#define ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP 0x00000400
116#define ZFCP_STATUS_FSFREQ_RETRY 0x00000800
117#define ZFCP_STATUS_FSFREQ_DISMISSED 0x00001000 115#define ZFCP_STATUS_FSFREQ_DISMISSED 0x00001000
118 116
119/************************* STRUCTURE DEFINITIONS *****************************/ 117/************************* STRUCTURE DEFINITIONS *****************************/
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index fb580b14a68e..3089a05c36a1 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -315,7 +315,6 @@ static void zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *req)
315 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 315 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
316 return; 316 return;
317 case FSF_SQ_COMMAND_ABORTED: 317 case FSF_SQ_COMMAND_ABORTED:
318 req->status |= ZFCP_STATUS_FSFREQ_ABORTED;
319 break; 318 break;
320 case FSF_SQ_NO_RECOM: 319 case FSF_SQ_NO_RECOM:
321 dev_err(&req->adapter->ccw_device->dev, 320 dev_err(&req->adapter->ccw_device->dev,
@@ -356,8 +355,7 @@ static void zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *req)
356 zfcp_dbf_hba_fsf_response(req); 355 zfcp_dbf_hba_fsf_response(req);
357 356
358 if (req->status & ZFCP_STATUS_FSFREQ_DISMISSED) { 357 if (req->status & ZFCP_STATUS_FSFREQ_DISMISSED) {
359 req->status |= ZFCP_STATUS_FSFREQ_ERROR | 358 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
360 ZFCP_STATUS_FSFREQ_RETRY; /* only for SCSI cmnds. */
361 return; 359 return;
362 } 360 }
363 361
@@ -375,7 +373,7 @@ static void zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *req)
375 case FSF_PROT_ERROR_STATE: 373 case FSF_PROT_ERROR_STATE:
376 case FSF_PROT_SEQ_NUMB_ERROR: 374 case FSF_PROT_SEQ_NUMB_ERROR:
377 zfcp_erp_adapter_reopen(adapter, 0, "fspse_2", req); 375 zfcp_erp_adapter_reopen(adapter, 0, "fspse_2", req);
378 req->status |= ZFCP_STATUS_FSFREQ_RETRY; 376 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
379 break; 377 break;
380 case FSF_PROT_UNSUPP_QTCB_TYPE: 378 case FSF_PROT_UNSUPP_QTCB_TYPE:
381 dev_err(&adapter->ccw_device->dev, 379 dev_err(&adapter->ccw_device->dev,
@@ -884,13 +882,11 @@ static void zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *req)
884 break; 882 break;
885 case FSF_PORT_BOXED: 883 case FSF_PORT_BOXED:
886 zfcp_erp_port_boxed(unit->port, "fsafch3", req); 884 zfcp_erp_port_boxed(unit->port, "fsafch3", req);
887 req->status |= ZFCP_STATUS_FSFREQ_ERROR | 885 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
888 ZFCP_STATUS_FSFREQ_RETRY;
889 break; 886 break;
890 case FSF_LUN_BOXED: 887 case FSF_LUN_BOXED:
891 zfcp_erp_unit_boxed(unit, "fsafch4", req); 888 zfcp_erp_unit_boxed(unit, "fsafch4", req);
892 req->status |= ZFCP_STATUS_FSFREQ_ERROR | 889 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
893 ZFCP_STATUS_FSFREQ_RETRY;
894 break; 890 break;
895 case FSF_ADAPTER_STATUS_AVAILABLE: 891 case FSF_ADAPTER_STATUS_AVAILABLE:
896 switch (fsq->word[0]) { 892 switch (fsq->word[0]) {
@@ -988,8 +984,7 @@ static void zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *req)
988 case FSF_ACCESS_DENIED: 984 case FSF_ACCESS_DENIED:
989 break; 985 break;
990 case FSF_PORT_BOXED: 986 case FSF_PORT_BOXED:
991 req->status |= ZFCP_STATUS_FSFREQ_ERROR | 987 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
992 ZFCP_STATUS_FSFREQ_RETRY;
993 break; 988 break;
994 case FSF_PORT_HANDLE_NOT_VALID: 989 case FSF_PORT_HANDLE_NOT_VALID:
995 zfcp_erp_adapter_reopen(adapter, 0, "fsscth1", req); 990 zfcp_erp_adapter_reopen(adapter, 0, "fsscth1", req);
@@ -1761,9 +1756,7 @@ static void zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *req)
1761 &unit->status); 1756 &unit->status);
1762 read_unlock(&port->unit_list_lock); 1757 read_unlock(&port->unit_list_lock);
1763 zfcp_erp_port_boxed(port, "fscpph2", req); 1758 zfcp_erp_port_boxed(port, "fscpph2", req);
1764 req->status |= ZFCP_STATUS_FSFREQ_ERROR | 1759 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1765 ZFCP_STATUS_FSFREQ_RETRY;
1766
1767 break; 1760 break;
1768 case FSF_ADAPTER_STATUS_AVAILABLE: 1761 case FSF_ADAPTER_STATUS_AVAILABLE:
1769 switch (header->fsf_status_qual.word[0]) { 1762 switch (header->fsf_status_qual.word[0]) {
@@ -1867,8 +1860,7 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req)
1867 break; 1860 break;
1868 case FSF_PORT_BOXED: 1861 case FSF_PORT_BOXED:
1869 zfcp_erp_port_boxed(unit->port, "fsouh_2", req); 1862 zfcp_erp_port_boxed(unit->port, "fsouh_2", req);
1870 req->status |= ZFCP_STATUS_FSFREQ_ERROR | 1863 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1871 ZFCP_STATUS_FSFREQ_RETRY;
1872 break; 1864 break;
1873 case FSF_LUN_SHARING_VIOLATION: 1865 case FSF_LUN_SHARING_VIOLATION:
1874 if (header->fsf_status_qual.word[0]) 1866 if (header->fsf_status_qual.word[0])
@@ -2030,8 +2022,7 @@ static void zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *req)
2030 break; 2022 break;
2031 case FSF_PORT_BOXED: 2023 case FSF_PORT_BOXED:
2032 zfcp_erp_port_boxed(unit->port, "fscuh_3", req); 2024 zfcp_erp_port_boxed(unit->port, "fscuh_3", req);
2033 req->status |= ZFCP_STATUS_FSFREQ_ERROR | 2025 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2034 ZFCP_STATUS_FSFREQ_RETRY;
2035 break; 2026 break;
2036 case FSF_ADAPTER_STATUS_AVAILABLE: 2027 case FSF_ADAPTER_STATUS_AVAILABLE:
2037 switch (req->qtcb->header.fsf_status_qual.word[0]) { 2028 switch (req->qtcb->header.fsf_status_qual.word[0]) {
@@ -2164,13 +2155,8 @@ static void zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *req)
2164 return; 2155 return;
2165 } 2156 }
2166 2157
2167 if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ABORTED)) {
2168 set_host_byte(scpnt, DID_SOFT_ERROR);
2169 goto skip_fsfstatus;
2170 }
2171
2172 if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ERROR)) { 2158 if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ERROR)) {
2173 set_host_byte(scpnt, DID_ERROR); 2159 set_host_byte(scpnt, DID_TRANSPORT_DISRUPTED);
2174 goto skip_fsfstatus; 2160 goto skip_fsfstatus;
2175 } 2161 }
2176 2162
@@ -2266,13 +2252,11 @@ static void zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *req)
2266 break; 2252 break;
2267 case FSF_PORT_BOXED: 2253 case FSF_PORT_BOXED:
2268 zfcp_erp_port_boxed(unit->port, "fssfch5", req); 2254 zfcp_erp_port_boxed(unit->port, "fssfch5", req);
2269 req->status |= ZFCP_STATUS_FSFREQ_ERROR | 2255 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2270 ZFCP_STATUS_FSFREQ_RETRY;
2271 break; 2256 break;
2272 case FSF_LUN_BOXED: 2257 case FSF_LUN_BOXED:
2273 zfcp_erp_unit_boxed(unit, "fssfch6", req); 2258 zfcp_erp_unit_boxed(unit, "fssfch6", req);
2274 req->status |= ZFCP_STATUS_FSFREQ_ERROR | 2259 req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2275 ZFCP_STATUS_FSFREQ_RETRY;
2276 break; 2260 break;
2277 case FSF_ADAPTER_STATUS_AVAILABLE: 2261 case FSF_ADAPTER_STATUS_AVAILABLE:
2278 if (header->fsf_status_qual.word[0] == 2262 if (header->fsf_status_qual.word[0] ==