aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorJames Bottomley <jejb@titanic.(none)>2005-06-17 19:42:23 -0400
committerJames Bottomley <jejb@titanic.(none)>2005-06-17 19:42:23 -0400
commit3237ee78fc00f786d5f5aec6f9310b0e39069f15 (patch)
tree4c94e70ab846ffcb8bb5715fb3c8d8473358a323 /drivers/s390
parent9ee1c939d1cb936b1f98e8d81aeffab57bae46ab (diff)
parentdf0ae2497ddefd72a87f3a3b34ff32455d7d4ae0 (diff)
merge by hand (fix up qla_os.c merge error)
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c37
-rw-r--r--drivers/s390/scsi/zfcp_def.h25
-rw-r--r--drivers/s390/scsi/zfcp_erp.c121
-rw-r--r--drivers/s390/scsi/zfcp_ext.h4
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c324
-rw-r--r--drivers/s390/scsi/zfcp_qdio.c68
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c24
7 files changed, 188 insertions, 415 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 68d151aaa474..e17b4d58a9f6 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -97,11 +97,6 @@ MODULE_PARM_DESC(loglevel,
97 "FC ERP QDIO CIO Config FSF SCSI Other, " 97 "FC ERP QDIO CIO Config FSF SCSI Other, "
98 "levels: 0=none 1=normal 2=devel 3=trace"); 98 "levels: 0=none 1=normal 2=devel 3=trace");
99 99
100#ifdef ZFCP_PRINT_FLAGS
101u32 flags_dump = 0;
102module_param(flags_dump, uint, 0);
103#endif
104
105/****************************************************************/ 100/****************************************************************/
106/************** Functions without logging ***********************/ 101/************** Functions without logging ***********************/
107/****************************************************************/ 102/****************************************************************/
@@ -223,13 +218,20 @@ zfcp_in_els_dbf_event(struct zfcp_adapter *adapter, const char *text,
223 * Parse "device=..." parameter string. 218 * Parse "device=..." parameter string.
224 */ 219 */
225static int __init 220static int __init
226zfcp_device_setup(char *str) 221zfcp_device_setup(char *devstr)
227{ 222{
228 char *tmp; 223 char *tmp, *str;
224 size_t len;
229 225
230 if (!str) 226 if (!devstr)
231 return 0; 227 return 0;
232 228
229 len = strlen(devstr) + 1;
230 str = (char *) kmalloc(len, GFP_KERNEL);
231 if (!str)
232 goto err_out;
233 memcpy(str, devstr, len);
234
233 tmp = strchr(str, ','); 235 tmp = strchr(str, ',');
234 if (!tmp) 236 if (!tmp)
235 goto err_out; 237 goto err_out;
@@ -246,10 +248,12 @@ zfcp_device_setup(char *str)
246 zfcp_data.init_fcp_lun = simple_strtoull(tmp, &tmp, 0); 248 zfcp_data.init_fcp_lun = simple_strtoull(tmp, &tmp, 0);
247 if (*tmp != '\0') 249 if (*tmp != '\0')
248 goto err_out; 250 goto err_out;
251 kfree(str);
249 return 1; 252 return 1;
250 253
251 err_out: 254 err_out:
252 ZFCP_LOG_NORMAL("Parse error for device parameter string %s\n", str); 255 ZFCP_LOG_NORMAL("Parse error for device parameter string %s\n", str);
256 kfree(str);
253 return 0; 257 return 0;
254} 258}
255 259
@@ -525,7 +529,7 @@ zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command,
525 529
526 out: 530 out:
527 if (fsf_req != NULL) 531 if (fsf_req != NULL)
528 zfcp_fsf_req_cleanup(fsf_req); 532 zfcp_fsf_req_free(fsf_req);
529 533
530 if ((adapter != NULL) && (retval != -ENXIO)) 534 if ((adapter != NULL) && (retval != -ENXIO))
531 zfcp_adapter_put(adapter); 535 zfcp_adapter_put(adapter);
@@ -1154,7 +1158,7 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
1154 INIT_LIST_HEAD(&adapter->port_remove_lh); 1158 INIT_LIST_HEAD(&adapter->port_remove_lh);
1155 1159
1156 /* initialize list of fsf requests */ 1160 /* initialize list of fsf requests */
1157 rwlock_init(&adapter->fsf_req_list_lock); 1161 spin_lock_init(&adapter->fsf_req_list_lock);
1158 INIT_LIST_HEAD(&adapter->fsf_req_list_head); 1162 INIT_LIST_HEAD(&adapter->fsf_req_list_head);
1159 1163
1160 /* initialize abort lock */ 1164 /* initialize abort lock */
@@ -1239,9 +1243,9 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
1239 zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev); 1243 zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev);
1240 dev_set_drvdata(&adapter->ccw_device->dev, NULL); 1244 dev_set_drvdata(&adapter->ccw_device->dev, NULL);
1241 /* sanity check: no pending FSF requests */ 1245 /* sanity check: no pending FSF requests */
1242 read_lock_irqsave(&adapter->fsf_req_list_lock, flags); 1246 spin_lock_irqsave(&adapter->fsf_req_list_lock, flags);
1243 retval = !list_empty(&adapter->fsf_req_list_head); 1247 retval = !list_empty(&adapter->fsf_req_list_head);
1244 read_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); 1248 spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
1245 if (retval) { 1249 if (retval) {
1246 ZFCP_LOG_NORMAL("bug: adapter %s (%p) still in use, " 1250 ZFCP_LOG_NORMAL("bug: adapter %s (%p) still in use, "
1247 "%i requests outstanding\n", 1251 "%i requests outstanding\n",
@@ -1483,19 +1487,15 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter,
1483 fcp_rscn_element++; 1487 fcp_rscn_element++;
1484 switch (fcp_rscn_element->addr_format) { 1488 switch (fcp_rscn_element->addr_format) {
1485 case ZFCP_PORT_ADDRESS: 1489 case ZFCP_PORT_ADDRESS:
1486 ZFCP_LOG_FLAGS(1, "ZFCP_PORT_ADDRESS\n");
1487 range_mask = ZFCP_PORTS_RANGE_PORT; 1490 range_mask = ZFCP_PORTS_RANGE_PORT;
1488 break; 1491 break;
1489 case ZFCP_AREA_ADDRESS: 1492 case ZFCP_AREA_ADDRESS:
1490 ZFCP_LOG_FLAGS(1, "ZFCP_AREA_ADDRESS\n");
1491 range_mask = ZFCP_PORTS_RANGE_AREA; 1493 range_mask = ZFCP_PORTS_RANGE_AREA;
1492 break; 1494 break;
1493 case ZFCP_DOMAIN_ADDRESS: 1495 case ZFCP_DOMAIN_ADDRESS:
1494 ZFCP_LOG_FLAGS(1, "ZFCP_DOMAIN_ADDRESS\n");
1495 range_mask = ZFCP_PORTS_RANGE_DOMAIN; 1496 range_mask = ZFCP_PORTS_RANGE_DOMAIN;
1496 break; 1497 break;
1497 case ZFCP_FABRIC_ADDRESS: 1498 case ZFCP_FABRIC_ADDRESS:
1498 ZFCP_LOG_FLAGS(1, "ZFCP_FABRIC_ADDRESS\n");
1499 range_mask = ZFCP_PORTS_RANGE_FABRIC; 1499 range_mask = ZFCP_PORTS_RANGE_FABRIC;
1500 break; 1500 break;
1501 default: 1501 default:
@@ -1762,7 +1762,10 @@ static void zfcp_ns_gid_pn_handler(unsigned long data)
1762 ct_iu_req = zfcp_sg_to_address(ct->req); 1762 ct_iu_req = zfcp_sg_to_address(ct->req);
1763 ct_iu_resp = zfcp_sg_to_address(ct->resp); 1763 ct_iu_resp = zfcp_sg_to_address(ct->resp);
1764 1764
1765 if ((ct->status != 0) || zfcp_check_ct_response(&ct_iu_resp->header)) { 1765 if (ct->status != 0)
1766 goto failed;
1767
1768 if (zfcp_check_ct_response(&ct_iu_resp->header)) {
1766 /* FIXME: do we need some specific erp entry points */ 1769 /* FIXME: do we need some specific erp entry points */
1767 atomic_set_mask(ZFCP_STATUS_PORT_INVALID_WWPN, &port->status); 1770 atomic_set_mask(ZFCP_STATUS_PORT_INVALID_WWPN, &port->status);
1768 goto failed; 1771 goto failed;
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index c5daf372f853..4103b5be7683 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -62,9 +62,6 @@
62#include <linux/syscalls.h> 62#include <linux/syscalls.h>
63#include <linux/ioctl.h> 63#include <linux/ioctl.h>
64 64
65/************************ DEBUG FLAGS *****************************************/
66
67#define ZFCP_PRINT_FLAGS
68 65
69/********************* GENERAL DEFINES *********************************/ 66/********************* GENERAL DEFINES *********************************/
70 67
@@ -152,8 +149,10 @@ typedef u32 scsi_lun_t;
152#define FSF_QTCB_UNSOLICITED_STATUS 0x6305 149#define FSF_QTCB_UNSOLICITED_STATUS 0x6305
153#define ZFCP_STATUS_READ_FAILED_THRESHOLD 3 150#define ZFCP_STATUS_READ_FAILED_THRESHOLD 3
154#define ZFCP_STATUS_READS_RECOM FSF_STATUS_READS_RECOM 151#define ZFCP_STATUS_READS_RECOM FSF_STATUS_READS_RECOM
155#define ZFCP_EXCHANGE_CONFIG_DATA_RETRIES 6 152
156#define ZFCP_EXCHANGE_CONFIG_DATA_SLEEP 50 153/* Do 1st retry in 1 second, then double the timeout for each following retry */
154#define ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP 100
155#define ZFCP_EXCHANGE_CONFIG_DATA_RETRIES 7
157 156
158/* timeout value for "default timer" for fsf requests */ 157/* timeout value for "default timer" for fsf requests */
159#define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ); 158#define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ);
@@ -472,17 +471,6 @@ do { \
472 ZFCP_LOG(ZFCP_LOG_LEVEL_TRACE, fmt , ##args) 471 ZFCP_LOG(ZFCP_LOG_LEVEL_TRACE, fmt , ##args)
473#endif 472#endif
474 473
475#ifndef ZFCP_PRINT_FLAGS
476# define ZFCP_LOG_FLAGS(level, fmt, args...)
477#else
478extern u32 flags_dump;
479# define ZFCP_LOG_FLAGS(level, fmt, args...) \
480do { \
481 if (level <= flags_dump) \
482 _ZFCP_LOG(fmt, ##args); \
483} while (0)
484#endif
485
486/*************** ADAPTER/PORT/UNIT AND FSF_REQ STATUS FLAGS ******************/ 474/*************** ADAPTER/PORT/UNIT AND FSF_REQ STATUS FLAGS ******************/
487 475
488/* 476/*
@@ -502,6 +490,7 @@ do { \
502#define ZFCP_STATUS_COMMON_CLOSING 0x02000000 490#define ZFCP_STATUS_COMMON_CLOSING 0x02000000
503#define ZFCP_STATUS_COMMON_ERP_INUSE 0x01000000 491#define ZFCP_STATUS_COMMON_ERP_INUSE 0x01000000
504#define ZFCP_STATUS_COMMON_ACCESS_DENIED 0x00800000 492#define ZFCP_STATUS_COMMON_ACCESS_DENIED 0x00800000
493#define ZFCP_STATUS_COMMON_ACCESS_BOXED 0x00400000
505 494
506/* adapter status */ 495/* adapter status */
507#define ZFCP_STATUS_ADAPTER_QDIOUP 0x00000002 496#define ZFCP_STATUS_ADAPTER_QDIOUP 0x00000002
@@ -763,6 +752,7 @@ typedef void (*zfcp_send_els_handler_t)(unsigned long);
763/** 752/**
764 * struct zfcp_send_els - used to pass parameters to function zfcp_fsf_send_els 753 * struct zfcp_send_els - used to pass parameters to function zfcp_fsf_send_els
765 * @adapter: adapter where request is sent from 754 * @adapter: adapter where request is sent from
755 * @port: port where ELS is destinated (port reference count has to be increased)
766 * @d_id: destiniation id of port where request is sent to 756 * @d_id: destiniation id of port where request is sent to
767 * @req: scatter-gather list for request 757 * @req: scatter-gather list for request
768 * @resp: scatter-gather list for response 758 * @resp: scatter-gather list for response
@@ -777,6 +767,7 @@ typedef void (*zfcp_send_els_handler_t)(unsigned long);
777 */ 767 */
778struct zfcp_send_els { 768struct zfcp_send_els {
779 struct zfcp_adapter *adapter; 769 struct zfcp_adapter *adapter;
770 struct zfcp_port *port;
780 fc_id_t d_id; 771 fc_id_t d_id;
781 struct scatterlist *req; 772 struct scatterlist *req;
782 struct scatterlist *resp; 773 struct scatterlist *resp;
@@ -871,7 +862,7 @@ struct zfcp_adapter {
871 u32 ports; /* number of remote ports */ 862 u32 ports; /* number of remote ports */
872 struct timer_list scsi_er_timer; /* SCSI err recovery watch */ 863 struct timer_list scsi_er_timer; /* SCSI err recovery watch */
873 struct list_head fsf_req_list_head; /* head of FSF req list */ 864 struct list_head fsf_req_list_head; /* head of FSF req list */
874 rwlock_t fsf_req_list_lock; /* lock for ops on list of 865 spinlock_t fsf_req_list_lock; /* lock for ops on list of
875 FSF requests */ 866 FSF requests */
876 atomic_t fsf_reqs_active; /* # active FSF reqs */ 867 atomic_t fsf_reqs_active; /* # active FSF reqs */
877 struct zfcp_qdio_queue request_queue; /* request queue */ 868 struct zfcp_qdio_queue request_queue; /* request queue */
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index 53ebc1cdfe2d..0cf31f7d1c0f 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -35,7 +35,7 @@
35 35
36#include "zfcp_ext.h" 36#include "zfcp_ext.h"
37 37
38static int zfcp_erp_adisc(struct zfcp_adapter *, fc_id_t); 38static int zfcp_erp_adisc(struct zfcp_port *);
39static void zfcp_erp_adisc_handler(unsigned long); 39static void zfcp_erp_adisc_handler(unsigned long);
40 40
41static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *, int); 41static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *, int);
@@ -295,12 +295,12 @@ zfcp_erp_unit_shutdown(struct zfcp_unit *unit, int clear_mask)
295 295
296/** 296/**
297 * zfcp_erp_adisc - send ADISC ELS command 297 * zfcp_erp_adisc - send ADISC ELS command
298 * @adapter: adapter structure 298 * @port: port structure
299 * @d_id: d_id of port where ADISC is sent to
300 */ 299 */
301int 300int
302zfcp_erp_adisc(struct zfcp_adapter *adapter, fc_id_t d_id) 301zfcp_erp_adisc(struct zfcp_port *port)
303{ 302{
303 struct zfcp_adapter *adapter = port->adapter;
304 struct zfcp_send_els *send_els; 304 struct zfcp_send_els *send_els;
305 struct zfcp_ls_adisc *adisc; 305 struct zfcp_ls_adisc *adisc;
306 void *address = NULL; 306 void *address = NULL;
@@ -332,7 +332,8 @@ zfcp_erp_adisc(struct zfcp_adapter *adapter, fc_id_t d_id)
332 send_els->req_count = send_els->resp_count = 1; 332 send_els->req_count = send_els->resp_count = 1;
333 333
334 send_els->adapter = adapter; 334 send_els->adapter = adapter;
335 send_els->d_id = d_id; 335 send_els->port = port;
336 send_els->d_id = port->d_id;
336 send_els->handler = zfcp_erp_adisc_handler; 337 send_els->handler = zfcp_erp_adisc_handler;
337 send_els->handler_data = (unsigned long) send_els; 338 send_els->handler_data = (unsigned long) send_els;
338 339
@@ -350,7 +351,7 @@ zfcp_erp_adisc(struct zfcp_adapter *adapter, fc_id_t d_id)
350 ZFCP_LOG_INFO("ADISC request from s_id 0x%08x to d_id 0x%08x " 351 ZFCP_LOG_INFO("ADISC request from s_id 0x%08x to d_id 0x%08x "
351 "(wwpn=0x%016Lx, wwnn=0x%016Lx, " 352 "(wwpn=0x%016Lx, wwnn=0x%016Lx, "
352 "hard_nport_id=0x%08x, nport_id=0x%08x)\n", 353 "hard_nport_id=0x%08x, nport_id=0x%08x)\n",
353 adapter->s_id, d_id, (wwn_t) adisc->wwpn, 354 adapter->s_id, send_els->d_id, (wwn_t) adisc->wwpn,
354 (wwn_t) adisc->wwnn, adisc->hard_nport_id, 355 (wwn_t) adisc->wwnn, adisc->hard_nport_id,
355 adisc->nport_id); 356 adisc->nport_id);
356 357
@@ -367,7 +368,7 @@ zfcp_erp_adisc(struct zfcp_adapter *adapter, fc_id_t d_id)
367 retval = zfcp_fsf_send_els(send_els); 368 retval = zfcp_fsf_send_els(send_els);
368 if (retval != 0) { 369 if (retval != 0) {
369 ZFCP_LOG_NORMAL("error: initiation of Send ELS failed for port " 370 ZFCP_LOG_NORMAL("error: initiation of Send ELS failed for port "
370 "0x%08x on adapter %s\n", d_id, 371 "0x%08x on adapter %s\n", send_els->d_id,
371 zfcp_get_busid_by_adapter(adapter)); 372 zfcp_get_busid_by_adapter(adapter));
372 del_timer(send_els->timer); 373 del_timer(send_els->timer);
373 goto freemem; 374 goto freemem;
@@ -411,14 +412,9 @@ zfcp_erp_adisc_handler(unsigned long data)
411 del_timer(send_els->timer); 412 del_timer(send_els->timer);
412 413
413 adapter = send_els->adapter; 414 adapter = send_els->adapter;
415 port = send_els->port;
414 d_id = send_els->d_id; 416 d_id = send_els->d_id;
415 417
416 read_lock(&zfcp_data.config_lock);
417 port = zfcp_get_port_by_did(send_els->adapter, send_els->d_id);
418 read_unlock(&zfcp_data.config_lock);
419
420 BUG_ON(port == NULL);
421
422 /* request rejected or timed out */ 418 /* request rejected or timed out */
423 if (send_els->status != 0) { 419 if (send_els->status != 0) {
424 ZFCP_LOG_NORMAL("ELS request rejected/timed out, " 420 ZFCP_LOG_NORMAL("ELS request rejected/timed out, "
@@ -482,7 +478,7 @@ zfcp_test_link(struct zfcp_port *port)
482 int retval; 478 int retval;
483 479
484 zfcp_port_get(port); 480 zfcp_port_get(port);
485 retval = zfcp_erp_adisc(port->adapter, port->d_id); 481 retval = zfcp_erp_adisc(port);
486 if (retval != 0) { 482 if (retval != 0) {
487 zfcp_port_put(port); 483 zfcp_port_put(port);
488 ZFCP_LOG_NORMAL("reopen needed for port 0x%016Lx " 484 ZFCP_LOG_NORMAL("reopen needed for port 0x%016Lx "
@@ -895,7 +891,7 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action)
895 891
896 if (erp_action->fsf_req) { 892 if (erp_action->fsf_req) {
897 /* take lock to ensure that request is not being deleted meanwhile */ 893 /* take lock to ensure that request is not being deleted meanwhile */
898 write_lock(&adapter->fsf_req_list_lock); 894 spin_lock(&adapter->fsf_req_list_lock);
899 /* check whether fsf req does still exist */ 895 /* check whether fsf req does still exist */
900 list_for_each_entry(fsf_req, &adapter->fsf_req_list_head, list) 896 list_for_each_entry(fsf_req, &adapter->fsf_req_list_head, list)
901 if (fsf_req == erp_action->fsf_req) 897 if (fsf_req == erp_action->fsf_req)
@@ -938,7 +934,7 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action)
938 */ 934 */
939 erp_action->fsf_req = NULL; 935 erp_action->fsf_req = NULL;
940 } 936 }
941 write_unlock(&adapter->fsf_req_list_lock); 937 spin_unlock(&adapter->fsf_req_list_lock);
942 } else 938 } else
943 debug_text_event(adapter->erp_dbf, 3, "a_ca_noreq"); 939 debug_text_event(adapter->erp_dbf, 3, "a_ca_noreq");
944 940
@@ -2286,12 +2282,12 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
2286{ 2282{
2287 int retval = ZFCP_ERP_SUCCEEDED; 2283 int retval = ZFCP_ERP_SUCCEEDED;
2288 int retries; 2284 int retries;
2285 int sleep = ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP;
2289 struct zfcp_adapter *adapter = erp_action->adapter; 2286 struct zfcp_adapter *adapter = erp_action->adapter;
2290 2287
2291 atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, &adapter->status); 2288 atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, &adapter->status);
2292 retries = ZFCP_EXCHANGE_CONFIG_DATA_RETRIES;
2293 2289
2294 do { 2290 for (retries = ZFCP_EXCHANGE_CONFIG_DATA_RETRIES; retries; retries--) {
2295 atomic_clear_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, 2291 atomic_clear_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
2296 &adapter->status); 2292 &adapter->status);
2297 ZFCP_LOG_DEBUG("Doing exchange config data\n"); 2293 ZFCP_LOG_DEBUG("Doing exchange config data\n");
@@ -2329,16 +2325,17 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
2329 zfcp_get_busid_by_adapter(adapter)); 2325 zfcp_get_busid_by_adapter(adapter));
2330 break; 2326 break;
2331 } 2327 }
2332 if (atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, 2328
2333 &adapter->status)) { 2329 if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
2334 ZFCP_LOG_DEBUG("host connection still initialising... " 2330 &adapter->status))
2335 "waiting and retrying...\n"); 2331 break;
2336 /* sleep a little bit before retry */ 2332
2337 msleep(jiffies_to_msecs(ZFCP_EXCHANGE_CONFIG_DATA_SLEEP)); 2333 ZFCP_LOG_DEBUG("host connection still initialising... "
2338 } 2334 "waiting and retrying...\n");
2339 } while ((retries--) && 2335 /* sleep a little bit before retry */
2340 atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, 2336 msleep(jiffies_to_msecs(sleep));
2341 &adapter->status)); 2337 sleep *= 2;
2338 }
2342 2339
2343 if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, 2340 if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK,
2344 &adapter->status)) { 2341 &adapter->status)) {
@@ -3485,6 +3482,45 @@ zfcp_erp_action_to_ready(struct zfcp_erp_action *erp_action)
3485} 3482}
3486 3483
3487/* 3484/*
3485 * function: zfcp_erp_port_boxed
3486 *
3487 * purpose:
3488 */
3489void
3490zfcp_erp_port_boxed(struct zfcp_port *port)
3491{
3492 struct zfcp_adapter *adapter = port->adapter;
3493 unsigned long flags;
3494
3495 debug_text_event(adapter->erp_dbf, 3, "p_access_boxed");
3496 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t));
3497 read_lock_irqsave(&zfcp_data.config_lock, flags);
3498 zfcp_erp_modify_port_status(port,
3499 ZFCP_STATUS_COMMON_ACCESS_BOXED,
3500 ZFCP_SET);
3501 read_unlock_irqrestore(&zfcp_data.config_lock, flags);
3502 zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED);
3503}
3504
3505/*
3506 * function: zfcp_erp_unit_boxed
3507 *
3508 * purpose:
3509 */
3510void
3511zfcp_erp_unit_boxed(struct zfcp_unit *unit)
3512{
3513 struct zfcp_adapter *adapter = unit->port->adapter;
3514
3515 debug_text_event(adapter->erp_dbf, 3, "u_access_boxed");
3516 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t));
3517 zfcp_erp_modify_unit_status(unit,
3518 ZFCP_STATUS_COMMON_ACCESS_BOXED,
3519 ZFCP_SET);
3520 zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED);
3521}
3522
3523/*
3488 * function: zfcp_erp_port_access_denied 3524 * function: zfcp_erp_port_access_denied
3489 * 3525 *
3490 * purpose: 3526 * purpose:
@@ -3495,11 +3531,13 @@ zfcp_erp_port_access_denied(struct zfcp_port *port)
3495 struct zfcp_adapter *adapter = port->adapter; 3531 struct zfcp_adapter *adapter = port->adapter;
3496 unsigned long flags; 3532 unsigned long flags;
3497 3533
3498 debug_text_event(adapter->erp_dbf, 3, "p_access_block"); 3534 debug_text_event(adapter->erp_dbf, 3, "p_access_denied");
3499 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); 3535 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t));
3500 read_lock_irqsave(&zfcp_data.config_lock, flags); 3536 read_lock_irqsave(&zfcp_data.config_lock, flags);
3501 zfcp_erp_modify_port_status(port, ZFCP_STATUS_COMMON_ERP_FAILED | 3537 zfcp_erp_modify_port_status(port,
3502 ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); 3538 ZFCP_STATUS_COMMON_ERP_FAILED |
3539 ZFCP_STATUS_COMMON_ACCESS_DENIED,
3540 ZFCP_SET);
3503 read_unlock_irqrestore(&zfcp_data.config_lock, flags); 3541 read_unlock_irqrestore(&zfcp_data.config_lock, flags);
3504} 3542}
3505 3543
@@ -3513,10 +3551,12 @@ zfcp_erp_unit_access_denied(struct zfcp_unit *unit)
3513{ 3551{
3514 struct zfcp_adapter *adapter = unit->port->adapter; 3552 struct zfcp_adapter *adapter = unit->port->adapter;
3515 3553
3516 debug_text_event(adapter->erp_dbf, 3, "u_access_block"); 3554 debug_text_event(adapter->erp_dbf, 3, "u_access_denied");
3517 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); 3555 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t));
3518 zfcp_erp_modify_unit_status(unit, ZFCP_STATUS_COMMON_ERP_FAILED | 3556 zfcp_erp_modify_unit_status(unit,
3519 ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); 3557 ZFCP_STATUS_COMMON_ERP_FAILED |
3558 ZFCP_STATUS_COMMON_ACCESS_DENIED,
3559 ZFCP_SET);
3520} 3560}
3521 3561
3522/* 3562/*
@@ -3530,7 +3570,7 @@ zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter)
3530 struct zfcp_port *port; 3570 struct zfcp_port *port;
3531 unsigned long flags; 3571 unsigned long flags;
3532 3572
3533 debug_text_event(adapter->erp_dbf, 3, "a_access_unblock"); 3573 debug_text_event(adapter->erp_dbf, 3, "a_access_recover");
3534 debug_event(adapter->erp_dbf, 3, &adapter->name, 8); 3574 debug_event(adapter->erp_dbf, 3, &adapter->name, 8);
3535 3575
3536 read_lock_irqsave(&zfcp_data.config_lock, flags); 3576 read_lock_irqsave(&zfcp_data.config_lock, flags);
@@ -3553,10 +3593,12 @@ zfcp_erp_port_access_changed(struct zfcp_port *port)
3553 struct zfcp_adapter *adapter = port->adapter; 3593 struct zfcp_adapter *adapter = port->adapter;
3554 struct zfcp_unit *unit; 3594 struct zfcp_unit *unit;
3555 3595
3556 debug_text_event(adapter->erp_dbf, 3, "p_access_unblock"); 3596 debug_text_event(adapter->erp_dbf, 3, "p_access_recover");
3557 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); 3597 debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t));
3558 3598
3559 if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, 3599 if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED,
3600 &port->status) &&
3601 !atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_BOXED,
3560 &port->status)) { 3602 &port->status)) {
3561 if (!atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status)) 3603 if (!atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status))
3562 list_for_each_entry(unit, &port->unit_list_head, list) 3604 list_for_each_entry(unit, &port->unit_list_head, list)
@@ -3583,10 +3625,13 @@ zfcp_erp_unit_access_changed(struct zfcp_unit *unit)
3583{ 3625{
3584 struct zfcp_adapter *adapter = unit->port->adapter; 3626 struct zfcp_adapter *adapter = unit->port->adapter;
3585 3627
3586 debug_text_event(adapter->erp_dbf, 3, "u_access_unblock"); 3628 debug_text_event(adapter->erp_dbf, 3, "u_access_recover");
3587 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); 3629 debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t));
3588 3630
3589 if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, &unit->status)) 3631 if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED,
3632 &unit->status) &&
3633 !atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_BOXED,
3634 &unit->status))
3590 return; 3635 return;
3591 3636
3592 ZFCP_LOG_NORMAL("reopen of unit 0x%016Lx on port 0x%016Lx " 3637 ZFCP_LOG_NORMAL("reopen of unit 0x%016Lx on port 0x%016Lx "
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index d5fd43352071..42df7e57eeae 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -116,7 +116,7 @@ extern int zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *,
116 struct timer_list*, int); 116 struct timer_list*, int);
117extern int zfcp_fsf_req_complete(struct zfcp_fsf_req *); 117extern int zfcp_fsf_req_complete(struct zfcp_fsf_req *);
118extern void zfcp_fsf_incoming_els(struct zfcp_fsf_req *); 118extern void zfcp_fsf_incoming_els(struct zfcp_fsf_req *);
119extern void zfcp_fsf_req_cleanup(struct zfcp_fsf_req *); 119extern void zfcp_fsf_req_free(struct zfcp_fsf_req *);
120extern struct zfcp_fsf_req *zfcp_fsf_send_fcp_command_task_management( 120extern struct zfcp_fsf_req *zfcp_fsf_send_fcp_command_task_management(
121 struct zfcp_adapter *, struct zfcp_unit *, u8, int); 121 struct zfcp_adapter *, struct zfcp_unit *, u8, int);
122extern struct zfcp_fsf_req *zfcp_fsf_abort_fcp_command( 122extern struct zfcp_fsf_req *zfcp_fsf_abort_fcp_command(
@@ -171,6 +171,8 @@ extern int zfcp_erp_async_handler(struct zfcp_erp_action *, unsigned long);
171 171
172extern int zfcp_test_link(struct zfcp_port *); 172extern int zfcp_test_link(struct zfcp_port *);
173 173
174extern void zfcp_erp_port_boxed(struct zfcp_port *);
175extern void zfcp_erp_unit_boxed(struct zfcp_unit *);
174extern void zfcp_erp_port_access_denied(struct zfcp_port *); 176extern void zfcp_erp_port_access_denied(struct zfcp_port *);
175extern void zfcp_erp_unit_access_denied(struct zfcp_unit *); 177extern void zfcp_erp_unit_access_denied(struct zfcp_unit *);
176extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *); 178extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *);
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 148b11c822bf..0d9f20edc490 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -61,7 +61,6 @@ static int zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *);
61static int zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *); 61static int zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *);
62static int zfcp_fsf_req_dispatch(struct zfcp_fsf_req *); 62static int zfcp_fsf_req_dispatch(struct zfcp_fsf_req *);
63static void zfcp_fsf_req_dismiss(struct zfcp_fsf_req *); 63static void zfcp_fsf_req_dismiss(struct zfcp_fsf_req *);
64static void zfcp_fsf_req_free(struct zfcp_fsf_req *);
65 64
66/* association between FSF command and FSF QTCB type */ 65/* association between FSF command and FSF QTCB type */
67static u32 fsf_qtcb_type[] = { 66static u32 fsf_qtcb_type[] = {
@@ -149,13 +148,13 @@ zfcp_fsf_req_alloc(mempool_t *pool, int req_flags)
149 * 148 *
150 * locks: none 149 * locks: none
151 */ 150 */
152static void 151void
153zfcp_fsf_req_free(struct zfcp_fsf_req *fsf_req) 152zfcp_fsf_req_free(struct zfcp_fsf_req *fsf_req)
154{ 153{
155 if (likely(fsf_req->pool != NULL)) 154 if (likely(fsf_req->pool != NULL))
156 mempool_free(fsf_req, fsf_req->pool); 155 mempool_free(fsf_req, fsf_req->pool);
157 else 156 else
158 kfree(fsf_req); 157 kfree(fsf_req);
159} 158}
160 159
161/* 160/*
@@ -170,30 +169,21 @@ zfcp_fsf_req_free(struct zfcp_fsf_req *fsf_req)
170int 169int
171zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter) 170zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter)
172{ 171{
173 int retval = 0;
174 struct zfcp_fsf_req *fsf_req, *tmp; 172 struct zfcp_fsf_req *fsf_req, *tmp;
173 unsigned long flags;
174 LIST_HEAD(remove_queue);
175 175
176 list_for_each_entry_safe(fsf_req, tmp, &adapter->fsf_req_list_head, 176 spin_lock_irqsave(&adapter->fsf_req_list_lock, flags);
177 list) 177 list_splice_init(&adapter->fsf_req_list_head, &remove_queue);
178 zfcp_fsf_req_dismiss(fsf_req); 178 atomic_set(&adapter->fsf_reqs_active, 0);
179 /* wait_event_timeout? */ 179 spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
180 while (!list_empty(&adapter->fsf_req_list_head)) {
181 ZFCP_LOG_DEBUG("fsf req list of adapter %s not yet empty\n",
182 zfcp_get_busid_by_adapter(adapter));
183 /* wait for woken intiators to clean up their requests */
184 msleep(jiffies_to_msecs(ZFCP_FSFREQ_CLEANUP_TIMEOUT));
185 }
186 180
187 /* consistency check */ 181 list_for_each_entry_safe(fsf_req, tmp, &remove_queue, list) {
188 if (atomic_read(&adapter->fsf_reqs_active)) { 182 list_del(&fsf_req->list);
189 ZFCP_LOG_NORMAL("bug: There are still %d FSF requests pending " 183 zfcp_fsf_req_dismiss(fsf_req);
190 "on adapter %s after cleanup.\n",
191 atomic_read(&adapter->fsf_reqs_active),
192 zfcp_get_busid_by_adapter(adapter));
193 atomic_set(&adapter->fsf_reqs_active, 0);
194 } 184 }
195 185
196 return retval; 186 return 0;
197} 187}
198 188
199/* 189/*
@@ -226,10 +216,6 @@ zfcp_fsf_req_complete(struct zfcp_fsf_req *fsf_req)
226{ 216{
227 int retval = 0; 217 int retval = 0;
228 int cleanup; 218 int cleanup;
229 struct zfcp_adapter *adapter = fsf_req->adapter;
230
231 /* do some statistics */
232 atomic_dec(&adapter->fsf_reqs_active);
233 219
234 if (unlikely(fsf_req->fsf_command == FSF_QTCB_UNSOLICITED_STATUS)) { 220 if (unlikely(fsf_req->fsf_command == FSF_QTCB_UNSOLICITED_STATUS)) {
235 ZFCP_LOG_DEBUG("Status read response received\n"); 221 ZFCP_LOG_DEBUG("Status read response received\n");
@@ -260,7 +246,7 @@ zfcp_fsf_req_complete(struct zfcp_fsf_req *fsf_req)
260 * lock must not be held here since it will be 246 * lock must not be held here since it will be
261 * grabed by the called routine, too 247 * grabed by the called routine, too
262 */ 248 */
263 zfcp_fsf_req_cleanup(fsf_req); 249 zfcp_fsf_req_free(fsf_req);
264 } else { 250 } else {
265 /* notify initiator waiting for the requests completion */ 251 /* notify initiator waiting for the requests completion */
266 ZFCP_LOG_TRACE("waking initiator of FSF request %p\n",fsf_req); 252 ZFCP_LOG_TRACE("waking initiator of FSF request %p\n",fsf_req);
@@ -346,15 +332,10 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
346 switch (fsf_req->qtcb->prefix.prot_status) { 332 switch (fsf_req->qtcb->prefix.prot_status) {
347 333
348 case FSF_PROT_GOOD: 334 case FSF_PROT_GOOD:
349 ZFCP_LOG_TRACE("FSF_PROT_GOOD\n");
350 break;
351
352 case FSF_PROT_FSF_STATUS_PRESENTED: 335 case FSF_PROT_FSF_STATUS_PRESENTED:
353 ZFCP_LOG_TRACE("FSF_PROT_FSF_STATUS_PRESENTED\n");
354 break; 336 break;
355 337
356 case FSF_PROT_QTCB_VERSION_ERROR: 338 case FSF_PROT_QTCB_VERSION_ERROR:
357 ZFCP_LOG_FLAGS(0, "FSF_PROT_QTCB_VERSION_ERROR\n");
358 ZFCP_LOG_NORMAL("error: The adapter %s contains " 339 ZFCP_LOG_NORMAL("error: The adapter %s contains "
359 "microcode of version 0x%x, the device driver " 340 "microcode of version 0x%x, the device driver "
360 "only supports 0x%x. Aborting.\n", 341 "only supports 0x%x. Aborting.\n",
@@ -371,7 +352,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
371 break; 352 break;
372 353
373 case FSF_PROT_SEQ_NUMB_ERROR: 354 case FSF_PROT_SEQ_NUMB_ERROR:
374 ZFCP_LOG_FLAGS(0, "FSF_PROT_SEQ_NUMB_ERROR\n");
375 ZFCP_LOG_NORMAL("bug: Sequence number mismatch between " 355 ZFCP_LOG_NORMAL("bug: Sequence number mismatch between "
376 "driver (0x%x) and adapter %s (0x%x). " 356 "driver (0x%x) and adapter %s (0x%x). "
377 "Restarting all operations on this adapter.\n", 357 "Restarting all operations on this adapter.\n",
@@ -390,7 +370,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
390 break; 370 break;
391 371
392 case FSF_PROT_UNSUPP_QTCB_TYPE: 372 case FSF_PROT_UNSUPP_QTCB_TYPE:
393 ZFCP_LOG_FLAGS(0, "FSF_PROT_UNSUP_QTCB_TYPE\n");
394 ZFCP_LOG_NORMAL("error: Packet header type used by the " 373 ZFCP_LOG_NORMAL("error: Packet header type used by the "
395 "device driver is incompatible with " 374 "device driver is incompatible with "
396 "that used on adapter %s. " 375 "that used on adapter %s. "
@@ -405,7 +384,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
405 break; 384 break;
406 385
407 case FSF_PROT_HOST_CONNECTION_INITIALIZING: 386 case FSF_PROT_HOST_CONNECTION_INITIALIZING:
408 ZFCP_LOG_FLAGS(1, "FSF_PROT_HOST_CONNECTION_INITIALIZING\n");
409 zfcp_cmd_dbf_event_fsf("hconinit", fsf_req, 387 zfcp_cmd_dbf_event_fsf("hconinit", fsf_req,
410 &fsf_req->qtcb->prefix.prot_status_qual, 388 &fsf_req->qtcb->prefix.prot_status_qual,
411 sizeof (union fsf_prot_status_qual)); 389 sizeof (union fsf_prot_status_qual));
@@ -416,7 +394,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
416 break; 394 break;
417 395
418 case FSF_PROT_DUPLICATE_REQUEST_ID: 396 case FSF_PROT_DUPLICATE_REQUEST_ID:
419 ZFCP_LOG_FLAGS(0, "FSF_PROT_DUPLICATE_REQUEST_IDS\n");
420 if (fsf_req->qtcb) { 397 if (fsf_req->qtcb) {
421 ZFCP_LOG_NORMAL("bug: The request identifier 0x%Lx " 398 ZFCP_LOG_NORMAL("bug: The request identifier 0x%Lx "
422 "to the adapter %s is ambiguous. " 399 "to the adapter %s is ambiguous. "
@@ -445,7 +422,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
445 break; 422 break;
446 423
447 case FSF_PROT_LINK_DOWN: 424 case FSF_PROT_LINK_DOWN:
448 ZFCP_LOG_FLAGS(1, "FSF_PROT_LINK_DOWN\n");
449 /* 425 /*
450 * 'test and set' is not atomic here - 426 * 'test and set' is not atomic here -
451 * it's ok as long as calls to our response queue handler 427 * it's ok as long as calls to our response queue handler
@@ -502,13 +478,11 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
502 ZFCP_STATUS_COMMON_ERP_FAILED, 478 ZFCP_STATUS_COMMON_ERP_FAILED,
503 &adapter->status); 479 &adapter->status);
504 zfcp_erp_adapter_reopen(adapter, 0); 480 zfcp_erp_adapter_reopen(adapter, 0);
505 debug_text_event(adapter->erp_dbf, 1, "prot_link_down");
506 } 481 }
507 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 482 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
508 break; 483 break;
509 484
510 case FSF_PROT_REEST_QUEUE: 485 case FSF_PROT_REEST_QUEUE:
511 ZFCP_LOG_FLAGS(1, "FSF_PROT_REEST_QUEUE\n");
512 debug_text_event(adapter->erp_dbf, 1, "prot_reest_queue"); 486 debug_text_event(adapter->erp_dbf, 1, "prot_reest_queue");
513 ZFCP_LOG_INFO("The local link to adapter with " 487 ZFCP_LOG_INFO("The local link to adapter with "
514 "%s was re-plugged. " 488 "%s was re-plugged. "
@@ -528,7 +502,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
528 break; 502 break;
529 503
530 case FSF_PROT_ERROR_STATE: 504 case FSF_PROT_ERROR_STATE:
531 ZFCP_LOG_FLAGS(0, "FSF_PROT_ERROR_STATE\n");
532 ZFCP_LOG_NORMAL("error: The adapter %s " 505 ZFCP_LOG_NORMAL("error: The adapter %s "
533 "has entered the error state. " 506 "has entered the error state. "
534 "Restarting all operations on this " 507 "Restarting all operations on this "
@@ -589,7 +562,6 @@ zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *fsf_req)
589 /* evaluate FSF Status */ 562 /* evaluate FSF Status */
590 switch (fsf_req->qtcb->header.fsf_status) { 563 switch (fsf_req->qtcb->header.fsf_status) {
591 case FSF_UNKNOWN_COMMAND: 564 case FSF_UNKNOWN_COMMAND:
592 ZFCP_LOG_FLAGS(0, "FSF_UNKNOWN_COMMAND\n");
593 ZFCP_LOG_NORMAL("bug: Command issued by the device driver is " 565 ZFCP_LOG_NORMAL("bug: Command issued by the device driver is "
594 "not known by the adapter %s " 566 "not known by the adapter %s "
595 "Stopping all operations on this adapter. " 567 "Stopping all operations on this adapter. "
@@ -606,14 +578,12 @@ zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *fsf_req)
606 break; 578 break;
607 579
608 case FSF_FCP_RSP_AVAILABLE: 580 case FSF_FCP_RSP_AVAILABLE:
609 ZFCP_LOG_FLAGS(2, "FSF_FCP_RSP_AVAILABLE\n");
610 ZFCP_LOG_DEBUG("FCP Sense data will be presented to the " 581 ZFCP_LOG_DEBUG("FCP Sense data will be presented to the "
611 "SCSI stack.\n"); 582 "SCSI stack.\n");
612 debug_text_event(fsf_req->adapter->erp_dbf, 3, "fsf_s_rsp"); 583 debug_text_event(fsf_req->adapter->erp_dbf, 3, "fsf_s_rsp");
613 break; 584 break;
614 585
615 case FSF_ADAPTER_STATUS_AVAILABLE: 586 case FSF_ADAPTER_STATUS_AVAILABLE:
616 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
617 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_astatus"); 587 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_astatus");
618 zfcp_fsf_fsfstatus_qual_eval(fsf_req); 588 zfcp_fsf_fsfstatus_qual_eval(fsf_req);
619 break; 589 break;
@@ -647,11 +617,9 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req)
647 617
648 switch (fsf_req->qtcb->header.fsf_status_qual.word[0]) { 618 switch (fsf_req->qtcb->header.fsf_status_qual.word[0]) {
649 case FSF_SQ_FCP_RSP_AVAILABLE: 619 case FSF_SQ_FCP_RSP_AVAILABLE:
650 ZFCP_LOG_FLAGS(2, "FSF_SQ_FCP_RSP_AVAILABLE\n");
651 debug_text_event(fsf_req->adapter->erp_dbf, 4, "fsf_sq_rsp"); 620 debug_text_event(fsf_req->adapter->erp_dbf, 4, "fsf_sq_rsp");
652 break; 621 break;
653 case FSF_SQ_RETRY_IF_POSSIBLE: 622 case FSF_SQ_RETRY_IF_POSSIBLE:
654 ZFCP_LOG_FLAGS(2, "FSF_SQ_RETRY_IF_POSSIBLE\n");
655 /* The SCSI-stack may now issue retries or escalate */ 623 /* The SCSI-stack may now issue retries or escalate */
656 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_sq_retry"); 624 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_sq_retry");
657 zfcp_cmd_dbf_event_fsf("sqretry", fsf_req, 625 zfcp_cmd_dbf_event_fsf("sqretry", fsf_req,
@@ -660,7 +628,6 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req)
660 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 628 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
661 break; 629 break;
662 case FSF_SQ_COMMAND_ABORTED: 630 case FSF_SQ_COMMAND_ABORTED:
663 ZFCP_LOG_FLAGS(2, "FSF_SQ_COMMAND_ABORTED\n");
664 /* Carry the aborted state on to upper layer */ 631 /* Carry the aborted state on to upper layer */
665 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_sq_abort"); 632 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_sq_abort");
666 zfcp_cmd_dbf_event_fsf("sqabort", fsf_req, 633 zfcp_cmd_dbf_event_fsf("sqabort", fsf_req,
@@ -670,7 +637,6 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req)
670 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 637 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
671 break; 638 break;
672 case FSF_SQ_NO_RECOM: 639 case FSF_SQ_NO_RECOM:
673 ZFCP_LOG_FLAGS(0, "FSF_SQ_NO_RECOM\n");
674 debug_text_exception(fsf_req->adapter->erp_dbf, 0, 640 debug_text_exception(fsf_req->adapter->erp_dbf, 0,
675 "fsf_sq_no_rec"); 641 "fsf_sq_no_rec");
676 ZFCP_LOG_NORMAL("bug: No recommendation could be given for a" 642 ZFCP_LOG_NORMAL("bug: No recommendation could be given for a"
@@ -684,7 +650,6 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req)
684 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 650 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
685 break; 651 break;
686 case FSF_SQ_ULP_PROGRAMMING_ERROR: 652 case FSF_SQ_ULP_PROGRAMMING_ERROR:
687 ZFCP_LOG_FLAGS(0, "FSF_SQ_ULP_PROGRAMMING_ERROR\n");
688 ZFCP_LOG_NORMAL("error: not enough SBALs for data transfer " 653 ZFCP_LOG_NORMAL("error: not enough SBALs for data transfer "
689 "(adapter %s)\n", 654 "(adapter %s)\n",
690 zfcp_get_busid_by_adapter(fsf_req->adapter)); 655 zfcp_get_busid_by_adapter(fsf_req->adapter));
@@ -740,72 +705,58 @@ zfcp_fsf_req_dispatch(struct zfcp_fsf_req *fsf_req)
740 switch (fsf_req->fsf_command) { 705 switch (fsf_req->fsf_command) {
741 706
742 case FSF_QTCB_FCP_CMND: 707 case FSF_QTCB_FCP_CMND:
743 ZFCP_LOG_FLAGS(3, "FSF_QTCB_FCP_CMND\n");
744 zfcp_fsf_send_fcp_command_handler(fsf_req); 708 zfcp_fsf_send_fcp_command_handler(fsf_req);
745 break; 709 break;
746 710
747 case FSF_QTCB_ABORT_FCP_CMND: 711 case FSF_QTCB_ABORT_FCP_CMND:
748 ZFCP_LOG_FLAGS(2, "FSF_QTCB_ABORT_FCP_CMND\n");
749 zfcp_fsf_abort_fcp_command_handler(fsf_req); 712 zfcp_fsf_abort_fcp_command_handler(fsf_req);
750 break; 713 break;
751 714
752 case FSF_QTCB_SEND_GENERIC: 715 case FSF_QTCB_SEND_GENERIC:
753 ZFCP_LOG_FLAGS(2, "FSF_QTCB_SEND_GENERIC\n");
754 zfcp_fsf_send_ct_handler(fsf_req); 716 zfcp_fsf_send_ct_handler(fsf_req);
755 break; 717 break;
756 718
757 case FSF_QTCB_OPEN_PORT_WITH_DID: 719 case FSF_QTCB_OPEN_PORT_WITH_DID:
758 ZFCP_LOG_FLAGS(2, "FSF_QTCB_OPEN_PORT_WITH_DID\n");
759 zfcp_fsf_open_port_handler(fsf_req); 720 zfcp_fsf_open_port_handler(fsf_req);
760 break; 721 break;
761 722
762 case FSF_QTCB_OPEN_LUN: 723 case FSF_QTCB_OPEN_LUN:
763 ZFCP_LOG_FLAGS(2, "FSF_QTCB_OPEN_LUN\n");
764 zfcp_fsf_open_unit_handler(fsf_req); 724 zfcp_fsf_open_unit_handler(fsf_req);
765 break; 725 break;
766 726
767 case FSF_QTCB_CLOSE_LUN: 727 case FSF_QTCB_CLOSE_LUN:
768 ZFCP_LOG_FLAGS(2, "FSF_QTCB_CLOSE_LUN\n");
769 zfcp_fsf_close_unit_handler(fsf_req); 728 zfcp_fsf_close_unit_handler(fsf_req);
770 break; 729 break;
771 730
772 case FSF_QTCB_CLOSE_PORT: 731 case FSF_QTCB_CLOSE_PORT:
773 ZFCP_LOG_FLAGS(2, "FSF_QTCB_CLOSE_PORT\n");
774 zfcp_fsf_close_port_handler(fsf_req); 732 zfcp_fsf_close_port_handler(fsf_req);
775 break; 733 break;
776 734
777 case FSF_QTCB_CLOSE_PHYSICAL_PORT: 735 case FSF_QTCB_CLOSE_PHYSICAL_PORT:
778 ZFCP_LOG_FLAGS(2, "FSF_QTCB_CLOSE_PHYSICAL_PORT\n");
779 zfcp_fsf_close_physical_port_handler(fsf_req); 736 zfcp_fsf_close_physical_port_handler(fsf_req);
780 break; 737 break;
781 738
782 case FSF_QTCB_EXCHANGE_CONFIG_DATA: 739 case FSF_QTCB_EXCHANGE_CONFIG_DATA:
783 ZFCP_LOG_FLAGS(2, "FSF_QTCB_EXCHANGE_CONFIG_DATA\n");
784 zfcp_fsf_exchange_config_data_handler(fsf_req); 740 zfcp_fsf_exchange_config_data_handler(fsf_req);
785 break; 741 break;
786 742
787 case FSF_QTCB_EXCHANGE_PORT_DATA: 743 case FSF_QTCB_EXCHANGE_PORT_DATA:
788 ZFCP_LOG_FLAGS(2, "FSF_QTCB_EXCHANGE_PORT_DATA\n");
789 zfcp_fsf_exchange_port_data_handler(fsf_req); 744 zfcp_fsf_exchange_port_data_handler(fsf_req);
790 break; 745 break;
791 746
792 case FSF_QTCB_SEND_ELS: 747 case FSF_QTCB_SEND_ELS:
793 ZFCP_LOG_FLAGS(2, "FSF_QTCB_SEND_ELS\n");
794 zfcp_fsf_send_els_handler(fsf_req); 748 zfcp_fsf_send_els_handler(fsf_req);
795 break; 749 break;
796 750
797 case FSF_QTCB_DOWNLOAD_CONTROL_FILE: 751 case FSF_QTCB_DOWNLOAD_CONTROL_FILE:
798 ZFCP_LOG_FLAGS(2, "FSF_QTCB_DOWNLOAD_CONTROL_FILE\n");
799 zfcp_fsf_control_file_handler(fsf_req); 752 zfcp_fsf_control_file_handler(fsf_req);
800 break; 753 break;
801 754
802 case FSF_QTCB_UPLOAD_CONTROL_FILE: 755 case FSF_QTCB_UPLOAD_CONTROL_FILE:
803 ZFCP_LOG_FLAGS(2, "FSF_QTCB_UPLOAD_CONTROL_FILE\n");
804 zfcp_fsf_control_file_handler(fsf_req); 756 zfcp_fsf_control_file_handler(fsf_req);
805 break; 757 break;
806 758
807 default: 759 default:
808 ZFCP_LOG_FLAGS(2, "FSF_QTCB_UNKNOWN\n");
809 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 760 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
810 ZFCP_LOG_NORMAL("bug: Command issued by the device driver is " 761 ZFCP_LOG_NORMAL("bug: Command issued by the device driver is "
811 "not supported by the adapter %s\n", 762 "not supported by the adapter %s\n",
@@ -929,13 +880,11 @@ zfcp_fsf_status_read_port_closed(struct zfcp_fsf_req *fsf_req)
929 switch (status_buffer->status_subtype) { 880 switch (status_buffer->status_subtype) {
930 881
931 case FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT: 882 case FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT:
932 ZFCP_LOG_FLAGS(2, "FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT\n");
933 debug_text_event(adapter->erp_dbf, 3, "unsol_pc_phys:"); 883 debug_text_event(adapter->erp_dbf, 3, "unsol_pc_phys:");
934 zfcp_erp_port_reopen(port, 0); 884 zfcp_erp_port_reopen(port, 0);
935 break; 885 break;
936 886
937 case FSF_STATUS_READ_SUB_ERROR_PORT: 887 case FSF_STATUS_READ_SUB_ERROR_PORT:
938 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_SUB_ERROR_PORT\n");
939 debug_text_event(adapter->erp_dbf, 1, "unsol_pc_err:"); 888 debug_text_event(adapter->erp_dbf, 1, "unsol_pc_err:");
940 zfcp_erp_port_shutdown(port, 0); 889 zfcp_erp_port_shutdown(port, 0);
941 break; 890 break;
@@ -973,14 +922,13 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
973 922
974 if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) { 923 if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) {
975 mempool_free(status_buffer, adapter->pool.data_status_read); 924 mempool_free(status_buffer, adapter->pool.data_status_read);
976 zfcp_fsf_req_cleanup(fsf_req); 925 zfcp_fsf_req_free(fsf_req);
977 goto out; 926 goto out;
978 } 927 }
979 928
980 switch (status_buffer->status_type) { 929 switch (status_buffer->status_type) {
981 930
982 case FSF_STATUS_READ_PORT_CLOSED: 931 case FSF_STATUS_READ_PORT_CLOSED:
983 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_PORT_CLOSED\n");
984 debug_text_event(adapter->erp_dbf, 3, "unsol_pclosed:"); 932 debug_text_event(adapter->erp_dbf, 3, "unsol_pclosed:");
985 debug_event(adapter->erp_dbf, 3, 933 debug_event(adapter->erp_dbf, 3,
986 &status_buffer->d_id, sizeof (u32)); 934 &status_buffer->d_id, sizeof (u32));
@@ -988,13 +936,11 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
988 break; 936 break;
989 937
990 case FSF_STATUS_READ_INCOMING_ELS: 938 case FSF_STATUS_READ_INCOMING_ELS:
991 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_INCOMING_ELS\n");
992 debug_text_event(adapter->erp_dbf, 3, "unsol_els:"); 939 debug_text_event(adapter->erp_dbf, 3, "unsol_els:");
993 zfcp_fsf_incoming_els(fsf_req); 940 zfcp_fsf_incoming_els(fsf_req);
994 break; 941 break;
995 942
996 case FSF_STATUS_READ_SENSE_DATA_AVAIL: 943 case FSF_STATUS_READ_SENSE_DATA_AVAIL:
997 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_SENSE_DATA_AVAIL\n");
998 debug_text_event(adapter->erp_dbf, 3, "unsol_sense:"); 944 debug_text_event(adapter->erp_dbf, 3, "unsol_sense:");
999 ZFCP_LOG_INFO("unsolicited sense data received (adapter %s)\n", 945 ZFCP_LOG_INFO("unsolicited sense data received (adapter %s)\n",
1000 zfcp_get_busid_by_adapter(adapter)); 946 zfcp_get_busid_by_adapter(adapter));
@@ -1003,7 +949,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
1003 break; 949 break;
1004 950
1005 case FSF_STATUS_READ_BIT_ERROR_THRESHOLD: 951 case FSF_STATUS_READ_BIT_ERROR_THRESHOLD:
1006 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_BIT_ERROR_THRESHOLD\n");
1007 debug_text_event(adapter->erp_dbf, 3, "unsol_bit_err:"); 952 debug_text_event(adapter->erp_dbf, 3, "unsol_bit_err:");
1008 ZFCP_LOG_NORMAL("Bit error threshold data received:\n"); 953 ZFCP_LOG_NORMAL("Bit error threshold data received:\n");
1009 ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL, 954 ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL,
@@ -1012,7 +957,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
1012 break; 957 break;
1013 958
1014 case FSF_STATUS_READ_LINK_DOWN: 959 case FSF_STATUS_READ_LINK_DOWN:
1015 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_LINK_DOWN\n");
1016 debug_text_event(adapter->erp_dbf, 0, "unsol_link_down:"); 960 debug_text_event(adapter->erp_dbf, 0, "unsol_link_down:");
1017 ZFCP_LOG_INFO("Local link to adapter %s is down\n", 961 ZFCP_LOG_INFO("Local link to adapter %s is down\n",
1018 zfcp_get_busid_by_adapter(adapter)); 962 zfcp_get_busid_by_adapter(adapter));
@@ -1022,7 +966,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
1022 break; 966 break;
1023 967
1024 case FSF_STATUS_READ_LINK_UP: 968 case FSF_STATUS_READ_LINK_UP:
1025 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_LINK_UP\n");
1026 debug_text_event(adapter->erp_dbf, 2, "unsol_link_up:"); 969 debug_text_event(adapter->erp_dbf, 2, "unsol_link_up:");
1027 ZFCP_LOG_INFO("Local link to adapter %s was replugged. " 970 ZFCP_LOG_INFO("Local link to adapter %s was replugged. "
1028 "Restarting operations on this adapter\n", 971 "Restarting operations on this adapter\n",
@@ -1037,7 +980,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
1037 break; 980 break;
1038 981
1039 case FSF_STATUS_READ_CFDC_UPDATED: 982 case FSF_STATUS_READ_CFDC_UPDATED:
1040 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_CFDC_UPDATED\n");
1041 debug_text_event(adapter->erp_dbf, 2, "unsol_cfdc_update:"); 983 debug_text_event(adapter->erp_dbf, 2, "unsol_cfdc_update:");
1042 ZFCP_LOG_INFO("CFDC has been updated on the adapter %s\n", 984 ZFCP_LOG_INFO("CFDC has been updated on the adapter %s\n",
1043 zfcp_get_busid_by_adapter(adapter)); 985 zfcp_get_busid_by_adapter(adapter));
@@ -1045,7 +987,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
1045 break; 987 break;
1046 988
1047 case FSF_STATUS_READ_CFDC_HARDENED: 989 case FSF_STATUS_READ_CFDC_HARDENED:
1048 ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_CFDC_HARDENED\n");
1049 debug_text_event(adapter->erp_dbf, 2, "unsol_cfdc_harden:"); 990 debug_text_event(adapter->erp_dbf, 2, "unsol_cfdc_harden:");
1050 switch (status_buffer->status_subtype) { 991 switch (status_buffer->status_subtype) {
1051 case FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE: 992 case FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE:
@@ -1078,7 +1019,7 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req)
1078 break; 1019 break;
1079 } 1020 }
1080 mempool_free(status_buffer, adapter->pool.data_status_read); 1021 mempool_free(status_buffer, adapter->pool.data_status_read);
1081 zfcp_fsf_req_cleanup(fsf_req); 1022 zfcp_fsf_req_free(fsf_req);
1082 /* 1023 /*
1083 * recycle buffer and start new request repeat until outbound 1024 * recycle buffer and start new request repeat until outbound
1084 * queue is empty or adapter shutdown is requested 1025 * queue is empty or adapter shutdown is requested
@@ -1214,7 +1155,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1214 1155
1215 case FSF_PORT_HANDLE_NOT_VALID: 1156 case FSF_PORT_HANDLE_NOT_VALID:
1216 if (status_qual >> 4 != status_qual % 0xf) { 1157 if (status_qual >> 4 != status_qual % 0xf) {
1217 ZFCP_LOG_FLAGS(2, "FSF_PORT_HANDLE_NOT_VALID\n");
1218 debug_text_event(new_fsf_req->adapter->erp_dbf, 3, 1158 debug_text_event(new_fsf_req->adapter->erp_dbf, 3,
1219 "fsf_s_phand_nv0"); 1159 "fsf_s_phand_nv0");
1220 /* 1160 /*
@@ -1223,7 +1163,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1223 * fine. 1163 * fine.
1224 */ 1164 */
1225 } else { 1165 } else {
1226 ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n");
1227 ZFCP_LOG_INFO("Temporary port identifier 0x%x for " 1166 ZFCP_LOG_INFO("Temporary port identifier 0x%x for "
1228 "port 0x%016Lx on adapter %s invalid. " 1167 "port 0x%016Lx on adapter %s invalid. "
1229 "This may happen occasionally.\n", 1168 "This may happen occasionally.\n",
@@ -1246,7 +1185,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1246 case FSF_LUN_HANDLE_NOT_VALID: 1185 case FSF_LUN_HANDLE_NOT_VALID:
1247 if (status_qual >> 4 != status_qual % 0xf) { 1186 if (status_qual >> 4 != status_qual % 0xf) {
1248 /* 2 */ 1187 /* 2 */
1249 ZFCP_LOG_FLAGS(0, "FSF_LUN_HANDLE_NOT_VALID\n");
1250 debug_text_event(new_fsf_req->adapter->erp_dbf, 3, 1188 debug_text_event(new_fsf_req->adapter->erp_dbf, 3,
1251 "fsf_s_lhand_nv0"); 1189 "fsf_s_lhand_nv0");
1252 /* 1190 /*
@@ -1255,7 +1193,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1255 * This is fine. 1193 * This is fine.
1256 */ 1194 */
1257 } else { 1195 } else {
1258 ZFCP_LOG_FLAGS(1, "FSF_LUN_HANDLE_NOT_VALID\n");
1259 ZFCP_LOG_INFO 1196 ZFCP_LOG_INFO
1260 ("Warning: Temporary LUN identifier 0x%x of LUN " 1197 ("Warning: Temporary LUN identifier 0x%x of LUN "
1261 "0x%016Lx on port 0x%016Lx on adapter %s is " 1198 "0x%016Lx on port 0x%016Lx on adapter %s is "
@@ -1279,7 +1216,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1279 break; 1216 break;
1280 1217
1281 case FSF_FCP_COMMAND_DOES_NOT_EXIST: 1218 case FSF_FCP_COMMAND_DOES_NOT_EXIST:
1282 ZFCP_LOG_FLAGS(2, "FSF_FCP_COMMAND_DOES_NOT_EXIST\n");
1283 retval = 0; 1219 retval = 0;
1284 debug_text_event(new_fsf_req->adapter->erp_dbf, 3, 1220 debug_text_event(new_fsf_req->adapter->erp_dbf, 3,
1285 "fsf_s_no_exist"); 1221 "fsf_s_no_exist");
@@ -1287,50 +1223,37 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1287 break; 1223 break;
1288 1224
1289 case FSF_PORT_BOXED: 1225 case FSF_PORT_BOXED:
1290 /* 2 */
1291 ZFCP_LOG_FLAGS(0, "FSF_PORT_BOXED\n");
1292 ZFCP_LOG_INFO("Remote port 0x%016Lx on adapter %s needs to " 1226 ZFCP_LOG_INFO("Remote port 0x%016Lx on adapter %s needs to "
1293 "be reopened\n", unit->port->wwpn, 1227 "be reopened\n", unit->port->wwpn,
1294 zfcp_get_busid_by_unit(unit)); 1228 zfcp_get_busid_by_unit(unit));
1295 debug_text_event(new_fsf_req->adapter->erp_dbf, 2, 1229 debug_text_event(new_fsf_req->adapter->erp_dbf, 2,
1296 "fsf_s_pboxed"); 1230 "fsf_s_pboxed");
1297 zfcp_erp_port_reopen(unit->port, 0); 1231 zfcp_erp_port_boxed(unit->port);
1298 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR 1232 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
1299 | ZFCP_STATUS_FSFREQ_RETRY; 1233 | ZFCP_STATUS_FSFREQ_RETRY;
1300 break; 1234 break;
1301 1235
1302 case FSF_LUN_BOXED: 1236 case FSF_LUN_BOXED:
1303 ZFCP_LOG_FLAGS(0, "FSF_LUN_BOXED\n");
1304 ZFCP_LOG_INFO( 1237 ZFCP_LOG_INFO(
1305 "unit 0x%016Lx on port 0x%016Lx on adapter %s needs " 1238 "unit 0x%016Lx on port 0x%016Lx on adapter %s needs "
1306 "to be reopened\n", 1239 "to be reopened\n",
1307 unit->fcp_lun, unit->port->wwpn, 1240 unit->fcp_lun, unit->port->wwpn,
1308 zfcp_get_busid_by_unit(unit)); 1241 zfcp_get_busid_by_unit(unit));
1309 debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); 1242 debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed");
1310 zfcp_erp_unit_reopen(unit, 0); 1243 zfcp_erp_unit_boxed(unit);
1311 zfcp_cmd_dbf_event_fsf("unitbox", new_fsf_req,
1312 &new_fsf_req->qtcb->header.fsf_status_qual,
1313 sizeof(union fsf_status_qual));
1314 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR 1244 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
1315 | ZFCP_STATUS_FSFREQ_RETRY; 1245 | ZFCP_STATUS_FSFREQ_RETRY;
1316 break; 1246 break;
1317 1247
1318 case FSF_ADAPTER_STATUS_AVAILABLE: 1248 case FSF_ADAPTER_STATUS_AVAILABLE:
1319 /* 2 */
1320 ZFCP_LOG_FLAGS(0, "FSF_ADAPTER_STATUS_AVAILABLE\n");
1321 switch (new_fsf_req->qtcb->header.fsf_status_qual.word[0]) { 1249 switch (new_fsf_req->qtcb->header.fsf_status_qual.word[0]) {
1322 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 1250 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
1323 ZFCP_LOG_FLAGS(2,
1324 "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
1325 debug_text_event(new_fsf_req->adapter->erp_dbf, 1, 1251 debug_text_event(new_fsf_req->adapter->erp_dbf, 1,
1326 "fsf_sq_ltest"); 1252 "fsf_sq_ltest");
1327 /* reopening link to port */ 1253 zfcp_test_link(unit->port);
1328 zfcp_erp_port_reopen(unit->port, 0);
1329 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1254 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1330 break; 1255 break;
1331 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 1256 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
1332 ZFCP_LOG_FLAGS(2,
1333 "FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n");
1334 /* SCSI stack will escalate */ 1257 /* SCSI stack will escalate */
1335 debug_text_event(new_fsf_req->adapter->erp_dbf, 1, 1258 debug_text_event(new_fsf_req->adapter->erp_dbf, 1,
1336 "fsf_sq_ulp"); 1259 "fsf_sq_ulp");
@@ -1350,8 +1273,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
1350 break; 1273 break;
1351 1274
1352 case FSF_GOOD: 1275 case FSF_GOOD:
1353 /* 3 */
1354 ZFCP_LOG_FLAGS(0, "FSF_GOOD\n");
1355 retval = 0; 1276 retval = 0;
1356 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED; 1277 new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED;
1357 break; 1278 break;
@@ -1553,12 +1474,10 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1553 switch (header->fsf_status) { 1474 switch (header->fsf_status) {
1554 1475
1555 case FSF_GOOD: 1476 case FSF_GOOD:
1556 ZFCP_LOG_FLAGS(2,"FSF_GOOD\n");
1557 retval = 0; 1477 retval = 0;
1558 break; 1478 break;
1559 1479
1560 case FSF_SERVICE_CLASS_NOT_SUPPORTED: 1480 case FSF_SERVICE_CLASS_NOT_SUPPORTED:
1561 ZFCP_LOG_FLAGS(2, "FSF_SERVICE_CLASS_NOT_SUPPORTED\n");
1562 if (adapter->fc_service_class <= 3) { 1481 if (adapter->fc_service_class <= 3) {
1563 ZFCP_LOG_INFO("error: adapter %s does not support fc " 1482 ZFCP_LOG_INFO("error: adapter %s does not support fc "
1564 "class %d.\n", 1483 "class %d.\n",
@@ -1578,17 +1497,14 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1578 break; 1497 break;
1579 1498
1580 case FSF_ADAPTER_STATUS_AVAILABLE: 1499 case FSF_ADAPTER_STATUS_AVAILABLE:
1581 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
1582 switch (header->fsf_status_qual.word[0]){ 1500 switch (header->fsf_status_qual.word[0]){
1583 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 1501 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
1584 ZFCP_LOG_FLAGS(2,"FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
1585 /* reopening link to port */ 1502 /* reopening link to port */
1586 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest"); 1503 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest");
1587 zfcp_test_link(port); 1504 zfcp_test_link(port);
1588 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1505 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1589 break; 1506 break;
1590 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 1507 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
1591 ZFCP_LOG_FLAGS(2,"FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n");
1592 /* ERP strategy will escalate */ 1508 /* ERP strategy will escalate */
1593 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ulp"); 1509 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ulp");
1594 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1510 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
@@ -1602,7 +1518,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1602 break; 1518 break;
1603 1519
1604 case FSF_ACCESS_DENIED: 1520 case FSF_ACCESS_DENIED:
1605 ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n");
1606 ZFCP_LOG_NORMAL("access denied, cannot send generic service " 1521 ZFCP_LOG_NORMAL("access denied, cannot send generic service "
1607 "command (adapter %s, port d_id=0x%08x)\n", 1522 "command (adapter %s, port d_id=0x%08x)\n",
1608 zfcp_get_busid_by_port(port), port->d_id); 1523 zfcp_get_busid_by_port(port), port->d_id);
@@ -1625,7 +1540,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1625 break; 1540 break;
1626 1541
1627 case FSF_GENERIC_COMMAND_REJECTED: 1542 case FSF_GENERIC_COMMAND_REJECTED:
1628 ZFCP_LOG_FLAGS(2, "FSF_GENERIC_COMMAND_REJECTED\n");
1629 ZFCP_LOG_INFO("generic service command rejected " 1543 ZFCP_LOG_INFO("generic service command rejected "
1630 "(adapter %s, port d_id=0x%08x)\n", 1544 "(adapter %s, port d_id=0x%08x)\n",
1631 zfcp_get_busid_by_port(port), port->d_id); 1545 zfcp_get_busid_by_port(port), port->d_id);
@@ -1638,7 +1552,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1638 break; 1552 break;
1639 1553
1640 case FSF_PORT_HANDLE_NOT_VALID: 1554 case FSF_PORT_HANDLE_NOT_VALID:
1641 ZFCP_LOG_FLAGS(2, "FSF_PORT_HANDLE_NOT_VALID\n");
1642 ZFCP_LOG_DEBUG("Temporary port identifier 0x%x for port " 1555 ZFCP_LOG_DEBUG("Temporary port identifier 0x%x for port "
1643 "0x%016Lx on adapter %s invalid. This may " 1556 "0x%016Lx on adapter %s invalid. This may "
1644 "happen occasionally.\n", port->handle, 1557 "happen occasionally.\n", port->handle,
@@ -1653,12 +1566,11 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1653 break; 1566 break;
1654 1567
1655 case FSF_PORT_BOXED: 1568 case FSF_PORT_BOXED:
1656 ZFCP_LOG_FLAGS(2, "FSF_PORT_BOXED\n");
1657 ZFCP_LOG_INFO("port needs to be reopened " 1569 ZFCP_LOG_INFO("port needs to be reopened "
1658 "(adapter %s, port d_id=0x%08x)\n", 1570 "(adapter %s, port d_id=0x%08x)\n",
1659 zfcp_get_busid_by_port(port), port->d_id); 1571 zfcp_get_busid_by_port(port), port->d_id);
1660 debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); 1572 debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed");
1661 zfcp_erp_port_reopen(port, 0); 1573 zfcp_erp_port_boxed(port);
1662 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR 1574 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
1663 | ZFCP_STATUS_FSFREQ_RETRY; 1575 | ZFCP_STATUS_FSFREQ_RETRY;
1664 break; 1576 break;
@@ -1666,7 +1578,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1666 /* following states should never occure, all cases avoided 1578 /* following states should never occure, all cases avoided
1667 in zfcp_fsf_send_ct - but who knows ... */ 1579 in zfcp_fsf_send_ct - but who knows ... */
1668 case FSF_PAYLOAD_SIZE_MISMATCH: 1580 case FSF_PAYLOAD_SIZE_MISMATCH:
1669 ZFCP_LOG_FLAGS(2, "FSF_PAYLOAD_SIZE_MISMATCH\n");
1670 ZFCP_LOG_INFO("payload size mismatch (adapter: %s, " 1581 ZFCP_LOG_INFO("payload size mismatch (adapter: %s, "
1671 "req_buf_length=%d, resp_buf_length=%d)\n", 1582 "req_buf_length=%d, resp_buf_length=%d)\n",
1672 zfcp_get_busid_by_adapter(adapter), 1583 zfcp_get_busid_by_adapter(adapter),
@@ -1674,7 +1585,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1674 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1585 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1675 break; 1586 break;
1676 case FSF_REQUEST_SIZE_TOO_LARGE: 1587 case FSF_REQUEST_SIZE_TOO_LARGE:
1677 ZFCP_LOG_FLAGS(2, "FSF_REQUEST_SIZE_TOO_LARGE\n");
1678 ZFCP_LOG_INFO("request size too large (adapter: %s, " 1588 ZFCP_LOG_INFO("request size too large (adapter: %s, "
1679 "req_buf_length=%d)\n", 1589 "req_buf_length=%d)\n",
1680 zfcp_get_busid_by_adapter(adapter), 1590 zfcp_get_busid_by_adapter(adapter),
@@ -1682,7 +1592,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1682 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1592 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1683 break; 1593 break;
1684 case FSF_RESPONSE_SIZE_TOO_LARGE: 1594 case FSF_RESPONSE_SIZE_TOO_LARGE:
1685 ZFCP_LOG_FLAGS(2, "FSF_RESPONSE_SIZE_TOO_LARGE\n");
1686 ZFCP_LOG_INFO("response size too large (adapter: %s, " 1595 ZFCP_LOG_INFO("response size too large (adapter: %s, "
1687 "resp_buf_length=%d)\n", 1596 "resp_buf_length=%d)\n",
1688 zfcp_get_busid_by_adapter(adapter), 1597 zfcp_get_busid_by_adapter(adapter),
@@ -1690,7 +1599,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req)
1690 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1599 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1691 break; 1600 break;
1692 case FSF_SBAL_MISMATCH: 1601 case FSF_SBAL_MISMATCH:
1693 ZFCP_LOG_FLAGS(2, "FSF_SBAL_MISMATCH\n");
1694 ZFCP_LOG_INFO("SBAL mismatch (adapter: %s, req_buf_length=%d, " 1602 ZFCP_LOG_INFO("SBAL mismatch (adapter: %s, req_buf_length=%d, "
1695 "resp_buf_length=%d)\n", 1603 "resp_buf_length=%d)\n",
1696 zfcp_get_busid_by_adapter(adapter), 1604 zfcp_get_busid_by_adapter(adapter),
@@ -1846,8 +1754,8 @@ zfcp_fsf_send_els(struct zfcp_send_els *els)
1846static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) 1754static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1847{ 1755{
1848 struct zfcp_adapter *adapter; 1756 struct zfcp_adapter *adapter;
1849 fc_id_t d_id;
1850 struct zfcp_port *port; 1757 struct zfcp_port *port;
1758 fc_id_t d_id;
1851 struct fsf_qtcb_header *header; 1759 struct fsf_qtcb_header *header;
1852 struct fsf_qtcb_bottom_support *bottom; 1760 struct fsf_qtcb_bottom_support *bottom;
1853 struct zfcp_send_els *send_els; 1761 struct zfcp_send_els *send_els;
@@ -1856,6 +1764,7 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1856 1764
1857 send_els = fsf_req->data.send_els; 1765 send_els = fsf_req->data.send_els;
1858 adapter = send_els->adapter; 1766 adapter = send_els->adapter;
1767 port = send_els->port;
1859 d_id = send_els->d_id; 1768 d_id = send_els->d_id;
1860 header = &fsf_req->qtcb->header; 1769 header = &fsf_req->qtcb->header;
1861 bottom = &fsf_req->qtcb->bottom.support; 1770 bottom = &fsf_req->qtcb->bottom.support;
@@ -1866,12 +1775,10 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1866 switch (header->fsf_status) { 1775 switch (header->fsf_status) {
1867 1776
1868 case FSF_GOOD: 1777 case FSF_GOOD:
1869 ZFCP_LOG_FLAGS(2, "FSF_GOOD\n");
1870 retval = 0; 1778 retval = 0;
1871 break; 1779 break;
1872 1780
1873 case FSF_SERVICE_CLASS_NOT_SUPPORTED: 1781 case FSF_SERVICE_CLASS_NOT_SUPPORTED:
1874 ZFCP_LOG_FLAGS(2, "FSF_SERVICE_CLASS_NOT_SUPPORTED\n");
1875 if (adapter->fc_service_class <= 3) { 1782 if (adapter->fc_service_class <= 3) {
1876 ZFCP_LOG_INFO("error: adapter %s does " 1783 ZFCP_LOG_INFO("error: adapter %s does "
1877 "not support fibrechannel class %d.\n", 1784 "not support fibrechannel class %d.\n",
@@ -1891,22 +1798,14 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1891 break; 1798 break;
1892 1799
1893 case FSF_ADAPTER_STATUS_AVAILABLE: 1800 case FSF_ADAPTER_STATUS_AVAILABLE:
1894 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
1895 switch (header->fsf_status_qual.word[0]){ 1801 switch (header->fsf_status_qual.word[0]){
1896 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 1802 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
1897 ZFCP_LOG_FLAGS(2,"FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
1898 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest"); 1803 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest");
1899 if (send_els->ls_code != ZFCP_LS_ADISC) { 1804 if (port && (send_els->ls_code != ZFCP_LS_ADISC))
1900 read_lock(&zfcp_data.config_lock); 1805 zfcp_test_link(port);
1901 port = zfcp_get_port_by_did(adapter, d_id);
1902 if (port)
1903 zfcp_test_link(port);
1904 read_unlock(&zfcp_data.config_lock);
1905 }
1906 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1806 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1907 break; 1807 break;
1908 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 1808 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
1909 ZFCP_LOG_FLAGS(2,"FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n");
1910 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ulp"); 1809 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ulp");
1911 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1810 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1912 retval = 1811 retval =
@@ -1915,7 +1814,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1915 &header->fsf_status_qual.word[2]); 1814 &header->fsf_status_qual.word[2]);
1916 break; 1815 break;
1917 case FSF_SQ_RETRY_IF_POSSIBLE: 1816 case FSF_SQ_RETRY_IF_POSSIBLE:
1918 ZFCP_LOG_FLAGS(2, "FSF_SQ_RETRY_IF_POSSIBLE\n");
1919 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_retry"); 1817 debug_text_event(adapter->erp_dbf, 1, "fsf_sq_retry");
1920 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1818 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
1921 break; 1819 break;
@@ -1928,7 +1826,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1928 break; 1826 break;
1929 1827
1930 case FSF_ELS_COMMAND_REJECTED: 1828 case FSF_ELS_COMMAND_REJECTED:
1931 ZFCP_LOG_FLAGS(2, "FSF_ELS_COMMAND_REJECTED\n");
1932 ZFCP_LOG_INFO("ELS has been rejected because command filter " 1829 ZFCP_LOG_INFO("ELS has been rejected because command filter "
1933 "prohibited sending " 1830 "prohibited sending "
1934 "(adapter: %s, port d_id: 0x%08x)\n", 1831 "(adapter: %s, port d_id: 0x%08x)\n",
@@ -1937,7 +1834,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1937 break; 1834 break;
1938 1835
1939 case FSF_PAYLOAD_SIZE_MISMATCH: 1836 case FSF_PAYLOAD_SIZE_MISMATCH:
1940 ZFCP_LOG_FLAGS(2, "FSF_PAYLOAD_SIZE_MISMATCH\n");
1941 ZFCP_LOG_INFO( 1837 ZFCP_LOG_INFO(
1942 "ELS request size and ELS response size must be either " 1838 "ELS request size and ELS response size must be either "
1943 "both 0, or both greater than 0 " 1839 "both 0, or both greater than 0 "
@@ -1948,7 +1844,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1948 break; 1844 break;
1949 1845
1950 case FSF_REQUEST_SIZE_TOO_LARGE: 1846 case FSF_REQUEST_SIZE_TOO_LARGE:
1951 ZFCP_LOG_FLAGS(2, "FSF_REQUEST_SIZE_TOO_LARGE\n");
1952 ZFCP_LOG_INFO( 1847 ZFCP_LOG_INFO(
1953 "Length of the ELS request buffer, " 1848 "Length of the ELS request buffer, "
1954 "specified in QTCB bottom, " 1849 "specified in QTCB bottom, "
@@ -1960,7 +1855,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1960 break; 1855 break;
1961 1856
1962 case FSF_RESPONSE_SIZE_TOO_LARGE: 1857 case FSF_RESPONSE_SIZE_TOO_LARGE:
1963 ZFCP_LOG_FLAGS(2, "FSF_RESPONSE_SIZE_TOO_LARGE\n");
1964 ZFCP_LOG_INFO( 1858 ZFCP_LOG_INFO(
1965 "Length of the ELS response buffer, " 1859 "Length of the ELS response buffer, "
1966 "specified in QTCB bottom, " 1860 "specified in QTCB bottom, "
@@ -1973,7 +1867,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1973 1867
1974 case FSF_SBAL_MISMATCH: 1868 case FSF_SBAL_MISMATCH:
1975 /* should never occure, avoided in zfcp_fsf_send_els */ 1869 /* should never occure, avoided in zfcp_fsf_send_els */
1976 ZFCP_LOG_FLAGS(2, "FSF_SBAL_MISMATCH\n");
1977 ZFCP_LOG_INFO("SBAL mismatch (adapter: %s, req_buf_length=%d, " 1870 ZFCP_LOG_INFO("SBAL mismatch (adapter: %s, req_buf_length=%d, "
1978 "resp_buf_length=%d)\n", 1871 "resp_buf_length=%d)\n",
1979 zfcp_get_busid_by_adapter(adapter), 1872 zfcp_get_busid_by_adapter(adapter),
@@ -1982,7 +1875,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
1982 break; 1875 break;
1983 1876
1984 case FSF_ACCESS_DENIED: 1877 case FSF_ACCESS_DENIED:
1985 ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n");
1986 ZFCP_LOG_NORMAL("access denied, cannot send ELS command " 1878 ZFCP_LOG_NORMAL("access denied, cannot send ELS command "
1987 "(adapter %s, port d_id=0x%08x)\n", 1879 "(adapter %s, port d_id=0x%08x)\n",
1988 zfcp_get_busid_by_adapter(adapter), d_id); 1880 zfcp_get_busid_by_adapter(adapter), d_id);
@@ -2000,11 +1892,8 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req)
2000 } 1892 }
2001 } 1893 }
2002 debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); 1894 debug_text_event(adapter->erp_dbf, 1, "fsf_s_access");
2003 read_lock(&zfcp_data.config_lock);
2004 port = zfcp_get_port_by_did(adapter, d_id);
2005 if (port != NULL) 1895 if (port != NULL)
2006 zfcp_erp_port_access_denied(port); 1896 zfcp_erp_port_access_denied(port);
2007 read_unlock(&zfcp_data.config_lock);
2008 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 1897 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2009 break; 1898 break;
2010 1899
@@ -2195,14 +2084,11 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req)
2195 switch (fsf_req->qtcb->header.fsf_status) { 2084 switch (fsf_req->qtcb->header.fsf_status) {
2196 2085
2197 case FSF_GOOD: 2086 case FSF_GOOD:
2198 ZFCP_LOG_FLAGS(2, "FSF_GOOD\n");
2199
2200 if (zfcp_fsf_exchange_config_evaluate(fsf_req, 1)) 2087 if (zfcp_fsf_exchange_config_evaluate(fsf_req, 1))
2201 return -EIO; 2088 return -EIO;
2202 2089
2203 switch (adapter->fc_topology) { 2090 switch (adapter->fc_topology) {
2204 case FSF_TOPO_P2P: 2091 case FSF_TOPO_P2P:
2205 ZFCP_LOG_FLAGS(1, "FSF_TOPO_P2P\n");
2206 ZFCP_LOG_NORMAL("Point-to-Point fibrechannel " 2092 ZFCP_LOG_NORMAL("Point-to-Point fibrechannel "
2207 "configuration detected at adapter %s\n" 2093 "configuration detected at adapter %s\n"
2208 "Peer WWNN 0x%016llx, " 2094 "Peer WWNN 0x%016llx, "
@@ -2216,7 +2102,6 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req)
2216 "top-p-to-p"); 2102 "top-p-to-p");
2217 break; 2103 break;
2218 case FSF_TOPO_AL: 2104 case FSF_TOPO_AL:
2219 ZFCP_LOG_FLAGS(1, "FSF_TOPO_AL\n");
2220 ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " 2105 ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel "
2221 "topology detected at adapter %s " 2106 "topology detected at adapter %s "
2222 "unsupported, shutting down adapter\n", 2107 "unsupported, shutting down adapter\n",
@@ -2226,7 +2111,6 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req)
2226 zfcp_erp_adapter_shutdown(adapter, 0); 2111 zfcp_erp_adapter_shutdown(adapter, 0);
2227 return -EIO; 2112 return -EIO;
2228 case FSF_TOPO_FABRIC: 2113 case FSF_TOPO_FABRIC:
2229 ZFCP_LOG_FLAGS(1, "FSF_TOPO_FABRIC\n");
2230 ZFCP_LOG_INFO("Switched fabric fibrechannel " 2114 ZFCP_LOG_INFO("Switched fabric fibrechannel "
2231 "network detected at adapter %s.\n", 2115 "network detected at adapter %s.\n",
2232 zfcp_get_busid_by_adapter(adapter)); 2116 zfcp_get_busid_by_adapter(adapter));
@@ -2357,7 +2241,7 @@ zfcp_fsf_exchange_port_data(struct zfcp_adapter *adapter,
2357 wait_event(fsf_req->completion_wq, 2241 wait_event(fsf_req->completion_wq,
2358 fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); 2242 fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED);
2359 del_timer_sync(timer); 2243 del_timer_sync(timer);
2360 zfcp_fsf_req_cleanup(fsf_req); 2244 zfcp_fsf_req_free(fsf_req);
2361 out: 2245 out:
2362 kfree(timer); 2246 kfree(timer);
2363 return retval; 2247 return retval;
@@ -2379,7 +2263,6 @@ zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req)
2379 2263
2380 switch (fsf_req->qtcb->header.fsf_status) { 2264 switch (fsf_req->qtcb->header.fsf_status) {
2381 case FSF_GOOD: 2265 case FSF_GOOD:
2382 ZFCP_LOG_FLAGS(2,"FSF_GOOD\n");
2383 bottom = &fsf_req->qtcb->bottom.port; 2266 bottom = &fsf_req->qtcb->bottom.port;
2384 memcpy(data, bottom, sizeof(*data)); 2267 memcpy(data, bottom, sizeof(*data));
2385 break; 2268 break;
@@ -2481,7 +2364,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2481 switch (header->fsf_status) { 2364 switch (header->fsf_status) {
2482 2365
2483 case FSF_PORT_ALREADY_OPEN: 2366 case FSF_PORT_ALREADY_OPEN:
2484 ZFCP_LOG_FLAGS(0, "FSF_PORT_ALREADY_OPEN\n");
2485 ZFCP_LOG_NORMAL("bug: remote port 0x%016Lx on adapter %s " 2367 ZFCP_LOG_NORMAL("bug: remote port 0x%016Lx on adapter %s "
2486 "is already open.\n", 2368 "is already open.\n",
2487 port->wwpn, zfcp_get_busid_by_port(port)); 2369 port->wwpn, zfcp_get_busid_by_port(port));
@@ -2494,7 +2376,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2494 break; 2376 break;
2495 2377
2496 case FSF_ACCESS_DENIED: 2378 case FSF_ACCESS_DENIED:
2497 ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n");
2498 ZFCP_LOG_NORMAL("Access denied, cannot open port 0x%016Lx " 2379 ZFCP_LOG_NORMAL("Access denied, cannot open port 0x%016Lx "
2499 "on adapter %s\n", 2380 "on adapter %s\n",
2500 port->wwpn, zfcp_get_busid_by_port(port)); 2381 port->wwpn, zfcp_get_busid_by_port(port));
@@ -2517,7 +2398,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2517 break; 2398 break;
2518 2399
2519 case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED: 2400 case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED:
2520 ZFCP_LOG_FLAGS(1, "FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED\n");
2521 ZFCP_LOG_INFO("error: The FSF adapter is out of resources. " 2401 ZFCP_LOG_INFO("error: The FSF adapter is out of resources. "
2522 "The remote port 0x%016Lx on adapter %s " 2402 "The remote port 0x%016Lx on adapter %s "
2523 "could not be opened. Disabling it.\n", 2403 "could not be opened. Disabling it.\n",
@@ -2529,11 +2409,8 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2529 break; 2409 break;
2530 2410
2531 case FSF_ADAPTER_STATUS_AVAILABLE: 2411 case FSF_ADAPTER_STATUS_AVAILABLE:
2532 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
2533 switch (header->fsf_status_qual.word[0]) { 2412 switch (header->fsf_status_qual.word[0]) {
2534 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 2413 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
2535 ZFCP_LOG_FLAGS(2,
2536 "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
2537 debug_text_event(fsf_req->adapter->erp_dbf, 1, 2414 debug_text_event(fsf_req->adapter->erp_dbf, 1,
2538 "fsf_sq_ltest"); 2415 "fsf_sq_ltest");
2539 /* ERP strategy will escalate */ 2416 /* ERP strategy will escalate */
@@ -2546,7 +2423,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2546 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 2423 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2547 break; 2424 break;
2548 case FSF_SQ_NO_RETRY_POSSIBLE: 2425 case FSF_SQ_NO_RETRY_POSSIBLE:
2549 ZFCP_LOG_FLAGS(0, "FSF_SQ_NO_RETRY_POSSIBLE\n");
2550 ZFCP_LOG_NORMAL("The remote port 0x%016Lx on " 2426 ZFCP_LOG_NORMAL("The remote port 0x%016Lx on "
2551 "adapter %s could not be opened. " 2427 "adapter %s could not be opened. "
2552 "Disabling it.\n", 2428 "Disabling it.\n",
@@ -2572,7 +2448,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2572 break; 2448 break;
2573 2449
2574 case FSF_GOOD: 2450 case FSF_GOOD:
2575 ZFCP_LOG_FLAGS(3, "FSF_GOOD\n");
2576 /* save port handle assigned by FSF */ 2451 /* save port handle assigned by FSF */
2577 port->handle = header->port_handle; 2452 port->handle = header->port_handle;
2578 ZFCP_LOG_INFO("The remote port 0x%016Lx via adapter %s " 2453 ZFCP_LOG_INFO("The remote port 0x%016Lx via adapter %s "
@@ -2582,6 +2457,9 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2582 /* mark port as open */ 2457 /* mark port as open */
2583 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN | 2458 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN |
2584 ZFCP_STATUS_PORT_PHYS_OPEN, &port->status); 2459 ZFCP_STATUS_PORT_PHYS_OPEN, &port->status);
2460 atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED |
2461 ZFCP_STATUS_COMMON_ACCESS_BOXED,
2462 &port->status);
2585 retval = 0; 2463 retval = 0;
2586 /* check whether D_ID has changed during open */ 2464 /* check whether D_ID has changed during open */
2587 /* 2465 /*
@@ -2630,7 +2508,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req)
2630 2508
2631 case FSF_UNKNOWN_OP_SUBTYPE: 2509 case FSF_UNKNOWN_OP_SUBTYPE:
2632 /* should never occure, subtype not set in zfcp_fsf_open_port */ 2510 /* should never occure, subtype not set in zfcp_fsf_open_port */
2633 ZFCP_LOG_FLAGS(2, "FSF_UNKNOWN_OP_SUBTYPE\n");
2634 ZFCP_LOG_INFO("unknown operation subtype (adapter: %s, " 2511 ZFCP_LOG_INFO("unknown operation subtype (adapter: %s, "
2635 "op_subtype=0x%x)\n", 2512 "op_subtype=0x%x)\n",
2636 zfcp_get_busid_by_port(port), 2513 zfcp_get_busid_by_port(port),
@@ -2739,7 +2616,6 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req)
2739 switch (fsf_req->qtcb->header.fsf_status) { 2616 switch (fsf_req->qtcb->header.fsf_status) {
2740 2617
2741 case FSF_PORT_HANDLE_NOT_VALID: 2618 case FSF_PORT_HANDLE_NOT_VALID:
2742 ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n");
2743 ZFCP_LOG_INFO("Temporary port identifier 0x%x for port " 2619 ZFCP_LOG_INFO("Temporary port identifier 0x%x for port "
2744 "0x%016Lx on adapter %s invalid. This may happen " 2620 "0x%016Lx on adapter %s invalid. This may happen "
2745 "occasionally.\n", port->handle, 2621 "occasionally.\n", port->handle,
@@ -2755,7 +2631,6 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req)
2755 break; 2631 break;
2756 2632
2757 case FSF_ADAPTER_STATUS_AVAILABLE: 2633 case FSF_ADAPTER_STATUS_AVAILABLE:
2758 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
2759 /* Note: FSF has actually closed the port in this case. 2634 /* Note: FSF has actually closed the port in this case.
2760 * The status code is just daft. Fingers crossed for a change 2635 * The status code is just daft. Fingers crossed for a change
2761 */ 2636 */
@@ -2763,7 +2638,6 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req)
2763 break; 2638 break;
2764 2639
2765 case FSF_GOOD: 2640 case FSF_GOOD:
2766 ZFCP_LOG_FLAGS(3, "FSF_GOOD\n");
2767 ZFCP_LOG_TRACE("remote port 0x016%Lx on adapter %s closed, " 2641 ZFCP_LOG_TRACE("remote port 0x016%Lx on adapter %s closed, "
2768 "port handle 0x%x\n", port->wwpn, 2642 "port handle 0x%x\n", port->wwpn,
2769 zfcp_get_busid_by_port(port), port->handle); 2643 zfcp_get_busid_by_port(port), port->handle);
@@ -2884,7 +2758,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req)
2884 switch (header->fsf_status) { 2758 switch (header->fsf_status) {
2885 2759
2886 case FSF_PORT_HANDLE_NOT_VALID: 2760 case FSF_PORT_HANDLE_NOT_VALID:
2887 ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n");
2888 ZFCP_LOG_INFO("Temporary port identifier 0x%x invalid" 2761 ZFCP_LOG_INFO("Temporary port identifier 0x%x invalid"
2889 "(adapter %s, port 0x%016Lx). " 2762 "(adapter %s, port 0x%016Lx). "
2890 "This may happen occasionally.\n", 2763 "This may happen occasionally.\n",
@@ -2902,7 +2775,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req)
2902 break; 2775 break;
2903 2776
2904 case FSF_ACCESS_DENIED: 2777 case FSF_ACCESS_DENIED:
2905 ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n");
2906 ZFCP_LOG_NORMAL("Access denied, cannot close " 2778 ZFCP_LOG_NORMAL("Access denied, cannot close "
2907 "physical port 0x%016Lx on adapter %s\n", 2779 "physical port 0x%016Lx on adapter %s\n",
2908 port->wwpn, zfcp_get_busid_by_port(port)); 2780 port->wwpn, zfcp_get_busid_by_port(port));
@@ -2925,32 +2797,26 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req)
2925 break; 2797 break;
2926 2798
2927 case FSF_PORT_BOXED: 2799 case FSF_PORT_BOXED:
2928 ZFCP_LOG_FLAGS(2, "FSF_PORT_BOXED\n");
2929 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter " 2800 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter "
2930 "%s needs to be reopened but it was attempted " 2801 "%s needs to be reopened but it was attempted "
2931 "to close it physically.\n", 2802 "to close it physically.\n",
2932 port->wwpn, 2803 port->wwpn,
2933 zfcp_get_busid_by_port(port)); 2804 zfcp_get_busid_by_port(port));
2934 debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_pboxed"); 2805 debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_pboxed");
2935 zfcp_erp_port_reopen(port, 0); 2806 zfcp_erp_port_boxed(port);
2936 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 2807 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
2937 ZFCP_STATUS_FSFREQ_RETRY; 2808 ZFCP_STATUS_FSFREQ_RETRY;
2938 break; 2809 break;
2939 2810
2940 case FSF_ADAPTER_STATUS_AVAILABLE: 2811 case FSF_ADAPTER_STATUS_AVAILABLE:
2941 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
2942 switch (header->fsf_status_qual.word[0]) { 2812 switch (header->fsf_status_qual.word[0]) {
2943 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 2813 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
2944 ZFCP_LOG_FLAGS(2,
2945 "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
2946 debug_text_event(fsf_req->adapter->erp_dbf, 1, 2814 debug_text_event(fsf_req->adapter->erp_dbf, 1,
2947 "fsf_sq_ltest"); 2815 "fsf_sq_ltest");
2948 /* This will now be escalated by ERP */ 2816 /* This will now be escalated by ERP */
2949 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 2817 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
2950 break; 2818 break;
2951 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 2819 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
2952 ZFCP_LOG_FLAGS(2,
2953 "FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n");
2954 /* ERP strategy will escalate */ 2820 /* ERP strategy will escalate */
2955 debug_text_event(fsf_req->adapter->erp_dbf, 1, 2821 debug_text_event(fsf_req->adapter->erp_dbf, 1,
2956 "fsf_sq_ulp"); 2822 "fsf_sq_ulp");
@@ -2970,7 +2836,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req)
2970 break; 2836 break;
2971 2837
2972 case FSF_GOOD: 2838 case FSF_GOOD:
2973 ZFCP_LOG_FLAGS(3, "FSF_GOOD\n");
2974 ZFCP_LOG_DEBUG("Remote port 0x%016Lx via adapter %s " 2839 ZFCP_LOG_DEBUG("Remote port 0x%016Lx via adapter %s "
2975 "physically closed, port handle 0x%x\n", 2840 "physically closed, port handle 0x%x\n",
2976 port->wwpn, 2841 port->wwpn,
@@ -3116,7 +2981,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3116 switch (header->fsf_status) { 2981 switch (header->fsf_status) {
3117 2982
3118 case FSF_PORT_HANDLE_NOT_VALID: 2983 case FSF_PORT_HANDLE_NOT_VALID:
3119 ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n");
3120 ZFCP_LOG_INFO("Temporary port identifier 0x%x " 2984 ZFCP_LOG_INFO("Temporary port identifier 0x%x "
3121 "for port 0x%016Lx on adapter %s invalid " 2985 "for port 0x%016Lx on adapter %s invalid "
3122 "This may happen occasionally\n", 2986 "This may happen occasionally\n",
@@ -3132,7 +2996,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3132 break; 2996 break;
3133 2997
3134 case FSF_LUN_ALREADY_OPEN: 2998 case FSF_LUN_ALREADY_OPEN:
3135 ZFCP_LOG_FLAGS(0, "FSF_LUN_ALREADY_OPEN\n");
3136 ZFCP_LOG_NORMAL("bug: Attempted to open unit 0x%016Lx on " 2999 ZFCP_LOG_NORMAL("bug: Attempted to open unit 0x%016Lx on "
3137 "remote port 0x%016Lx on adapter %s twice.\n", 3000 "remote port 0x%016Lx on adapter %s twice.\n",
3138 unit->fcp_lun, 3001 unit->fcp_lun,
@@ -3143,7 +3006,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3143 break; 3006 break;
3144 3007
3145 case FSF_ACCESS_DENIED: 3008 case FSF_ACCESS_DENIED:
3146 ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n");
3147 ZFCP_LOG_NORMAL("Access denied, cannot open unit 0x%016Lx on " 3009 ZFCP_LOG_NORMAL("Access denied, cannot open unit 0x%016Lx on "
3148 "remote port 0x%016Lx on adapter %s\n", 3010 "remote port 0x%016Lx on adapter %s\n",
3149 unit->fcp_lun, unit->port->wwpn, 3011 unit->fcp_lun, unit->port->wwpn,
@@ -3169,18 +3031,16 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3169 break; 3031 break;
3170 3032
3171 case FSF_PORT_BOXED: 3033 case FSF_PORT_BOXED:
3172 ZFCP_LOG_FLAGS(2, "FSF_PORT_BOXED\n");
3173 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s " 3034 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s "
3174 "needs to be reopened\n", 3035 "needs to be reopened\n",
3175 unit->port->wwpn, zfcp_get_busid_by_unit(unit)); 3036 unit->port->wwpn, zfcp_get_busid_by_unit(unit));
3176 debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); 3037 debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed");
3177 zfcp_erp_port_reopen(unit->port, 0); 3038 zfcp_erp_port_boxed(unit->port);
3178 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 3039 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
3179 ZFCP_STATUS_FSFREQ_RETRY; 3040 ZFCP_STATUS_FSFREQ_RETRY;
3180 break; 3041 break;
3181 3042
3182 case FSF_LUN_SHARING_VIOLATION: 3043 case FSF_LUN_SHARING_VIOLATION:
3183 ZFCP_LOG_FLAGS(2, "FSF_LUN_SHARING_VIOLATION\n");
3184 if (header->fsf_status_qual.word[0] != 0) { 3044 if (header->fsf_status_qual.word[0] != 0) {
3185 ZFCP_LOG_NORMAL("FCP-LUN 0x%Lx at the remote port " 3045 ZFCP_LOG_NORMAL("FCP-LUN 0x%Lx at the remote port "
3186 "with WWPN 0x%Lx " 3046 "with WWPN 0x%Lx "
@@ -3224,7 +3084,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3224 break; 3084 break;
3225 3085
3226 case FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED: 3086 case FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED:
3227 ZFCP_LOG_FLAGS(1, "FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED\n");
3228 ZFCP_LOG_INFO("error: The adapter ran out of resources. " 3087 ZFCP_LOG_INFO("error: The adapter ran out of resources. "
3229 "There is no handle (temporary port identifier) " 3088 "There is no handle (temporary port identifier) "
3230 "available for unit 0x%016Lx on port 0x%016Lx " 3089 "available for unit 0x%016Lx on port 0x%016Lx "
@@ -3239,20 +3098,15 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3239 break; 3098 break;
3240 3099
3241 case FSF_ADAPTER_STATUS_AVAILABLE: 3100 case FSF_ADAPTER_STATUS_AVAILABLE:
3242 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
3243 switch (header->fsf_status_qual.word[0]) { 3101 switch (header->fsf_status_qual.word[0]) {
3244 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 3102 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
3245 ZFCP_LOG_FLAGS(2,
3246 "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
3247 /* Re-establish link to port */ 3103 /* Re-establish link to port */
3248 debug_text_event(adapter->erp_dbf, 1, 3104 debug_text_event(adapter->erp_dbf, 1,
3249 "fsf_sq_ltest"); 3105 "fsf_sq_ltest");
3250 zfcp_erp_port_reopen(unit->port, 0); 3106 zfcp_test_link(unit->port);
3251 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 3107 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
3252 break; 3108 break;
3253 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 3109 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
3254 ZFCP_LOG_FLAGS(2,
3255 "FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n");
3256 /* ERP strategy will escalate */ 3110 /* ERP strategy will escalate */
3257 debug_text_event(adapter->erp_dbf, 1, 3111 debug_text_event(adapter->erp_dbf, 1,
3258 "fsf_sq_ulp"); 3112 "fsf_sq_ulp");
@@ -3271,7 +3125,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3271 break; 3125 break;
3272 3126
3273 case FSF_INVALID_COMMAND_OPTION: 3127 case FSF_INVALID_COMMAND_OPTION:
3274 ZFCP_LOG_FLAGS(2, "FSF_INVALID_COMMAND_OPTION\n");
3275 ZFCP_LOG_NORMAL( 3128 ZFCP_LOG_NORMAL(
3276 "Invalid option 0x%x has been specified " 3129 "Invalid option 0x%x has been specified "
3277 "in QTCB bottom sent to the adapter %s\n", 3130 "in QTCB bottom sent to the adapter %s\n",
@@ -3282,7 +3135,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3282 break; 3135 break;
3283 3136
3284 case FSF_GOOD: 3137 case FSF_GOOD:
3285 ZFCP_LOG_FLAGS(3, "FSF_GOOD\n");
3286 /* save LUN handle assigned by FSF */ 3138 /* save LUN handle assigned by FSF */
3287 unit->handle = header->lun_handle; 3139 unit->handle = header->lun_handle;
3288 ZFCP_LOG_TRACE("unit 0x%016Lx on remote port 0x%016Lx on " 3140 ZFCP_LOG_TRACE("unit 0x%016Lx on remote port 0x%016Lx on "
@@ -3293,7 +3145,9 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
3293 unit->handle); 3145 unit->handle);
3294 /* mark unit as open */ 3146 /* mark unit as open */
3295 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status); 3147 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status);
3296 3148 atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED |
3149 ZFCP_STATUS_COMMON_ACCESS_BOXED,
3150 &unit->status);
3297 if (adapter->supported_features & FSF_FEATURE_LUN_SHARING){ 3151 if (adapter->supported_features & FSF_FEATURE_LUN_SHARING){
3298 if (!exclusive) 3152 if (!exclusive)
3299 atomic_set_mask(ZFCP_STATUS_UNIT_SHARED, 3153 atomic_set_mask(ZFCP_STATUS_UNIT_SHARED,
@@ -3437,7 +3291,6 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req)
3437 switch (fsf_req->qtcb->header.fsf_status) { 3291 switch (fsf_req->qtcb->header.fsf_status) {
3438 3292
3439 case FSF_PORT_HANDLE_NOT_VALID: 3293 case FSF_PORT_HANDLE_NOT_VALID:
3440 ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n");
3441 ZFCP_LOG_INFO("Temporary port identifier 0x%x for port " 3294 ZFCP_LOG_INFO("Temporary port identifier 0x%x for port "
3442 "0x%016Lx on adapter %s invalid. This may " 3295 "0x%016Lx on adapter %s invalid. This may "
3443 "happen in rare circumstances\n", 3296 "happen in rare circumstances\n",
@@ -3458,7 +3311,6 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req)
3458 break; 3311 break;
3459 3312
3460 case FSF_LUN_HANDLE_NOT_VALID: 3313 case FSF_LUN_HANDLE_NOT_VALID:
3461 ZFCP_LOG_FLAGS(1, "FSF_LUN_HANDLE_NOT_VALID\n");
3462 ZFCP_LOG_INFO("Temporary LUN identifier 0x%x of unit " 3314 ZFCP_LOG_INFO("Temporary LUN identifier 0x%x of unit "
3463 "0x%016Lx on port 0x%016Lx on adapter %s is " 3315 "0x%016Lx on port 0x%016Lx on adapter %s is "
3464 "invalid. This may happen occasionally.\n", 3316 "invalid. This may happen occasionally.\n",
@@ -3480,32 +3332,26 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req)
3480 break; 3332 break;
3481 3333
3482 case FSF_PORT_BOXED: 3334 case FSF_PORT_BOXED:
3483 ZFCP_LOG_FLAGS(2, "FSF_PORT_BOXED\n");
3484 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s " 3335 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s "
3485 "needs to be reopened\n", 3336 "needs to be reopened\n",
3486 unit->port->wwpn, 3337 unit->port->wwpn,
3487 zfcp_get_busid_by_unit(unit)); 3338 zfcp_get_busid_by_unit(unit));
3488 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); 3339 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed");
3489 zfcp_erp_port_reopen(unit->port, 0); 3340 zfcp_erp_port_boxed(unit->port);
3490 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 3341 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
3491 ZFCP_STATUS_FSFREQ_RETRY; 3342 ZFCP_STATUS_FSFREQ_RETRY;
3492 break; 3343 break;
3493 3344
3494 case FSF_ADAPTER_STATUS_AVAILABLE: 3345 case FSF_ADAPTER_STATUS_AVAILABLE:
3495 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
3496 switch (fsf_req->qtcb->header.fsf_status_qual.word[0]) { 3346 switch (fsf_req->qtcb->header.fsf_status_qual.word[0]) {
3497 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 3347 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
3498 ZFCP_LOG_FLAGS(2,
3499 "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
3500 /* re-establish link to port */ 3348 /* re-establish link to port */
3501 debug_text_event(fsf_req->adapter->erp_dbf, 1, 3349 debug_text_event(fsf_req->adapter->erp_dbf, 1,
3502 "fsf_sq_ltest"); 3350 "fsf_sq_ltest");
3503 zfcp_erp_port_reopen(unit->port, 0); 3351 zfcp_test_link(unit->port);
3504 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; 3352 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
3505 break; 3353 break;
3506 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 3354 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
3507 ZFCP_LOG_FLAGS(2,
3508 "FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n");
3509 /* ERP strategy will escalate */ 3355 /* ERP strategy will escalate */
3510 debug_text_event(fsf_req->adapter->erp_dbf, 1, 3356 debug_text_event(fsf_req->adapter->erp_dbf, 1,
3511 "fsf_sq_ulp"); 3357 "fsf_sq_ulp");
@@ -3526,7 +3372,6 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req)
3526 break; 3372 break;
3527 3373
3528 case FSF_GOOD: 3374 case FSF_GOOD:
3529 ZFCP_LOG_FLAGS(3, "FSF_GOOD\n");
3530 ZFCP_LOG_TRACE("unit 0x%016Lx on port 0x%016Lx on adapter %s " 3375 ZFCP_LOG_TRACE("unit 0x%016Lx on port 0x%016Lx on adapter %s "
3531 "closed, port handle 0x%x\n", 3376 "closed, port handle 0x%x\n",
3532 unit->fcp_lun, 3377 unit->fcp_lun,
@@ -3622,7 +3467,6 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
3622 */ 3467 */
3623 switch (scsi_cmnd->sc_data_direction) { 3468 switch (scsi_cmnd->sc_data_direction) {
3624 case DMA_NONE: 3469 case DMA_NONE:
3625 ZFCP_LOG_FLAGS(3, "DMA_NONE\n");
3626 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND; 3470 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND;
3627 /* 3471 /*
3628 * FIXME(qdio): 3472 * FIXME(qdio):
@@ -3632,19 +3476,16 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter,
3632 sbtype = SBAL_FLAGS0_TYPE_READ; 3476 sbtype = SBAL_FLAGS0_TYPE_READ;
3633 break; 3477 break;
3634 case DMA_FROM_DEVICE: 3478 case DMA_FROM_DEVICE:
3635 ZFCP_LOG_FLAGS(3, "DMA_FROM_DEVICE\n");
3636 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_READ; 3479 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_READ;
3637 sbtype = SBAL_FLAGS0_TYPE_READ; 3480 sbtype = SBAL_FLAGS0_TYPE_READ;
3638 fcp_cmnd_iu->rddata = 1; 3481 fcp_cmnd_iu->rddata = 1;
3639 break; 3482 break;
3640 case DMA_TO_DEVICE: 3483 case DMA_TO_DEVICE:
3641 ZFCP_LOG_FLAGS(3, "DMA_TO_DEVICE\n");
3642 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_WRITE; 3484 fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_WRITE;
3643 sbtype = SBAL_FLAGS0_TYPE_WRITE; 3485 sbtype = SBAL_FLAGS0_TYPE_WRITE;
3644 fcp_cmnd_iu->wddata = 1; 3486 fcp_cmnd_iu->wddata = 1;
3645 break; 3487 break;
3646 case DMA_BIDIRECTIONAL: 3488 case DMA_BIDIRECTIONAL:
3647 ZFCP_LOG_FLAGS(0, "DMA_BIDIRECTIONAL not supported\n");
3648 default: 3489 default:
3649 /* 3490 /*
3650 * dummy, catch this condition earlier 3491 * dummy, catch this condition earlier
@@ -3877,7 +3718,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3877 switch (header->fsf_status) { 3718 switch (header->fsf_status) {
3878 3719
3879 case FSF_PORT_HANDLE_NOT_VALID: 3720 case FSF_PORT_HANDLE_NOT_VALID:
3880 ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n");
3881 ZFCP_LOG_INFO("Temporary port identifier 0x%x for port " 3721 ZFCP_LOG_INFO("Temporary port identifier 0x%x for port "
3882 "0x%016Lx on adapter %s invalid\n", 3722 "0x%016Lx on adapter %s invalid\n",
3883 unit->port->handle, 3723 unit->port->handle,
@@ -3892,7 +3732,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3892 break; 3732 break;
3893 3733
3894 case FSF_LUN_HANDLE_NOT_VALID: 3734 case FSF_LUN_HANDLE_NOT_VALID:
3895 ZFCP_LOG_FLAGS(1, "FSF_LUN_HANDLE_NOT_VALID\n");
3896 ZFCP_LOG_INFO("Temporary LUN identifier 0x%x for unit " 3735 ZFCP_LOG_INFO("Temporary LUN identifier 0x%x for unit "
3897 "0x%016Lx on port 0x%016Lx on adapter %s is " 3736 "0x%016Lx on port 0x%016Lx on adapter %s is "
3898 "invalid. This may happen occasionally.\n", 3737 "invalid. This may happen occasionally.\n",
@@ -3911,7 +3750,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3911 break; 3750 break;
3912 3751
3913 case FSF_HANDLE_MISMATCH: 3752 case FSF_HANDLE_MISMATCH:
3914 ZFCP_LOG_FLAGS(0, "FSF_HANDLE_MISMATCH\n");
3915 ZFCP_LOG_NORMAL("bug: The port handle 0x%x has changed " 3753 ZFCP_LOG_NORMAL("bug: The port handle 0x%x has changed "
3916 "unexpectedly. (adapter %s, port 0x%016Lx, " 3754 "unexpectedly. (adapter %s, port 0x%016Lx, "
3917 "unit 0x%016Lx)\n", 3755 "unit 0x%016Lx)\n",
@@ -3934,7 +3772,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3934 break; 3772 break;
3935 3773
3936 case FSF_SERVICE_CLASS_NOT_SUPPORTED: 3774 case FSF_SERVICE_CLASS_NOT_SUPPORTED:
3937 ZFCP_LOG_FLAGS(0, "FSF_SERVICE_CLASS_NOT_SUPPORTED\n");
3938 if (fsf_req->adapter->fc_service_class <= 3) { 3775 if (fsf_req->adapter->fc_service_class <= 3) {
3939 ZFCP_LOG_NORMAL("error: The adapter %s does " 3776 ZFCP_LOG_NORMAL("error: The adapter %s does "
3940 "not support fibrechannel class %d.\n", 3777 "not support fibrechannel class %d.\n",
@@ -3959,7 +3796,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3959 break; 3796 break;
3960 3797
3961 case FSF_FCPLUN_NOT_VALID: 3798 case FSF_FCPLUN_NOT_VALID:
3962 ZFCP_LOG_FLAGS(0, "FSF_FCPLUN_NOT_VALID\n");
3963 ZFCP_LOG_NORMAL("bug: unit 0x%016Lx on port 0x%016Lx on " 3799 ZFCP_LOG_NORMAL("bug: unit 0x%016Lx on port 0x%016Lx on "
3964 "adapter %s does not have correct unit " 3800 "adapter %s does not have correct unit "
3965 "handle 0x%x\n", 3801 "handle 0x%x\n",
@@ -3982,7 +3818,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
3982 break; 3818 break;
3983 3819
3984 case FSF_ACCESS_DENIED: 3820 case FSF_ACCESS_DENIED:
3985 ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n");
3986 ZFCP_LOG_NORMAL("Access denied, cannot send FCP command to " 3821 ZFCP_LOG_NORMAL("Access denied, cannot send FCP command to "
3987 "unit 0x%016Lx on port 0x%016Lx on " 3822 "unit 0x%016Lx on port 0x%016Lx on "
3988 "adapter %s\n", unit->fcp_lun, unit->port->wwpn, 3823 "adapter %s\n", unit->fcp_lun, unit->port->wwpn,
@@ -4006,7 +3841,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
4006 break; 3841 break;
4007 3842
4008 case FSF_DIRECTION_INDICATOR_NOT_VALID: 3843 case FSF_DIRECTION_INDICATOR_NOT_VALID:
4009 ZFCP_LOG_FLAGS(0, "FSF_DIRECTION_INDICATOR_NOT_VALID\n");
4010 ZFCP_LOG_INFO("bug: Invalid data direction given for unit " 3844 ZFCP_LOG_INFO("bug: Invalid data direction given for unit "
4011 "0x%016Lx on port 0x%016Lx on adapter %s " 3845 "0x%016Lx on port 0x%016Lx on adapter %s "
4012 "(debug info %d)\n", 3846 "(debug info %d)\n",
@@ -4026,7 +3860,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
4026 break; 3860 break;
4027 3861
4028 case FSF_CMND_LENGTH_NOT_VALID: 3862 case FSF_CMND_LENGTH_NOT_VALID:
4029 ZFCP_LOG_FLAGS(0, "FSF_CMND_LENGTH_NOT_VALID\n");
4030 ZFCP_LOG_NORMAL 3863 ZFCP_LOG_NORMAL
4031 ("bug: An invalid control-data-block length field " 3864 ("bug: An invalid control-data-block length field "
4032 "was found in a command for unit 0x%016Lx on port " 3865 "was found in a command for unit 0x%016Lx on port "
@@ -4046,69 +3879,43 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
4046 break; 3879 break;
4047 3880
4048 case FSF_PORT_BOXED: 3881 case FSF_PORT_BOXED:
4049 ZFCP_LOG_FLAGS(2, "FSF_PORT_BOXED\n");
4050 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s " 3882 ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s "
4051 "needs to be reopened\n", 3883 "needs to be reopened\n",
4052 unit->port->wwpn, zfcp_get_busid_by_unit(unit)); 3884 unit->port->wwpn, zfcp_get_busid_by_unit(unit));
4053 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); 3885 debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed");
4054 zfcp_erp_port_reopen(unit->port, 0); 3886 zfcp_erp_port_boxed(unit->port);
4055 zfcp_cmd_dbf_event_fsf("portbox", fsf_req,
4056 &header->fsf_status_qual,
4057 sizeof (union fsf_status_qual));
4058 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | 3887 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
4059 ZFCP_STATUS_FSFREQ_RETRY; 3888 ZFCP_STATUS_FSFREQ_RETRY;
4060 break; 3889 break;
4061 3890
4062 case FSF_LUN_BOXED: 3891 case FSF_LUN_BOXED:
4063 ZFCP_LOG_FLAGS(0, "FSF_LUN_BOXED\n");
4064 ZFCP_LOG_NORMAL("unit needs to be reopened (adapter %s, " 3892 ZFCP_LOG_NORMAL("unit needs to be reopened (adapter %s, "
4065 "wwpn=0x%016Lx, fcp_lun=0x%016Lx)\n", 3893 "wwpn=0x%016Lx, fcp_lun=0x%016Lx)\n",
4066 zfcp_get_busid_by_unit(unit), 3894 zfcp_get_busid_by_unit(unit),
4067 unit->port->wwpn, unit->fcp_lun); 3895 unit->port->wwpn, unit->fcp_lun);
4068 debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); 3896 debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed");
4069 zfcp_erp_unit_reopen(unit, 0); 3897 zfcp_erp_unit_boxed(unit);
4070 zfcp_cmd_dbf_event_fsf("unitbox", fsf_req,
4071 &header->fsf_status_qual,
4072 sizeof(union fsf_status_qual));
4073 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR 3898 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR
4074 | ZFCP_STATUS_FSFREQ_RETRY; 3899 | ZFCP_STATUS_FSFREQ_RETRY;
4075 break; 3900 break;
4076 3901
4077 case FSF_ADAPTER_STATUS_AVAILABLE: 3902 case FSF_ADAPTER_STATUS_AVAILABLE:
4078 ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n");
4079 switch (header->fsf_status_qual.word[0]) { 3903 switch (header->fsf_status_qual.word[0]) {
4080 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: 3904 case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
4081 ZFCP_LOG_FLAGS(2,
4082 "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n");
4083 /* re-establish link to port */ 3905 /* re-establish link to port */
4084 debug_text_event(fsf_req->adapter->erp_dbf, 1, 3906 debug_text_event(fsf_req->adapter->erp_dbf, 1,
4085 "fsf_sq_ltest"); 3907 "fsf_sq_ltest");
4086 zfcp_erp_port_reopen(unit->port, 0); 3908 zfcp_test_link(unit->port);
4087 zfcp_cmd_dbf_event_fsf(
4088 "sqltest",
4089 fsf_req,
4090 &header->fsf_status_qual,
4091 sizeof (union fsf_status_qual));
4092 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
4093 break; 3909 break;
4094 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: 3910 case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
4095 ZFCP_LOG_FLAGS(3,
4096 "FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n");
4097 /* FIXME(hw) need proper specs for proper action */ 3911 /* FIXME(hw) need proper specs for proper action */
4098 /* let scsi stack deal with retries and escalation */ 3912 /* let scsi stack deal with retries and escalation */
4099 debug_text_event(fsf_req->adapter->erp_dbf, 1, 3913 debug_text_event(fsf_req->adapter->erp_dbf, 1,
4100 "fsf_sq_ulp"); 3914 "fsf_sq_ulp");
4101 zfcp_cmd_dbf_event_fsf(
4102 "sqdeperp",
4103 fsf_req,
4104 &header->fsf_status_qual,
4105 sizeof (union fsf_status_qual));
4106 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
4107 break; 3915 break;
4108 default: 3916 default:
4109 /* FIXME: shall we consider this a successful transfer? */
4110 ZFCP_LOG_NORMAL 3917 ZFCP_LOG_NORMAL
4111 ("bug: Wrong status qualifier 0x%x arrived.\n", 3918 ("Unknown status qualifier 0x%x arrived.\n",
4112 header->fsf_status_qual.word[0]); 3919 header->fsf_status_qual.word[0]);
4113 debug_text_event(fsf_req->adapter->erp_dbf, 0, 3920 debug_text_event(fsf_req->adapter->erp_dbf, 0,
4114 "fsf_sq_inval:"); 3921 "fsf_sq_inval:");
@@ -4117,14 +3924,13 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
4117 sizeof(u32)); 3924 sizeof(u32));
4118 break; 3925 break;
4119 } 3926 }
3927 fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
4120 break; 3928 break;
4121 3929
4122 case FSF_GOOD: 3930 case FSF_GOOD:
4123 ZFCP_LOG_FLAGS(3, "FSF_GOOD\n");
4124 break; 3931 break;
4125 3932
4126 case FSF_FCP_RSP_AVAILABLE: 3933 case FSF_FCP_RSP_AVAILABLE:
4127 ZFCP_LOG_FLAGS(2, "FSF_FCP_RSP_AVAILABLE\n");
4128 break; 3934 break;
4129 3935
4130 default: 3936 default:
@@ -4217,14 +4023,12 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
4217 ZFCP_LOG_DEBUG("rsp_len is valid\n"); 4023 ZFCP_LOG_DEBUG("rsp_len is valid\n");
4218 switch (fcp_rsp_info[3]) { 4024 switch (fcp_rsp_info[3]) {
4219 case RSP_CODE_GOOD: 4025 case RSP_CODE_GOOD:
4220 ZFCP_LOG_FLAGS(3, "RSP_CODE_GOOD\n");
4221 /* ok, continue */ 4026 /* ok, continue */
4222 ZFCP_LOG_TRACE("no failure or Task Management " 4027 ZFCP_LOG_TRACE("no failure or Task Management "
4223 "Function complete\n"); 4028 "Function complete\n");
4224 set_host_byte(&scpnt->result, DID_OK); 4029 set_host_byte(&scpnt->result, DID_OK);
4225 break; 4030 break;
4226 case RSP_CODE_LENGTH_MISMATCH: 4031 case RSP_CODE_LENGTH_MISMATCH:
4227 ZFCP_LOG_FLAGS(0, "RSP_CODE_LENGTH_MISMATCH\n");
4228 /* hardware bug */ 4032 /* hardware bug */
4229 ZFCP_LOG_NORMAL("bug: FCP response code indictates " 4033 ZFCP_LOG_NORMAL("bug: FCP response code indictates "
4230 "that the fibrechannel protocol data " 4034 "that the fibrechannel protocol data "
@@ -4242,7 +4046,6 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
4242 set_host_byte(&scpnt->result, DID_ERROR); 4046 set_host_byte(&scpnt->result, DID_ERROR);
4243 goto skip_fsfstatus; 4047 goto skip_fsfstatus;
4244 case RSP_CODE_FIELD_INVALID: 4048 case RSP_CODE_FIELD_INVALID:
4245 ZFCP_LOG_FLAGS(0, "RSP_CODE_FIELD_INVALID\n");
4246 /* driver or hardware bug */ 4049 /* driver or hardware bug */
4247 ZFCP_LOG_NORMAL("bug: FCP response code indictates " 4050 ZFCP_LOG_NORMAL("bug: FCP response code indictates "
4248 "that the fibrechannel protocol data " 4051 "that the fibrechannel protocol data "
@@ -4261,7 +4064,6 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
4261 zfcp_cmd_dbf_event_fsf("codeinv", fsf_req, NULL, 0); 4064 zfcp_cmd_dbf_event_fsf("codeinv", fsf_req, NULL, 0);
4262 goto skip_fsfstatus; 4065 goto skip_fsfstatus;
4263 case RSP_CODE_RO_MISMATCH: 4066 case RSP_CODE_RO_MISMATCH:
4264 ZFCP_LOG_FLAGS(0, "RSP_CODE_RO_MISMATCH\n");
4265 /* hardware bug */ 4067 /* hardware bug */
4266 ZFCP_LOG_NORMAL("bug: The FCP response code indicates " 4068 ZFCP_LOG_NORMAL("bug: The FCP response code indicates "
4267 "that conflicting values for the " 4069 "that conflicting values for the "
@@ -4407,13 +4209,11 @@ zfcp_fsf_send_fcp_command_task_management_handler(struct zfcp_fsf_req *fsf_req)
4407 /* check FCP_RSP_INFO */ 4209 /* check FCP_RSP_INFO */
4408 switch (fcp_rsp_info[3]) { 4210 switch (fcp_rsp_info[3]) {
4409 case RSP_CODE_GOOD: 4211 case RSP_CODE_GOOD:
4410 ZFCP_LOG_FLAGS(3, "RSP_CODE_GOOD\n");
4411 /* ok, continue */ 4212 /* ok, continue */
4412 ZFCP_LOG_DEBUG("no failure or Task Management " 4213 ZFCP_LOG_DEBUG("no failure or Task Management "
4413 "Function complete\n"); 4214 "Function complete\n");
4414 break; 4215 break;
4415 case RSP_CODE_TASKMAN_UNSUPP: 4216 case RSP_CODE_TASKMAN_UNSUPP:
4416 ZFCP_LOG_FLAGS(0, "RSP_CODE_TASKMAN_UNSUPP\n");
4417 ZFCP_LOG_NORMAL("bug: A reuested task management function " 4217 ZFCP_LOG_NORMAL("bug: A reuested task management function "
4418 "is not supported on the target device " 4218 "is not supported on the target device "
4419 "unit 0x%016Lx, port 0x%016Lx, adapter %s\n ", 4219 "unit 0x%016Lx, port 0x%016Lx, adapter %s\n ",
@@ -4423,7 +4223,6 @@ zfcp_fsf_send_fcp_command_task_management_handler(struct zfcp_fsf_req *fsf_req)
4423 fsf_req->status |= ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP; 4223 fsf_req->status |= ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP;
4424 break; 4224 break;
4425 case RSP_CODE_TASKMAN_FAILED: 4225 case RSP_CODE_TASKMAN_FAILED:
4426 ZFCP_LOG_FLAGS(0, "RSP_CODE_TASKMAN_FAILED\n");
4427 ZFCP_LOG_NORMAL("bug: A reuested task management function " 4226 ZFCP_LOG_NORMAL("bug: A reuested task management function "
4428 "failed to complete successfully. " 4227 "failed to complete successfully. "
4429 "unit 0x%016Lx, port 0x%016Lx, adapter %s.\n", 4228 "unit 0x%016Lx, port 0x%016Lx, adapter %s.\n",
@@ -4610,7 +4409,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4610 switch (header->fsf_status) { 4409 switch (header->fsf_status) {
4611 4410
4612 case FSF_GOOD: 4411 case FSF_GOOD:
4613 ZFCP_LOG_FLAGS(2, "FSF_GOOD\n");
4614 ZFCP_LOG_NORMAL( 4412 ZFCP_LOG_NORMAL(
4615 "The FSF request has been successfully completed " 4413 "The FSF request has been successfully completed "
4616 "on the adapter %s\n", 4414 "on the adapter %s\n",
@@ -4618,7 +4416,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4618 break; 4416 break;
4619 4417
4620 case FSF_OPERATION_PARTIALLY_SUCCESSFUL: 4418 case FSF_OPERATION_PARTIALLY_SUCCESSFUL:
4621 ZFCP_LOG_FLAGS(2, "FSF_OPERATION_PARTIALLY_SUCCESSFUL\n");
4622 if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) { 4419 if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) {
4623 switch (header->fsf_status_qual.word[0]) { 4420 switch (header->fsf_status_qual.word[0]) {
4624 4421
@@ -4655,7 +4452,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4655 break; 4452 break;
4656 4453
4657 case FSF_AUTHORIZATION_FAILURE: 4454 case FSF_AUTHORIZATION_FAILURE:
4658 ZFCP_LOG_FLAGS(2, "FSF_AUTHORIZATION_FAILURE\n");
4659 ZFCP_LOG_NORMAL( 4455 ZFCP_LOG_NORMAL(
4660 "Adapter %s does not accept privileged commands\n", 4456 "Adapter %s does not accept privileged commands\n",
4661 zfcp_get_busid_by_adapter(adapter)); 4457 zfcp_get_busid_by_adapter(adapter));
@@ -4664,7 +4460,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4664 break; 4460 break;
4665 4461
4666 case FSF_CFDC_ERROR_DETECTED: 4462 case FSF_CFDC_ERROR_DETECTED:
4667 ZFCP_LOG_FLAGS(2, "FSF_CFDC_ERROR_DETECTED\n");
4668 ZFCP_LOG_NORMAL( 4463 ZFCP_LOG_NORMAL(
4669 "Error at position %d in the CFDC, " 4464 "Error at position %d in the CFDC, "
4670 "CFDC is discarded by the adapter %s\n", 4465 "CFDC is discarded by the adapter %s\n",
@@ -4675,7 +4470,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4675 break; 4470 break;
4676 4471
4677 case FSF_CONTROL_FILE_UPDATE_ERROR: 4472 case FSF_CONTROL_FILE_UPDATE_ERROR:
4678 ZFCP_LOG_FLAGS(2, "FSF_CONTROL_FILE_UPDATE_ERROR\n");
4679 ZFCP_LOG_NORMAL( 4473 ZFCP_LOG_NORMAL(
4680 "Adapter %s cannot harden the control file, " 4474 "Adapter %s cannot harden the control file, "
4681 "file is discarded\n", 4475 "file is discarded\n",
@@ -4685,7 +4479,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4685 break; 4479 break;
4686 4480
4687 case FSF_CONTROL_FILE_TOO_LARGE: 4481 case FSF_CONTROL_FILE_TOO_LARGE:
4688 ZFCP_LOG_FLAGS(2, "FSF_CONTROL_FILE_TOO_LARGE\n");
4689 ZFCP_LOG_NORMAL( 4482 ZFCP_LOG_NORMAL(
4690 "Control file is too large, file is discarded " 4483 "Control file is too large, file is discarded "
4691 "by the adapter %s\n", 4484 "by the adapter %s\n",
@@ -4695,7 +4488,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4695 break; 4488 break;
4696 4489
4697 case FSF_ACCESS_CONFLICT_DETECTED: 4490 case FSF_ACCESS_CONFLICT_DETECTED:
4698 ZFCP_LOG_FLAGS(2, "FSF_ACCESS_CONFLICT_DETECTED\n");
4699 if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) 4491 if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE)
4700 ZFCP_LOG_NORMAL( 4492 ZFCP_LOG_NORMAL(
4701 "CFDC has been discarded by the adapter %s, " 4493 "CFDC has been discarded by the adapter %s, "
@@ -4708,7 +4500,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4708 break; 4500 break;
4709 4501
4710 case FSF_CONFLICTS_OVERRULED: 4502 case FSF_CONFLICTS_OVERRULED:
4711 ZFCP_LOG_FLAGS(2, "FSF_CONFLICTS_OVERRULED\n");
4712 if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) 4503 if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE)
4713 ZFCP_LOG_NORMAL( 4504 ZFCP_LOG_NORMAL(
4714 "CFDC has been activated on the adapter %s, " 4505 "CFDC has been activated on the adapter %s, "
@@ -4721,7 +4512,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4721 break; 4512 break;
4722 4513
4723 case FSF_UNKNOWN_OP_SUBTYPE: 4514 case FSF_UNKNOWN_OP_SUBTYPE:
4724 ZFCP_LOG_FLAGS(2, "FSF_UNKNOWN_OP_SUBTYPE\n");
4725 ZFCP_LOG_NORMAL("unknown operation subtype (adapter: %s, " 4515 ZFCP_LOG_NORMAL("unknown operation subtype (adapter: %s, "
4726 "op_subtype=0x%x)\n", 4516 "op_subtype=0x%x)\n",
4727 zfcp_get_busid_by_adapter(adapter), 4517 zfcp_get_busid_by_adapter(adapter),
@@ -4731,7 +4521,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
4731 break; 4521 break;
4732 4522
4733 case FSF_INVALID_COMMAND_OPTION: 4523 case FSF_INVALID_COMMAND_OPTION:
4734 ZFCP_LOG_FLAGS(2, "FSF_INVALID_COMMAND_OPTION\n");
4735 ZFCP_LOG_NORMAL( 4524 ZFCP_LOG_NORMAL(
4736 "Invalid option 0x%x has been specified " 4525 "Invalid option 0x%x has been specified "
4737 "in QTCB bottom sent to the adapter %s\n", 4526 "in QTCB bottom sent to the adapter %s\n",
@@ -4800,7 +4589,7 @@ zfcp_fsf_req_wait_and_cleanup(struct zfcp_fsf_req *fsf_req,
4800 *status = fsf_req->status; 4589 *status = fsf_req->status;
4801 4590
4802 /* cleanup request */ 4591 /* cleanup request */
4803 zfcp_fsf_req_cleanup(fsf_req); 4592 zfcp_fsf_req_free(fsf_req);
4804 out: 4593 out:
4805 return retval; 4594 return retval;
4806} 4595}
@@ -4999,9 +4788,9 @@ zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer)
4999 inc_seq_no = 0; 4788 inc_seq_no = 0;
5000 4789
5001 /* put allocated FSF request at list tail */ 4790 /* put allocated FSF request at list tail */
5002 write_lock_irqsave(&adapter->fsf_req_list_lock, flags); 4791 spin_lock_irqsave(&adapter->fsf_req_list_lock, flags);
5003 list_add_tail(&fsf_req->list, &adapter->fsf_req_list_head); 4792 list_add_tail(&fsf_req->list, &adapter->fsf_req_list_head);
5004 write_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); 4793 spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
5005 4794
5006 /* figure out expiration time of timeout and start timeout */ 4795 /* figure out expiration time of timeout and start timeout */
5007 if (unlikely(timer)) { 4796 if (unlikely(timer)) {
@@ -5045,9 +4834,9 @@ zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer)
5045 */ 4834 */
5046 if (timer) 4835 if (timer)
5047 del_timer(timer); 4836 del_timer(timer);
5048 write_lock_irqsave(&adapter->fsf_req_list_lock, flags); 4837 spin_lock_irqsave(&adapter->fsf_req_list_lock, flags);
5049 list_del(&fsf_req->list); 4838 list_del(&fsf_req->list);
5050 write_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); 4839 spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
5051 /* 4840 /*
5052 * adjust the number of free SBALs in request queue as well as 4841 * adjust the number of free SBALs in request queue as well as
5053 * position of first one 4842 * position of first one
@@ -5085,25 +4874,4 @@ zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer)
5085 return retval; 4874 return retval;
5086} 4875}
5087 4876
5088/*
5089 * function: zfcp_fsf_req_cleanup
5090 *
5091 * purpose: cleans up an FSF request and removes it from the specified list
5092 *
5093 * returns:
5094 *
5095 * assumption: no pending SB in SBALEs other than QTCB
5096 */
5097void
5098zfcp_fsf_req_cleanup(struct zfcp_fsf_req *fsf_req)
5099{
5100 struct zfcp_adapter *adapter = fsf_req->adapter;
5101 unsigned long flags;
5102
5103 write_lock_irqsave(&adapter->fsf_req_list_lock, flags);
5104 list_del(&fsf_req->list);
5105 write_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
5106 zfcp_fsf_req_free(fsf_req);
5107}
5108
5109#undef ZFCP_LOG_AREA 4877#undef ZFCP_LOG_AREA
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
index 06e862d7bc90..24e16ec331d9 100644
--- a/drivers/s390/scsi/zfcp_qdio.c
+++ b/drivers/s390/scsi/zfcp_qdio.c
@@ -229,52 +229,14 @@ zfcp_qdio_handler_error_check(struct zfcp_adapter *adapter,
229 ZFCP_LOG_TRACE("status is" 229 ZFCP_LOG_TRACE("status is"
230 " QDIO_STATUS_OUTBOUND_INT \n"); 230 " QDIO_STATUS_OUTBOUND_INT \n");
231 } 231 }
232 } // if (ZFCP_LOG_CHECK(ZFCP_LOG_LEVEL_TRACE)) 232 }
233 if (unlikely(status & QDIO_STATUS_LOOK_FOR_ERROR)) { 233 if (unlikely(status & QDIO_STATUS_LOOK_FOR_ERROR)) {
234 retval = -EIO; 234 retval = -EIO;
235 235
236 ZFCP_LOG_FLAGS(1, "QDIO_STATUS_LOOK_FOR_ERROR \n");
237
238 ZFCP_LOG_INFO("QDIO problem occurred (status=0x%x, " 236 ZFCP_LOG_INFO("QDIO problem occurred (status=0x%x, "
239 "qdio_error=0x%x, siga_error=0x%x)\n", 237 "qdio_error=0x%x, siga_error=0x%x)\n",
240 status, qdio_error, siga_error); 238 status, qdio_error, siga_error);
241 239
242 if (status & QDIO_STATUS_ACTIVATE_CHECK_CONDITION) {
243 ZFCP_LOG_FLAGS(2,
244 "QDIO_STATUS_ACTIVATE_CHECK_CONDITION\n");
245 }
246 if (status & QDIO_STATUS_MORE_THAN_ONE_QDIO_ERROR) {
247 ZFCP_LOG_FLAGS(2,
248 "QDIO_STATUS_MORE_THAN_ONE_QDIO_ERROR\n");
249 }
250 if (status & QDIO_STATUS_MORE_THAN_ONE_SIGA_ERROR) {
251 ZFCP_LOG_FLAGS(2,
252 "QDIO_STATUS_MORE_THAN_ONE_SIGA_ERROR\n");
253 }
254
255 if (siga_error & QDIO_SIGA_ERROR_ACCESS_EXCEPTION) {
256 ZFCP_LOG_FLAGS(2, "QDIO_SIGA_ERROR_ACCESS_EXCEPTION\n");
257 }
258
259 if (siga_error & QDIO_SIGA_ERROR_B_BIT_SET) {
260 ZFCP_LOG_FLAGS(2, "QDIO_SIGA_ERROR_B_BIT_SET\n");
261 }
262
263 switch (qdio_error) {
264 case 0:
265 ZFCP_LOG_FLAGS(3, "QDIO_OK");
266 break;
267 case SLSB_P_INPUT_ERROR:
268 ZFCP_LOG_FLAGS(1, "SLSB_P_INPUT_ERROR\n");
269 break;
270 case SLSB_P_OUTPUT_ERROR:
271 ZFCP_LOG_FLAGS(1, "SLSB_P_OUTPUT_ERROR\n");
272 break;
273 default:
274 ZFCP_LOG_NORMAL("bug: unknown QDIO error 0x%x\n",
275 qdio_error);
276 break;
277 }
278 /* Restarting IO on the failed adapter from scratch */ 240 /* Restarting IO on the failed adapter from scratch */
279 debug_text_event(adapter->erp_dbf, 1, "qdio_err"); 241 debug_text_event(adapter->erp_dbf, 1, "qdio_err");
280 /* 242 /*
@@ -484,37 +446,37 @@ int
484zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, void *sbale_addr) 446zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, void *sbale_addr)
485{ 447{
486 struct zfcp_fsf_req *fsf_req; 448 struct zfcp_fsf_req *fsf_req;
487 int retval = 0;
488 449
489 /* invalid (per convention used in this driver) */ 450 /* invalid (per convention used in this driver) */
490 if (unlikely(!sbale_addr)) { 451 if (unlikely(!sbale_addr)) {
491 ZFCP_LOG_NORMAL("bug: invalid reqid\n"); 452 ZFCP_LOG_NORMAL("bug: invalid reqid\n");
492 retval = -EINVAL; 453 return -EINVAL;
493 goto out;
494 } 454 }
495 455
496 /* valid request id and thus (hopefully :) valid fsf_req address */ 456 /* valid request id and thus (hopefully :) valid fsf_req address */
497 fsf_req = (struct zfcp_fsf_req *) sbale_addr; 457 fsf_req = (struct zfcp_fsf_req *) sbale_addr;
498 458
459 /* serialize with zfcp_fsf_req_dismiss_all */
460 spin_lock(&adapter->fsf_req_list_lock);
461 if (list_empty(&adapter->fsf_req_list_head)) {
462 spin_unlock(&adapter->fsf_req_list_lock);
463 return 0;
464 }
465 list_del(&fsf_req->list);
466 atomic_dec(&adapter->fsf_reqs_active);
467 spin_unlock(&adapter->fsf_req_list_lock);
468
499 if (unlikely(adapter != fsf_req->adapter)) { 469 if (unlikely(adapter != fsf_req->adapter)) {
500 ZFCP_LOG_NORMAL("bug: invalid reqid (fsf_req=%p, " 470 ZFCP_LOG_NORMAL("bug: invalid reqid (fsf_req=%p, "
501 "fsf_req->adapter=%p, adapter=%p)\n", 471 "fsf_req->adapter=%p, adapter=%p)\n",
502 fsf_req, fsf_req->adapter, adapter); 472 fsf_req, fsf_req->adapter, adapter);
503 retval = -EINVAL; 473 return -EINVAL;
504 goto out;
505 }
506
507 ZFCP_LOG_TRACE("fsf_req at %p, QTCB at %p\n", fsf_req, fsf_req->qtcb);
508 if (likely(fsf_req->qtcb)) {
509 ZFCP_LOG_TRACE("hex dump of QTCB:\n");
510 ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE, (char *) fsf_req->qtcb,
511 sizeof(struct fsf_qtcb));
512 } 474 }
513 475
514 /* finish the FSF request */ 476 /* finish the FSF request */
515 zfcp_fsf_req_complete(fsf_req); 477 zfcp_fsf_req_complete(fsf_req);
516 out: 478
517 return retval; 479 return 0;
518} 480}
519 481
520/** 482/**
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index e21b547fd427..6965992ddbbf 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -433,7 +433,7 @@ zfcp_port_lookup(struct zfcp_adapter *adapter, int channel, scsi_id_t id)
433 * FAILED - otherwise 433 * FAILED - otherwise
434 */ 434 */
435int 435int
436zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) 436__zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
437{ 437{
438 int retval = SUCCESS; 438 int retval = SUCCESS;
439 struct zfcp_fsf_req *new_fsf_req, *old_fsf_req; 439 struct zfcp_fsf_req *new_fsf_req, *old_fsf_req;
@@ -575,7 +575,7 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
575 *(u64 *) & new_fsf_req->qtcb->header.fsf_status_qual.word[0]; 575 *(u64 *) & new_fsf_req->qtcb->header.fsf_status_qual.word[0];
576 dbf_fsf_qual[1] = 576 dbf_fsf_qual[1] =
577 *(u64 *) & new_fsf_req->qtcb->header.fsf_status_qual.word[2]; 577 *(u64 *) & new_fsf_req->qtcb->header.fsf_status_qual.word[2];
578 zfcp_fsf_req_cleanup(new_fsf_req); 578 zfcp_fsf_req_free(new_fsf_req);
579#else 579#else
580 retval = zfcp_fsf_req_wait_and_cleanup(new_fsf_req, 580 retval = zfcp_fsf_req_wait_and_cleanup(new_fsf_req,
581 ZFCP_UNINTERRUPTIBLE, &status); 581 ZFCP_UNINTERRUPTIBLE, &status);
@@ -611,6 +611,17 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
611 return retval; 611 return retval;
612} 612}
613 613
614int
615zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
616{
617 int rc;
618 struct Scsi_Host *scsi_host = scpnt->device->host;
619 spin_lock_irq(scsi_host->host_lock);
620 rc = __zfcp_scsi_eh_abort_handler(scpnt);
621 spin_unlock_irq(scsi_host->host_lock);
622 return rc;
623}
624
614/* 625/*
615 * function: zfcp_scsi_eh_device_reset_handler 626 * function: zfcp_scsi_eh_device_reset_handler
616 * 627 *
@@ -625,8 +636,6 @@ zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt)
625 struct zfcp_unit *unit = (struct zfcp_unit *) scpnt->device->hostdata; 636 struct zfcp_unit *unit = (struct zfcp_unit *) scpnt->device->hostdata;
626 struct Scsi_Host *scsi_host = scpnt->device->host; 637 struct Scsi_Host *scsi_host = scpnt->device->host;
627 638
628 spin_unlock_irq(scsi_host->host_lock);
629
630 if (!unit) { 639 if (!unit) {
631 ZFCP_LOG_NORMAL("bug: Tried reset for nonexistent unit\n"); 640 ZFCP_LOG_NORMAL("bug: Tried reset for nonexistent unit\n");
632 retval = SUCCESS; 641 retval = SUCCESS;
@@ -669,7 +678,6 @@ zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt)
669 retval = SUCCESS; 678 retval = SUCCESS;
670 } 679 }
671 out: 680 out:
672 spin_lock_irq(scsi_host->host_lock);
673 return retval; 681 return retval;
674} 682}
675 683
@@ -723,8 +731,6 @@ zfcp_scsi_eh_bus_reset_handler(struct scsi_cmnd *scpnt)
723 struct zfcp_unit *unit; 731 struct zfcp_unit *unit;
724 struct Scsi_Host *scsi_host = scpnt->device->host; 732 struct Scsi_Host *scsi_host = scpnt->device->host;
725 733
726 spin_unlock_irq(scsi_host->host_lock);
727
728 unit = (struct zfcp_unit *) scpnt->device->hostdata; 734 unit = (struct zfcp_unit *) scpnt->device->hostdata;
729 ZFCP_LOG_NORMAL("bus reset because of problems with " 735 ZFCP_LOG_NORMAL("bus reset because of problems with "
730 "unit 0x%016Lx\n", unit->fcp_lun); 736 "unit 0x%016Lx\n", unit->fcp_lun);
@@ -732,7 +738,6 @@ zfcp_scsi_eh_bus_reset_handler(struct scsi_cmnd *scpnt)
732 zfcp_erp_wait(unit->port->adapter); 738 zfcp_erp_wait(unit->port->adapter);
733 retval = SUCCESS; 739 retval = SUCCESS;
734 740
735 spin_lock_irq(scsi_host->host_lock);
736 return retval; 741 return retval;
737} 742}
738 743
@@ -750,8 +755,6 @@ zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt)
750 struct zfcp_unit *unit; 755 struct zfcp_unit *unit;
751 struct Scsi_Host *scsi_host = scpnt->device->host; 756 struct Scsi_Host *scsi_host = scpnt->device->host;
752 757
753 spin_unlock_irq(scsi_host->host_lock);
754
755 unit = (struct zfcp_unit *) scpnt->device->hostdata; 758 unit = (struct zfcp_unit *) scpnt->device->hostdata;
756 ZFCP_LOG_NORMAL("host reset because of problems with " 759 ZFCP_LOG_NORMAL("host reset because of problems with "
757 "unit 0x%016Lx\n", unit->fcp_lun); 760 "unit 0x%016Lx\n", unit->fcp_lun);
@@ -759,7 +762,6 @@ zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt)
759 zfcp_erp_wait(unit->port->adapter); 762 zfcp_erp_wait(unit->port->adapter);
760 retval = SUCCESS; 763 retval = SUCCESS;
761 764
762 spin_lock_irq(scsi_host->host_lock);
763 return retval; 765 return retval;
764} 766}
765 767