From 6bc9dace767f1fffdf975b3398b3c4e37cd5ae18 Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Fri, 10 Jun 2005 10:16:33 +0200 Subject: [SCSI] zfcp: remove flags_dump feature Removes the rarely used "flags_dump" mechanism of zfcp. Equivalent debug information will be provided with a reworking of zfcp's s390dbf-facilities which is in preparation. Signed-off-by: Andreas Herrmann Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_aux.c | 9 --- drivers/s390/scsi/zfcp_def.h | 14 ---- drivers/s390/scsi/zfcp_fsf.c | 173 ------------------------------------------ drivers/s390/scsi/zfcp_qdio.c | 40 +--------- 4 files changed, 1 insertion(+), 235 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 68d151aaa474..52fc1d789066 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -97,11 +97,6 @@ MODULE_PARM_DESC(loglevel, "FC ERP QDIO CIO Config FSF SCSI Other, " "levels: 0=none 1=normal 2=devel 3=trace"); -#ifdef ZFCP_PRINT_FLAGS -u32 flags_dump = 0; -module_param(flags_dump, uint, 0); -#endif - /****************************************************************/ /************** Functions without logging ***********************/ /****************************************************************/ @@ -1483,19 +1478,15 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter, fcp_rscn_element++; switch (fcp_rscn_element->addr_format) { case ZFCP_PORT_ADDRESS: - ZFCP_LOG_FLAGS(1, "ZFCP_PORT_ADDRESS\n"); range_mask = ZFCP_PORTS_RANGE_PORT; break; case ZFCP_AREA_ADDRESS: - ZFCP_LOG_FLAGS(1, "ZFCP_AREA_ADDRESS\n"); range_mask = ZFCP_PORTS_RANGE_AREA; break; case ZFCP_DOMAIN_ADDRESS: - ZFCP_LOG_FLAGS(1, "ZFCP_DOMAIN_ADDRESS\n"); range_mask = ZFCP_PORTS_RANGE_DOMAIN; break; case ZFCP_FABRIC_ADDRESS: - ZFCP_LOG_FLAGS(1, "ZFCP_FABRIC_ADDRESS\n"); range_mask = ZFCP_PORTS_RANGE_FABRIC; break; default: diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index c5daf372f853..ead324019ff2 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -62,9 +62,6 @@ #include #include -/************************ DEBUG FLAGS *****************************************/ - -#define ZFCP_PRINT_FLAGS /********************* GENERAL DEFINES *********************************/ @@ -472,17 +469,6 @@ do { \ ZFCP_LOG(ZFCP_LOG_LEVEL_TRACE, fmt , ##args) #endif -#ifndef ZFCP_PRINT_FLAGS -# define ZFCP_LOG_FLAGS(level, fmt, args...) -#else -extern u32 flags_dump; -# define ZFCP_LOG_FLAGS(level, fmt, args...) \ -do { \ - if (level <= flags_dump) \ - _ZFCP_LOG(fmt, ##args); \ -} while (0) -#endif - /*************** ADAPTER/PORT/UNIT AND FSF_REQ STATUS FLAGS ******************/ /* diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 148b11c822bf..14aaab82dc96 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -346,15 +346,10 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) switch (fsf_req->qtcb->prefix.prot_status) { case FSF_PROT_GOOD: - ZFCP_LOG_TRACE("FSF_PROT_GOOD\n"); - break; - case FSF_PROT_FSF_STATUS_PRESENTED: - ZFCP_LOG_TRACE("FSF_PROT_FSF_STATUS_PRESENTED\n"); break; case FSF_PROT_QTCB_VERSION_ERROR: - ZFCP_LOG_FLAGS(0, "FSF_PROT_QTCB_VERSION_ERROR\n"); ZFCP_LOG_NORMAL("error: The adapter %s contains " "microcode of version 0x%x, the device driver " "only supports 0x%x. Aborting.\n", @@ -371,7 +366,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) break; case FSF_PROT_SEQ_NUMB_ERROR: - ZFCP_LOG_FLAGS(0, "FSF_PROT_SEQ_NUMB_ERROR\n"); ZFCP_LOG_NORMAL("bug: Sequence number mismatch between " "driver (0x%x) and adapter %s (0x%x). " "Restarting all operations on this adapter.\n", @@ -390,7 +384,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) break; case FSF_PROT_UNSUPP_QTCB_TYPE: - ZFCP_LOG_FLAGS(0, "FSF_PROT_UNSUP_QTCB_TYPE\n"); ZFCP_LOG_NORMAL("error: Packet header type used by the " "device driver is incompatible with " "that used on adapter %s. " @@ -405,7 +398,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) break; case FSF_PROT_HOST_CONNECTION_INITIALIZING: - ZFCP_LOG_FLAGS(1, "FSF_PROT_HOST_CONNECTION_INITIALIZING\n"); zfcp_cmd_dbf_event_fsf("hconinit", fsf_req, &fsf_req->qtcb->prefix.prot_status_qual, sizeof (union fsf_prot_status_qual)); @@ -416,7 +408,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) break; case FSF_PROT_DUPLICATE_REQUEST_ID: - ZFCP_LOG_FLAGS(0, "FSF_PROT_DUPLICATE_REQUEST_IDS\n"); if (fsf_req->qtcb) { ZFCP_LOG_NORMAL("bug: The request identifier 0x%Lx " "to the adapter %s is ambiguous. " @@ -445,7 +436,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) break; case FSF_PROT_LINK_DOWN: - ZFCP_LOG_FLAGS(1, "FSF_PROT_LINK_DOWN\n"); /* * 'test and set' is not atomic here - * it's ok as long as calls to our response queue handler @@ -502,13 +492,11 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) ZFCP_STATUS_COMMON_ERP_FAILED, &adapter->status); zfcp_erp_adapter_reopen(adapter, 0); - debug_text_event(adapter->erp_dbf, 1, "prot_link_down"); } fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_PROT_REEST_QUEUE: - ZFCP_LOG_FLAGS(1, "FSF_PROT_REEST_QUEUE\n"); debug_text_event(adapter->erp_dbf, 1, "prot_reest_queue"); ZFCP_LOG_INFO("The local link to adapter with " "%s was re-plugged. " @@ -528,7 +516,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) break; case FSF_PROT_ERROR_STATE: - ZFCP_LOG_FLAGS(0, "FSF_PROT_ERROR_STATE\n"); ZFCP_LOG_NORMAL("error: The adapter %s " "has entered the error state. " "Restarting all operations on this " @@ -589,7 +576,6 @@ zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *fsf_req) /* evaluate FSF Status */ switch (fsf_req->qtcb->header.fsf_status) { case FSF_UNKNOWN_COMMAND: - ZFCP_LOG_FLAGS(0, "FSF_UNKNOWN_COMMAND\n"); ZFCP_LOG_NORMAL("bug: Command issued by the device driver is " "not known by the adapter %s " "Stopping all operations on this adapter. " @@ -606,14 +592,12 @@ zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *fsf_req) break; case FSF_FCP_RSP_AVAILABLE: - ZFCP_LOG_FLAGS(2, "FSF_FCP_RSP_AVAILABLE\n"); ZFCP_LOG_DEBUG("FCP Sense data will be presented to the " "SCSI stack.\n"); debug_text_event(fsf_req->adapter->erp_dbf, 3, "fsf_s_rsp"); break; case FSF_ADAPTER_STATUS_AVAILABLE: - ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n"); debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_astatus"); zfcp_fsf_fsfstatus_qual_eval(fsf_req); break; @@ -647,11 +631,9 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req) switch (fsf_req->qtcb->header.fsf_status_qual.word[0]) { case FSF_SQ_FCP_RSP_AVAILABLE: - ZFCP_LOG_FLAGS(2, "FSF_SQ_FCP_RSP_AVAILABLE\n"); debug_text_event(fsf_req->adapter->erp_dbf, 4, "fsf_sq_rsp"); break; case FSF_SQ_RETRY_IF_POSSIBLE: - ZFCP_LOG_FLAGS(2, "FSF_SQ_RETRY_IF_POSSIBLE\n"); /* The SCSI-stack may now issue retries or escalate */ debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_sq_retry"); zfcp_cmd_dbf_event_fsf("sqretry", fsf_req, @@ -660,7 +642,6 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req) fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_COMMAND_ABORTED: - ZFCP_LOG_FLAGS(2, "FSF_SQ_COMMAND_ABORTED\n"); /* Carry the aborted state on to upper layer */ debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_sq_abort"); zfcp_cmd_dbf_event_fsf("sqabort", fsf_req, @@ -670,7 +651,6 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req) fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_NO_RECOM: - ZFCP_LOG_FLAGS(0, "FSF_SQ_NO_RECOM\n"); debug_text_exception(fsf_req->adapter->erp_dbf, 0, "fsf_sq_no_rec"); ZFCP_LOG_NORMAL("bug: No recommendation could be given for a" @@ -684,7 +664,6 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req) fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_PROGRAMMING_ERROR: - ZFCP_LOG_FLAGS(0, "FSF_SQ_ULP_PROGRAMMING_ERROR\n"); ZFCP_LOG_NORMAL("error: not enough SBALs for data transfer " "(adapter %s)\n", zfcp_get_busid_by_adapter(fsf_req->adapter)); @@ -740,72 +719,58 @@ zfcp_fsf_req_dispatch(struct zfcp_fsf_req *fsf_req) switch (fsf_req->fsf_command) { case FSF_QTCB_FCP_CMND: - ZFCP_LOG_FLAGS(3, "FSF_QTCB_FCP_CMND\n"); zfcp_fsf_send_fcp_command_handler(fsf_req); break; case FSF_QTCB_ABORT_FCP_CMND: - ZFCP_LOG_FLAGS(2, "FSF_QTCB_ABORT_FCP_CMND\n"); zfcp_fsf_abort_fcp_command_handler(fsf_req); break; case FSF_QTCB_SEND_GENERIC: - ZFCP_LOG_FLAGS(2, "FSF_QTCB_SEND_GENERIC\n"); zfcp_fsf_send_ct_handler(fsf_req); break; case FSF_QTCB_OPEN_PORT_WITH_DID: - ZFCP_LOG_FLAGS(2, "FSF_QTCB_OPEN_PORT_WITH_DID\n"); zfcp_fsf_open_port_handler(fsf_req); break; case FSF_QTCB_OPEN_LUN: - ZFCP_LOG_FLAGS(2, "FSF_QTCB_OPEN_LUN\n"); zfcp_fsf_open_unit_handler(fsf_req); break; case FSF_QTCB_CLOSE_LUN: - ZFCP_LOG_FLAGS(2, "FSF_QTCB_CLOSE_LUN\n"); zfcp_fsf_close_unit_handler(fsf_req); break; case FSF_QTCB_CLOSE_PORT: - ZFCP_LOG_FLAGS(2, "FSF_QTCB_CLOSE_PORT\n"); zfcp_fsf_close_port_handler(fsf_req); break; case FSF_QTCB_CLOSE_PHYSICAL_PORT: - ZFCP_LOG_FLAGS(2, "FSF_QTCB_CLOSE_PHYSICAL_PORT\n"); zfcp_fsf_close_physical_port_handler(fsf_req); break; case FSF_QTCB_EXCHANGE_CONFIG_DATA: - ZFCP_LOG_FLAGS(2, "FSF_QTCB_EXCHANGE_CONFIG_DATA\n"); zfcp_fsf_exchange_config_data_handler(fsf_req); break; case FSF_QTCB_EXCHANGE_PORT_DATA: - ZFCP_LOG_FLAGS(2, "FSF_QTCB_EXCHANGE_PORT_DATA\n"); zfcp_fsf_exchange_port_data_handler(fsf_req); break; case FSF_QTCB_SEND_ELS: - ZFCP_LOG_FLAGS(2, "FSF_QTCB_SEND_ELS\n"); zfcp_fsf_send_els_handler(fsf_req); break; case FSF_QTCB_DOWNLOAD_CONTROL_FILE: - ZFCP_LOG_FLAGS(2, "FSF_QTCB_DOWNLOAD_CONTROL_FILE\n"); zfcp_fsf_control_file_handler(fsf_req); break; case FSF_QTCB_UPLOAD_CONTROL_FILE: - ZFCP_LOG_FLAGS(2, "FSF_QTCB_UPLOAD_CONTROL_FILE\n"); zfcp_fsf_control_file_handler(fsf_req); break; default: - ZFCP_LOG_FLAGS(2, "FSF_QTCB_UNKNOWN\n"); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; ZFCP_LOG_NORMAL("bug: Command issued by the device driver is " "not supported by the adapter %s\n", @@ -929,13 +894,11 @@ zfcp_fsf_status_read_port_closed(struct zfcp_fsf_req *fsf_req) switch (status_buffer->status_subtype) { case FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT: - ZFCP_LOG_FLAGS(2, "FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT\n"); debug_text_event(adapter->erp_dbf, 3, "unsol_pc_phys:"); zfcp_erp_port_reopen(port, 0); break; case FSF_STATUS_READ_SUB_ERROR_PORT: - ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_SUB_ERROR_PORT\n"); debug_text_event(adapter->erp_dbf, 1, "unsol_pc_err:"); zfcp_erp_port_shutdown(port, 0); break; @@ -980,7 +943,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) switch (status_buffer->status_type) { case FSF_STATUS_READ_PORT_CLOSED: - ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_PORT_CLOSED\n"); debug_text_event(adapter->erp_dbf, 3, "unsol_pclosed:"); debug_event(adapter->erp_dbf, 3, &status_buffer->d_id, sizeof (u32)); @@ -988,13 +950,11 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_STATUS_READ_INCOMING_ELS: - ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_INCOMING_ELS\n"); debug_text_event(adapter->erp_dbf, 3, "unsol_els:"); zfcp_fsf_incoming_els(fsf_req); break; case FSF_STATUS_READ_SENSE_DATA_AVAIL: - ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_SENSE_DATA_AVAIL\n"); debug_text_event(adapter->erp_dbf, 3, "unsol_sense:"); ZFCP_LOG_INFO("unsolicited sense data received (adapter %s)\n", zfcp_get_busid_by_adapter(adapter)); @@ -1003,7 +963,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_STATUS_READ_BIT_ERROR_THRESHOLD: - ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_BIT_ERROR_THRESHOLD\n"); debug_text_event(adapter->erp_dbf, 3, "unsol_bit_err:"); ZFCP_LOG_NORMAL("Bit error threshold data received:\n"); ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL, @@ -1012,7 +971,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_STATUS_READ_LINK_DOWN: - ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_LINK_DOWN\n"); debug_text_event(adapter->erp_dbf, 0, "unsol_link_down:"); ZFCP_LOG_INFO("Local link to adapter %s is down\n", zfcp_get_busid_by_adapter(adapter)); @@ -1022,7 +980,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_STATUS_READ_LINK_UP: - ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_LINK_UP\n"); debug_text_event(adapter->erp_dbf, 2, "unsol_link_up:"); ZFCP_LOG_INFO("Local link to adapter %s was replugged. " "Restarting operations on this adapter\n", @@ -1037,7 +994,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_STATUS_READ_CFDC_UPDATED: - ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_CFDC_UPDATED\n"); debug_text_event(adapter->erp_dbf, 2, "unsol_cfdc_update:"); ZFCP_LOG_INFO("CFDC has been updated on the adapter %s\n", zfcp_get_busid_by_adapter(adapter)); @@ -1045,7 +1001,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_STATUS_READ_CFDC_HARDENED: - ZFCP_LOG_FLAGS(1, "FSF_STATUS_READ_CFDC_HARDENED\n"); debug_text_event(adapter->erp_dbf, 2, "unsol_cfdc_harden:"); switch (status_buffer->status_subtype) { case FSF_STATUS_READ_SUB_CFDC_HARDENED_ON_SE: @@ -1214,7 +1169,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) case FSF_PORT_HANDLE_NOT_VALID: if (status_qual >> 4 != status_qual % 0xf) { - ZFCP_LOG_FLAGS(2, "FSF_PORT_HANDLE_NOT_VALID\n"); debug_text_event(new_fsf_req->adapter->erp_dbf, 3, "fsf_s_phand_nv0"); /* @@ -1223,7 +1177,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) * fine. */ } else { - ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n"); ZFCP_LOG_INFO("Temporary port identifier 0x%x for " "port 0x%016Lx on adapter %s invalid. " "This may happen occasionally.\n", @@ -1246,7 +1199,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) case FSF_LUN_HANDLE_NOT_VALID: if (status_qual >> 4 != status_qual % 0xf) { /* 2 */ - ZFCP_LOG_FLAGS(0, "FSF_LUN_HANDLE_NOT_VALID\n"); debug_text_event(new_fsf_req->adapter->erp_dbf, 3, "fsf_s_lhand_nv0"); /* @@ -1255,7 +1207,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) * This is fine. */ } else { - ZFCP_LOG_FLAGS(1, "FSF_LUN_HANDLE_NOT_VALID\n"); ZFCP_LOG_INFO ("Warning: Temporary LUN identifier 0x%x of LUN " "0x%016Lx on port 0x%016Lx on adapter %s is " @@ -1279,7 +1230,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) break; case FSF_FCP_COMMAND_DOES_NOT_EXIST: - ZFCP_LOG_FLAGS(2, "FSF_FCP_COMMAND_DOES_NOT_EXIST\n"); retval = 0; debug_text_event(new_fsf_req->adapter->erp_dbf, 3, "fsf_s_no_exist"); @@ -1287,8 +1237,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) break; case FSF_PORT_BOXED: - /* 2 */ - ZFCP_LOG_FLAGS(0, "FSF_PORT_BOXED\n"); ZFCP_LOG_INFO("Remote port 0x%016Lx on adapter %s needs to " "be reopened\n", unit->port->wwpn, zfcp_get_busid_by_unit(unit)); @@ -1300,7 +1248,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) break; case FSF_LUN_BOXED: - ZFCP_LOG_FLAGS(0, "FSF_LUN_BOXED\n"); ZFCP_LOG_INFO( "unit 0x%016Lx on port 0x%016Lx on adapter %s needs " "to be reopened\n", @@ -1316,12 +1263,8 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) break; case FSF_ADAPTER_STATUS_AVAILABLE: - /* 2 */ - ZFCP_LOG_FLAGS(0, "FSF_ADAPTER_STATUS_AVAILABLE\n"); switch (new_fsf_req->qtcb->header.fsf_status_qual.word[0]) { case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: - ZFCP_LOG_FLAGS(2, - "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n"); debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_sq_ltest"); /* reopening link to port */ @@ -1329,8 +1272,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: - ZFCP_LOG_FLAGS(2, - "FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n"); /* SCSI stack will escalate */ debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_sq_ulp"); @@ -1350,8 +1291,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) break; case FSF_GOOD: - /* 3 */ - ZFCP_LOG_FLAGS(0, "FSF_GOOD\n"); retval = 0; new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED; break; @@ -1553,12 +1492,10 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) switch (header->fsf_status) { case FSF_GOOD: - ZFCP_LOG_FLAGS(2,"FSF_GOOD\n"); retval = 0; break; case FSF_SERVICE_CLASS_NOT_SUPPORTED: - ZFCP_LOG_FLAGS(2, "FSF_SERVICE_CLASS_NOT_SUPPORTED\n"); if (adapter->fc_service_class <= 3) { ZFCP_LOG_INFO("error: adapter %s does not support fc " "class %d.\n", @@ -1578,17 +1515,14 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ADAPTER_STATUS_AVAILABLE: - ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n"); switch (header->fsf_status_qual.word[0]){ case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: - ZFCP_LOG_FLAGS(2,"FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n"); /* reopening link to port */ debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest"); zfcp_test_link(port); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: - ZFCP_LOG_FLAGS(2,"FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n"); /* ERP strategy will escalate */ debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ulp"); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -1602,7 +1536,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ACCESS_DENIED: - ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n"); ZFCP_LOG_NORMAL("access denied, cannot send generic service " "command (adapter %s, port d_id=0x%08x)\n", zfcp_get_busid_by_port(port), port->d_id); @@ -1625,7 +1558,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_GENERIC_COMMAND_REJECTED: - ZFCP_LOG_FLAGS(2, "FSF_GENERIC_COMMAND_REJECTED\n"); ZFCP_LOG_INFO("generic service command rejected " "(adapter %s, port d_id=0x%08x)\n", zfcp_get_busid_by_port(port), port->d_id); @@ -1638,7 +1570,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_PORT_HANDLE_NOT_VALID: - ZFCP_LOG_FLAGS(2, "FSF_PORT_HANDLE_NOT_VALID\n"); ZFCP_LOG_DEBUG("Temporary port identifier 0x%x for port " "0x%016Lx on adapter %s invalid. This may " "happen occasionally.\n", port->handle, @@ -1653,7 +1584,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_PORT_BOXED: - ZFCP_LOG_FLAGS(2, "FSF_PORT_BOXED\n"); ZFCP_LOG_INFO("port needs to be reopened " "(adapter %s, port d_id=0x%08x)\n", zfcp_get_busid_by_port(port), port->d_id); @@ -1666,7 +1596,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) /* following states should never occure, all cases avoided in zfcp_fsf_send_ct - but who knows ... */ case FSF_PAYLOAD_SIZE_MISMATCH: - ZFCP_LOG_FLAGS(2, "FSF_PAYLOAD_SIZE_MISMATCH\n"); ZFCP_LOG_INFO("payload size mismatch (adapter: %s, " "req_buf_length=%d, resp_buf_length=%d)\n", zfcp_get_busid_by_adapter(adapter), @@ -1674,7 +1603,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_REQUEST_SIZE_TOO_LARGE: - ZFCP_LOG_FLAGS(2, "FSF_REQUEST_SIZE_TOO_LARGE\n"); ZFCP_LOG_INFO("request size too large (adapter: %s, " "req_buf_length=%d)\n", zfcp_get_busid_by_adapter(adapter), @@ -1682,7 +1610,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_RESPONSE_SIZE_TOO_LARGE: - ZFCP_LOG_FLAGS(2, "FSF_RESPONSE_SIZE_TOO_LARGE\n"); ZFCP_LOG_INFO("response size too large (adapter: %s, " "resp_buf_length=%d)\n", zfcp_get_busid_by_adapter(adapter), @@ -1690,7 +1617,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SBAL_MISMATCH: - ZFCP_LOG_FLAGS(2, "FSF_SBAL_MISMATCH\n"); ZFCP_LOG_INFO("SBAL mismatch (adapter: %s, req_buf_length=%d, " "resp_buf_length=%d)\n", zfcp_get_busid_by_adapter(adapter), @@ -1866,12 +1792,10 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) switch (header->fsf_status) { case FSF_GOOD: - ZFCP_LOG_FLAGS(2, "FSF_GOOD\n"); retval = 0; break; case FSF_SERVICE_CLASS_NOT_SUPPORTED: - ZFCP_LOG_FLAGS(2, "FSF_SERVICE_CLASS_NOT_SUPPORTED\n"); if (adapter->fc_service_class <= 3) { ZFCP_LOG_INFO("error: adapter %s does " "not support fibrechannel class %d.\n", @@ -1891,10 +1815,8 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ADAPTER_STATUS_AVAILABLE: - ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n"); switch (header->fsf_status_qual.word[0]){ case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: - ZFCP_LOG_FLAGS(2,"FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n"); debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest"); if (send_els->ls_code != ZFCP_LS_ADISC) { read_lock(&zfcp_data.config_lock); @@ -1906,7 +1828,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: - ZFCP_LOG_FLAGS(2,"FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n"); debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ulp"); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; retval = @@ -1915,7 +1836,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) &header->fsf_status_qual.word[2]); break; case FSF_SQ_RETRY_IF_POSSIBLE: - ZFCP_LOG_FLAGS(2, "FSF_SQ_RETRY_IF_POSSIBLE\n"); debug_text_event(adapter->erp_dbf, 1, "fsf_sq_retry"); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -1928,7 +1848,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ELS_COMMAND_REJECTED: - ZFCP_LOG_FLAGS(2, "FSF_ELS_COMMAND_REJECTED\n"); ZFCP_LOG_INFO("ELS has been rejected because command filter " "prohibited sending " "(adapter: %s, port d_id: 0x%08x)\n", @@ -1937,7 +1856,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_PAYLOAD_SIZE_MISMATCH: - ZFCP_LOG_FLAGS(2, "FSF_PAYLOAD_SIZE_MISMATCH\n"); ZFCP_LOG_INFO( "ELS request size and ELS response size must be either " "both 0, or both greater than 0 " @@ -1948,7 +1866,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_REQUEST_SIZE_TOO_LARGE: - ZFCP_LOG_FLAGS(2, "FSF_REQUEST_SIZE_TOO_LARGE\n"); ZFCP_LOG_INFO( "Length of the ELS request buffer, " "specified in QTCB bottom, " @@ -1960,7 +1877,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_RESPONSE_SIZE_TOO_LARGE: - ZFCP_LOG_FLAGS(2, "FSF_RESPONSE_SIZE_TOO_LARGE\n"); ZFCP_LOG_INFO( "Length of the ELS response buffer, " "specified in QTCB bottom, " @@ -1973,7 +1889,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) case FSF_SBAL_MISMATCH: /* should never occure, avoided in zfcp_fsf_send_els */ - ZFCP_LOG_FLAGS(2, "FSF_SBAL_MISMATCH\n"); ZFCP_LOG_INFO("SBAL mismatch (adapter: %s, req_buf_length=%d, " "resp_buf_length=%d)\n", zfcp_get_busid_by_adapter(adapter), @@ -1982,7 +1897,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ACCESS_DENIED: - ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n"); ZFCP_LOG_NORMAL("access denied, cannot send ELS command " "(adapter %s, port d_id=0x%08x)\n", zfcp_get_busid_by_adapter(adapter), d_id); @@ -2195,14 +2109,11 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) switch (fsf_req->qtcb->header.fsf_status) { case FSF_GOOD: - ZFCP_LOG_FLAGS(2, "FSF_GOOD\n"); - if (zfcp_fsf_exchange_config_evaluate(fsf_req, 1)) return -EIO; switch (adapter->fc_topology) { case FSF_TOPO_P2P: - ZFCP_LOG_FLAGS(1, "FSF_TOPO_P2P\n"); ZFCP_LOG_NORMAL("Point-to-Point fibrechannel " "configuration detected at adapter %s\n" "Peer WWNN 0x%016llx, " @@ -2216,7 +2127,6 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) "top-p-to-p"); break; case FSF_TOPO_AL: - ZFCP_LOG_FLAGS(1, "FSF_TOPO_AL\n"); ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " "topology detected at adapter %s " "unsupported, shutting down adapter\n", @@ -2226,7 +2136,6 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) zfcp_erp_adapter_shutdown(adapter, 0); return -EIO; case FSF_TOPO_FABRIC: - ZFCP_LOG_FLAGS(1, "FSF_TOPO_FABRIC\n"); ZFCP_LOG_INFO("Switched fabric fibrechannel " "network detected at adapter %s.\n", zfcp_get_busid_by_adapter(adapter)); @@ -2379,7 +2288,6 @@ zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req) switch (fsf_req->qtcb->header.fsf_status) { case FSF_GOOD: - ZFCP_LOG_FLAGS(2,"FSF_GOOD\n"); bottom = &fsf_req->qtcb->bottom.port; memcpy(data, bottom, sizeof(*data)); break; @@ -2481,7 +2389,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) switch (header->fsf_status) { case FSF_PORT_ALREADY_OPEN: - ZFCP_LOG_FLAGS(0, "FSF_PORT_ALREADY_OPEN\n"); ZFCP_LOG_NORMAL("bug: remote port 0x%016Lx on adapter %s " "is already open.\n", port->wwpn, zfcp_get_busid_by_port(port)); @@ -2494,7 +2401,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ACCESS_DENIED: - ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n"); ZFCP_LOG_NORMAL("Access denied, cannot open port 0x%016Lx " "on adapter %s\n", port->wwpn, zfcp_get_busid_by_port(port)); @@ -2517,7 +2423,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED: - ZFCP_LOG_FLAGS(1, "FSF_MAXIMUM_NUMBER_OF_PORTS_EXCEEDED\n"); ZFCP_LOG_INFO("error: The FSF adapter is out of resources. " "The remote port 0x%016Lx on adapter %s " "could not be opened. Disabling it.\n", @@ -2529,11 +2434,8 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ADAPTER_STATUS_AVAILABLE: - ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n"); switch (header->fsf_status_qual.word[0]) { case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: - ZFCP_LOG_FLAGS(2, - "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n"); debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_sq_ltest"); /* ERP strategy will escalate */ @@ -2546,7 +2448,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_NO_RETRY_POSSIBLE: - ZFCP_LOG_FLAGS(0, "FSF_SQ_NO_RETRY_POSSIBLE\n"); ZFCP_LOG_NORMAL("The remote port 0x%016Lx on " "adapter %s could not be opened. " "Disabling it.\n", @@ -2572,7 +2473,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_GOOD: - ZFCP_LOG_FLAGS(3, "FSF_GOOD\n"); /* save port handle assigned by FSF */ port->handle = header->port_handle; ZFCP_LOG_INFO("The remote port 0x%016Lx via adapter %s " @@ -2630,7 +2530,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) case FSF_UNKNOWN_OP_SUBTYPE: /* should never occure, subtype not set in zfcp_fsf_open_port */ - ZFCP_LOG_FLAGS(2, "FSF_UNKNOWN_OP_SUBTYPE\n"); ZFCP_LOG_INFO("unknown operation subtype (adapter: %s, " "op_subtype=0x%x)\n", zfcp_get_busid_by_port(port), @@ -2739,7 +2638,6 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req) switch (fsf_req->qtcb->header.fsf_status) { case FSF_PORT_HANDLE_NOT_VALID: - ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n"); ZFCP_LOG_INFO("Temporary port identifier 0x%x for port " "0x%016Lx on adapter %s invalid. This may happen " "occasionally.\n", port->handle, @@ -2755,7 +2653,6 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ADAPTER_STATUS_AVAILABLE: - ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n"); /* Note: FSF has actually closed the port in this case. * The status code is just daft. Fingers crossed for a change */ @@ -2763,7 +2660,6 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_GOOD: - ZFCP_LOG_FLAGS(3, "FSF_GOOD\n"); ZFCP_LOG_TRACE("remote port 0x016%Lx on adapter %s closed, " "port handle 0x%x\n", port->wwpn, zfcp_get_busid_by_port(port), port->handle); @@ -2884,7 +2780,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) switch (header->fsf_status) { case FSF_PORT_HANDLE_NOT_VALID: - ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n"); ZFCP_LOG_INFO("Temporary port identifier 0x%x invalid" "(adapter %s, port 0x%016Lx). " "This may happen occasionally.\n", @@ -2902,7 +2797,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ACCESS_DENIED: - ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n"); ZFCP_LOG_NORMAL("Access denied, cannot close " "physical port 0x%016Lx on adapter %s\n", port->wwpn, zfcp_get_busid_by_port(port)); @@ -2925,7 +2819,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_PORT_BOXED: - ZFCP_LOG_FLAGS(2, "FSF_PORT_BOXED\n"); ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter " "%s needs to be reopened but it was attempted " "to close it physically.\n", @@ -2938,19 +2831,14 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ADAPTER_STATUS_AVAILABLE: - ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n"); switch (header->fsf_status_qual.word[0]) { case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: - ZFCP_LOG_FLAGS(2, - "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n"); debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_sq_ltest"); /* This will now be escalated by ERP */ fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: - ZFCP_LOG_FLAGS(2, - "FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n"); /* ERP strategy will escalate */ debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_sq_ulp"); @@ -2970,7 +2858,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_GOOD: - ZFCP_LOG_FLAGS(3, "FSF_GOOD\n"); ZFCP_LOG_DEBUG("Remote port 0x%016Lx via adapter %s " "physically closed, port handle 0x%x\n", port->wwpn, @@ -3116,7 +3003,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) switch (header->fsf_status) { case FSF_PORT_HANDLE_NOT_VALID: - ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n"); ZFCP_LOG_INFO("Temporary port identifier 0x%x " "for port 0x%016Lx on adapter %s invalid " "This may happen occasionally\n", @@ -3132,7 +3018,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_LUN_ALREADY_OPEN: - ZFCP_LOG_FLAGS(0, "FSF_LUN_ALREADY_OPEN\n"); ZFCP_LOG_NORMAL("bug: Attempted to open unit 0x%016Lx on " "remote port 0x%016Lx on adapter %s twice.\n", unit->fcp_lun, @@ -3143,7 +3028,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ACCESS_DENIED: - ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n"); ZFCP_LOG_NORMAL("Access denied, cannot open unit 0x%016Lx on " "remote port 0x%016Lx on adapter %s\n", unit->fcp_lun, unit->port->wwpn, @@ -3169,7 +3053,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_PORT_BOXED: - ZFCP_LOG_FLAGS(2, "FSF_PORT_BOXED\n"); ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s " "needs to be reopened\n", unit->port->wwpn, zfcp_get_busid_by_unit(unit)); @@ -3180,7 +3063,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_LUN_SHARING_VIOLATION: - ZFCP_LOG_FLAGS(2, "FSF_LUN_SHARING_VIOLATION\n"); if (header->fsf_status_qual.word[0] != 0) { ZFCP_LOG_NORMAL("FCP-LUN 0x%Lx at the remote port " "with WWPN 0x%Lx " @@ -3224,7 +3106,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED: - ZFCP_LOG_FLAGS(1, "FSF_MAXIMUM_NUMBER_OF_LUNS_EXCEEDED\n"); ZFCP_LOG_INFO("error: The adapter ran out of resources. " "There is no handle (temporary port identifier) " "available for unit 0x%016Lx on port 0x%016Lx " @@ -3239,11 +3120,8 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ADAPTER_STATUS_AVAILABLE: - ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n"); switch (header->fsf_status_qual.word[0]) { case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: - ZFCP_LOG_FLAGS(2, - "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n"); /* Re-establish link to port */ debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest"); @@ -3251,8 +3129,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: - ZFCP_LOG_FLAGS(2, - "FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n"); /* ERP strategy will escalate */ debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ulp"); @@ -3271,7 +3147,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_INVALID_COMMAND_OPTION: - ZFCP_LOG_FLAGS(2, "FSF_INVALID_COMMAND_OPTION\n"); ZFCP_LOG_NORMAL( "Invalid option 0x%x has been specified " "in QTCB bottom sent to the adapter %s\n", @@ -3282,7 +3157,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_GOOD: - ZFCP_LOG_FLAGS(3, "FSF_GOOD\n"); /* save LUN handle assigned by FSF */ unit->handle = header->lun_handle; ZFCP_LOG_TRACE("unit 0x%016Lx on remote port 0x%016Lx on " @@ -3437,7 +3311,6 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) switch (fsf_req->qtcb->header.fsf_status) { case FSF_PORT_HANDLE_NOT_VALID: - ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n"); ZFCP_LOG_INFO("Temporary port identifier 0x%x for port " "0x%016Lx on adapter %s invalid. This may " "happen in rare circumstances\n", @@ -3458,7 +3331,6 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_LUN_HANDLE_NOT_VALID: - ZFCP_LOG_FLAGS(1, "FSF_LUN_HANDLE_NOT_VALID\n"); ZFCP_LOG_INFO("Temporary LUN identifier 0x%x of unit " "0x%016Lx on port 0x%016Lx on adapter %s is " "invalid. This may happen occasionally.\n", @@ -3480,7 +3352,6 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_PORT_BOXED: - ZFCP_LOG_FLAGS(2, "FSF_PORT_BOXED\n"); ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s " "needs to be reopened\n", unit->port->wwpn, @@ -3492,11 +3363,8 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ADAPTER_STATUS_AVAILABLE: - ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n"); switch (fsf_req->qtcb->header.fsf_status_qual.word[0]) { case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: - ZFCP_LOG_FLAGS(2, - "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n"); /* re-establish link to port */ debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_sq_ltest"); @@ -3504,8 +3372,6 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: - ZFCP_LOG_FLAGS(2, - "FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n"); /* ERP strategy will escalate */ debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_sq_ulp"); @@ -3526,7 +3392,6 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_GOOD: - ZFCP_LOG_FLAGS(3, "FSF_GOOD\n"); ZFCP_LOG_TRACE("unit 0x%016Lx on port 0x%016Lx on adapter %s " "closed, port handle 0x%x\n", unit->fcp_lun, @@ -3622,7 +3487,6 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter, */ switch (scsi_cmnd->sc_data_direction) { case DMA_NONE: - ZFCP_LOG_FLAGS(3, "DMA_NONE\n"); fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_CMND; /* * FIXME(qdio): @@ -3632,19 +3496,16 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter, sbtype = SBAL_FLAGS0_TYPE_READ; break; case DMA_FROM_DEVICE: - ZFCP_LOG_FLAGS(3, "DMA_FROM_DEVICE\n"); fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_READ; sbtype = SBAL_FLAGS0_TYPE_READ; fcp_cmnd_iu->rddata = 1; break; case DMA_TO_DEVICE: - ZFCP_LOG_FLAGS(3, "DMA_TO_DEVICE\n"); fsf_req->qtcb->bottom.io.data_direction = FSF_DATADIR_WRITE; sbtype = SBAL_FLAGS0_TYPE_WRITE; fcp_cmnd_iu->wddata = 1; break; case DMA_BIDIRECTIONAL: - ZFCP_LOG_FLAGS(0, "DMA_BIDIRECTIONAL not supported\n"); default: /* * dummy, catch this condition earlier @@ -3877,7 +3738,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) switch (header->fsf_status) { case FSF_PORT_HANDLE_NOT_VALID: - ZFCP_LOG_FLAGS(1, "FSF_PORT_HANDLE_NOT_VALID\n"); ZFCP_LOG_INFO("Temporary port identifier 0x%x for port " "0x%016Lx on adapter %s invalid\n", unit->port->handle, @@ -3892,7 +3752,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_LUN_HANDLE_NOT_VALID: - ZFCP_LOG_FLAGS(1, "FSF_LUN_HANDLE_NOT_VALID\n"); ZFCP_LOG_INFO("Temporary LUN identifier 0x%x for unit " "0x%016Lx on port 0x%016Lx on adapter %s is " "invalid. This may happen occasionally.\n", @@ -3911,7 +3770,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_HANDLE_MISMATCH: - ZFCP_LOG_FLAGS(0, "FSF_HANDLE_MISMATCH\n"); ZFCP_LOG_NORMAL("bug: The port handle 0x%x has changed " "unexpectedly. (adapter %s, port 0x%016Lx, " "unit 0x%016Lx)\n", @@ -3934,7 +3792,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_SERVICE_CLASS_NOT_SUPPORTED: - ZFCP_LOG_FLAGS(0, "FSF_SERVICE_CLASS_NOT_SUPPORTED\n"); if (fsf_req->adapter->fc_service_class <= 3) { ZFCP_LOG_NORMAL("error: The adapter %s does " "not support fibrechannel class %d.\n", @@ -3959,7 +3816,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_FCPLUN_NOT_VALID: - ZFCP_LOG_FLAGS(0, "FSF_FCPLUN_NOT_VALID\n"); ZFCP_LOG_NORMAL("bug: unit 0x%016Lx on port 0x%016Lx on " "adapter %s does not have correct unit " "handle 0x%x\n", @@ -3982,7 +3838,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ACCESS_DENIED: - ZFCP_LOG_FLAGS(2, "FSF_ACCESS_DENIED\n"); ZFCP_LOG_NORMAL("Access denied, cannot send FCP command to " "unit 0x%016Lx on port 0x%016Lx on " "adapter %s\n", unit->fcp_lun, unit->port->wwpn, @@ -4006,7 +3861,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_DIRECTION_INDICATOR_NOT_VALID: - ZFCP_LOG_FLAGS(0, "FSF_DIRECTION_INDICATOR_NOT_VALID\n"); ZFCP_LOG_INFO("bug: Invalid data direction given for unit " "0x%016Lx on port 0x%016Lx on adapter %s " "(debug info %d)\n", @@ -4026,7 +3880,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_CMND_LENGTH_NOT_VALID: - ZFCP_LOG_FLAGS(0, "FSF_CMND_LENGTH_NOT_VALID\n"); ZFCP_LOG_NORMAL ("bug: An invalid control-data-block length field " "was found in a command for unit 0x%016Lx on port " @@ -4046,7 +3899,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_PORT_BOXED: - ZFCP_LOG_FLAGS(2, "FSF_PORT_BOXED\n"); ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s " "needs to be reopened\n", unit->port->wwpn, zfcp_get_busid_by_unit(unit)); @@ -4060,7 +3912,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_LUN_BOXED: - ZFCP_LOG_FLAGS(0, "FSF_LUN_BOXED\n"); ZFCP_LOG_NORMAL("unit needs to be reopened (adapter %s, " "wwpn=0x%016Lx, fcp_lun=0x%016Lx)\n", zfcp_get_busid_by_unit(unit), @@ -4075,11 +3926,8 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ADAPTER_STATUS_AVAILABLE: - ZFCP_LOG_FLAGS(2, "FSF_ADAPTER_STATUS_AVAILABLE\n"); switch (header->fsf_status_qual.word[0]) { case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: - ZFCP_LOG_FLAGS(2, - "FSF_SQ_INVOKE_LINK_TEST_PROCEDURE\n"); /* re-establish link to port */ debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_sq_ltest"); @@ -4092,8 +3940,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: - ZFCP_LOG_FLAGS(3, - "FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED\n"); /* FIXME(hw) need proper specs for proper action */ /* let scsi stack deal with retries and escalation */ debug_text_event(fsf_req->adapter->erp_dbf, 1, @@ -4120,11 +3966,9 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_GOOD: - ZFCP_LOG_FLAGS(3, "FSF_GOOD\n"); break; case FSF_FCP_RSP_AVAILABLE: - ZFCP_LOG_FLAGS(2, "FSF_FCP_RSP_AVAILABLE\n"); break; default: @@ -4217,14 +4061,12 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_DEBUG("rsp_len is valid\n"); switch (fcp_rsp_info[3]) { case RSP_CODE_GOOD: - ZFCP_LOG_FLAGS(3, "RSP_CODE_GOOD\n"); /* ok, continue */ ZFCP_LOG_TRACE("no failure or Task Management " "Function complete\n"); set_host_byte(&scpnt->result, DID_OK); break; case RSP_CODE_LENGTH_MISMATCH: - ZFCP_LOG_FLAGS(0, "RSP_CODE_LENGTH_MISMATCH\n"); /* hardware bug */ ZFCP_LOG_NORMAL("bug: FCP response code indictates " "that the fibrechannel protocol data " @@ -4242,7 +4084,6 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) set_host_byte(&scpnt->result, DID_ERROR); goto skip_fsfstatus; case RSP_CODE_FIELD_INVALID: - ZFCP_LOG_FLAGS(0, "RSP_CODE_FIELD_INVALID\n"); /* driver or hardware bug */ ZFCP_LOG_NORMAL("bug: FCP response code indictates " "that the fibrechannel protocol data " @@ -4261,7 +4102,6 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) zfcp_cmd_dbf_event_fsf("codeinv", fsf_req, NULL, 0); goto skip_fsfstatus; case RSP_CODE_RO_MISMATCH: - ZFCP_LOG_FLAGS(0, "RSP_CODE_RO_MISMATCH\n"); /* hardware bug */ ZFCP_LOG_NORMAL("bug: The FCP response code indicates " "that conflicting values for the " @@ -4407,13 +4247,11 @@ zfcp_fsf_send_fcp_command_task_management_handler(struct zfcp_fsf_req *fsf_req) /* check FCP_RSP_INFO */ switch (fcp_rsp_info[3]) { case RSP_CODE_GOOD: - ZFCP_LOG_FLAGS(3, "RSP_CODE_GOOD\n"); /* ok, continue */ ZFCP_LOG_DEBUG("no failure or Task Management " "Function complete\n"); break; case RSP_CODE_TASKMAN_UNSUPP: - ZFCP_LOG_FLAGS(0, "RSP_CODE_TASKMAN_UNSUPP\n"); ZFCP_LOG_NORMAL("bug: A reuested task management function " "is not supported on the target device " "unit 0x%016Lx, port 0x%016Lx, adapter %s\n ", @@ -4423,7 +4261,6 @@ zfcp_fsf_send_fcp_command_task_management_handler(struct zfcp_fsf_req *fsf_req) fsf_req->status |= ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP; break; case RSP_CODE_TASKMAN_FAILED: - ZFCP_LOG_FLAGS(0, "RSP_CODE_TASKMAN_FAILED\n"); ZFCP_LOG_NORMAL("bug: A reuested task management function " "failed to complete successfully. " "unit 0x%016Lx, port 0x%016Lx, adapter %s.\n", @@ -4610,7 +4447,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req) switch (header->fsf_status) { case FSF_GOOD: - ZFCP_LOG_FLAGS(2, "FSF_GOOD\n"); ZFCP_LOG_NORMAL( "The FSF request has been successfully completed " "on the adapter %s\n", @@ -4618,7 +4454,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_OPERATION_PARTIALLY_SUCCESSFUL: - ZFCP_LOG_FLAGS(2, "FSF_OPERATION_PARTIALLY_SUCCESSFUL\n"); if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) { switch (header->fsf_status_qual.word[0]) { @@ -4655,7 +4490,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_AUTHORIZATION_FAILURE: - ZFCP_LOG_FLAGS(2, "FSF_AUTHORIZATION_FAILURE\n"); ZFCP_LOG_NORMAL( "Adapter %s does not accept privileged commands\n", zfcp_get_busid_by_adapter(adapter)); @@ -4664,7 +4498,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_CFDC_ERROR_DETECTED: - ZFCP_LOG_FLAGS(2, "FSF_CFDC_ERROR_DETECTED\n"); ZFCP_LOG_NORMAL( "Error at position %d in the CFDC, " "CFDC is discarded by the adapter %s\n", @@ -4675,7 +4508,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_CONTROL_FILE_UPDATE_ERROR: - ZFCP_LOG_FLAGS(2, "FSF_CONTROL_FILE_UPDATE_ERROR\n"); ZFCP_LOG_NORMAL( "Adapter %s cannot harden the control file, " "file is discarded\n", @@ -4685,7 +4517,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_CONTROL_FILE_TOO_LARGE: - ZFCP_LOG_FLAGS(2, "FSF_CONTROL_FILE_TOO_LARGE\n"); ZFCP_LOG_NORMAL( "Control file is too large, file is discarded " "by the adapter %s\n", @@ -4695,7 +4526,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_ACCESS_CONFLICT_DETECTED: - ZFCP_LOG_FLAGS(2, "FSF_ACCESS_CONFLICT_DETECTED\n"); if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) ZFCP_LOG_NORMAL( "CFDC has been discarded by the adapter %s, " @@ -4708,7 +4538,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_CONFLICTS_OVERRULED: - ZFCP_LOG_FLAGS(2, "FSF_CONFLICTS_OVERRULED\n"); if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) ZFCP_LOG_NORMAL( "CFDC has been activated on the adapter %s, " @@ -4721,7 +4550,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_UNKNOWN_OP_SUBTYPE: - ZFCP_LOG_FLAGS(2, "FSF_UNKNOWN_OP_SUBTYPE\n"); ZFCP_LOG_NORMAL("unknown operation subtype (adapter: %s, " "op_subtype=0x%x)\n", zfcp_get_busid_by_adapter(adapter), @@ -4731,7 +4559,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_INVALID_COMMAND_OPTION: - ZFCP_LOG_FLAGS(2, "FSF_INVALID_COMMAND_OPTION\n"); ZFCP_LOG_NORMAL( "Invalid option 0x%x has been specified " "in QTCB bottom sent to the adapter %s\n", diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index 06e862d7bc90..fb218dd9d934 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, ZFCP_LOG_TRACE("status is" " QDIO_STATUS_OUTBOUND_INT \n"); } - } // if (ZFCP_LOG_CHECK(ZFCP_LOG_LEVEL_TRACE)) + } if (unlikely(status & QDIO_STATUS_LOOK_FOR_ERROR)) { retval = -EIO; - ZFCP_LOG_FLAGS(1, "QDIO_STATUS_LOOK_FOR_ERROR \n"); - ZFCP_LOG_INFO("QDIO problem occurred (status=0x%x, " "qdio_error=0x%x, siga_error=0x%x)\n", status, qdio_error, siga_error); - if (status & QDIO_STATUS_ACTIVATE_CHECK_CONDITION) { - ZFCP_LOG_FLAGS(2, - "QDIO_STATUS_ACTIVATE_CHECK_CONDITION\n"); - } - if (status & QDIO_STATUS_MORE_THAN_ONE_QDIO_ERROR) { - ZFCP_LOG_FLAGS(2, - "QDIO_STATUS_MORE_THAN_ONE_QDIO_ERROR\n"); - } - if (status & QDIO_STATUS_MORE_THAN_ONE_SIGA_ERROR) { - ZFCP_LOG_FLAGS(2, - "QDIO_STATUS_MORE_THAN_ONE_SIGA_ERROR\n"); - } - - if (siga_error & QDIO_SIGA_ERROR_ACCESS_EXCEPTION) { - ZFCP_LOG_FLAGS(2, "QDIO_SIGA_ERROR_ACCESS_EXCEPTION\n"); - } - - if (siga_error & QDIO_SIGA_ERROR_B_BIT_SET) { - ZFCP_LOG_FLAGS(2, "QDIO_SIGA_ERROR_B_BIT_SET\n"); - } - - switch (qdio_error) { - case 0: - ZFCP_LOG_FLAGS(3, "QDIO_OK"); - break; - case SLSB_P_INPUT_ERROR: - ZFCP_LOG_FLAGS(1, "SLSB_P_INPUT_ERROR\n"); - break; - case SLSB_P_OUTPUT_ERROR: - ZFCP_LOG_FLAGS(1, "SLSB_P_OUTPUT_ERROR\n"); - break; - default: - ZFCP_LOG_NORMAL("bug: unknown QDIO error 0x%x\n", - qdio_error); - break; - } /* Restarting IO on the failed adapter from scratch */ debug_text_event(adapter->erp_dbf, 1, "qdio_err"); /* -- cgit v1.2.2 From 66c8684abf80a9999392d639627afea80ac62e06 Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Mon, 13 Jun 2005 13:13:45 +0200 Subject: [SCSI] zfcp: fix wrong handling of failed requests for GID_PN command Fixes the handling of failed requests for GID_PN nameserver command: Set ZFCP_STATUS_PORT_INVALID_WWPN only if indicated by response payload for GID_PN nameserver command and not if fsf request fails. Signed-off-by: Andreas Herrmann Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_aux.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 52fc1d789066..6bb4d332b474 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -1753,7 +1753,10 @@ static void zfcp_ns_gid_pn_handler(unsigned long data) ct_iu_req = zfcp_sg_to_address(ct->req); ct_iu_resp = zfcp_sg_to_address(ct->resp); - if ((ct->status != 0) || zfcp_check_ct_response(&ct_iu_resp->header)) { + if (ct->status != 0) + goto failed; + + if (zfcp_check_ct_response(&ct_iu_resp->header)) { /* FIXME: do we need some specific erp entry points */ atomic_set_mask(ZFCP_STATUS_PORT_INVALID_WWPN, &port->status); goto failed; -- cgit v1.2.2 From 22753fa514aad02342e647ad13048caa282d9238 Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Mon, 13 Jun 2005 13:15:15 +0200 Subject: [SCSI] zfcp: fix: allow more time for adapter initialization From: Maxim Shchetynin Extend the time for adapter initialization: In case of protocol status HOST_CONNECTION_INITIALIZING for the exchange config data command do a first retry in 1 second, then double the sleep time for each following retry until recovery exceeds 2 minutes. The old behaviour of allowing 6 retries with .5 seconds delay between retries was insufficient and qdio queues were shut down too erarly. Signed-off-by: Andreas Herrmann Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_def.h | 6 ++++-- drivers/s390/scsi/zfcp_erp.c | 25 +++++++++++++------------ 2 files changed, 17 insertions(+), 14 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index ead324019ff2..08369b9dad68 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -149,8 +149,10 @@ typedef u32 scsi_lun_t; #define FSF_QTCB_UNSOLICITED_STATUS 0x6305 #define ZFCP_STATUS_READ_FAILED_THRESHOLD 3 #define ZFCP_STATUS_READS_RECOM FSF_STATUS_READS_RECOM -#define ZFCP_EXCHANGE_CONFIG_DATA_RETRIES 6 -#define ZFCP_EXCHANGE_CONFIG_DATA_SLEEP 50 + +/* Do 1st retry in 1 second, then double the timeout for each following retry */ +#define ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP 100 +#define ZFCP_EXCHANGE_CONFIG_DATA_RETRIES 7 /* timeout value for "default timer" for fsf requests */ #define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ); diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 53ebc1cdfe2d..60ba1ba112d6 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -2286,12 +2286,12 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) { int retval = ZFCP_ERP_SUCCEEDED; int retries; + int sleep = ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP; struct zfcp_adapter *adapter = erp_action->adapter; atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, &adapter->status); - retries = ZFCP_EXCHANGE_CONFIG_DATA_RETRIES; - do { + for (retries = ZFCP_EXCHANGE_CONFIG_DATA_RETRIES; retries; retries--) { atomic_clear_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, &adapter->status); ZFCP_LOG_DEBUG("Doing exchange config data\n"); @@ -2329,16 +2329,17 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) zfcp_get_busid_by_adapter(adapter)); break; } - if (atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, - &adapter->status)) { - ZFCP_LOG_DEBUG("host connection still initialising... " - "waiting and retrying...\n"); - /* sleep a little bit before retry */ - msleep(jiffies_to_msecs(ZFCP_EXCHANGE_CONFIG_DATA_SLEEP)); - } - } while ((retries--) && - atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, - &adapter->status)); + + if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, + &adapter->status)) + break; + + ZFCP_LOG_DEBUG("host connection still initialising... " + "waiting and retrying...\n"); + /* sleep a little bit before retry */ + msleep(jiffies_to_msecs(sleep)); + sleep *= 2; + } if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, &adapter->status)) { -- cgit v1.2.2 From 65a8d4e1a3754f0bfaa62949ebe919930e3127a1 Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Mon, 13 Jun 2005 13:16:27 +0200 Subject: [SCSI] zfcp: fix: reopen port only if link-test fails From: Maxim Shchetynin Reopen a remote port only if the link-test fails. This avoids that a port is unnecessarily reopened. Signed-off-by: Andreas Herrmann Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_fsf.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 14aaab82dc96..225e3631e8d2 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -1267,8 +1267,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_sq_ltest"); - /* reopening link to port */ - zfcp_erp_port_reopen(unit->port, 0); + zfcp_test_link(unit->port); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: @@ -3125,7 +3124,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) /* Re-establish link to port */ debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest"); - zfcp_erp_port_reopen(unit->port, 0); + zfcp_test_link(unit->port); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: @@ -3368,7 +3367,7 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) /* re-establish link to port */ debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_sq_ltest"); - zfcp_erp_port_reopen(unit->port, 0); + zfcp_test_link(unit->port); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: @@ -3931,12 +3930,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) /* re-establish link to port */ debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_sq_ltest"); - zfcp_erp_port_reopen(unit->port, 0); - zfcp_cmd_dbf_event_fsf( - "sqltest", - fsf_req, - &header->fsf_status_qual, - sizeof (union fsf_status_qual)); + zfcp_test_link(unit->port); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: @@ -3944,11 +3938,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) /* let scsi stack deal with retries and escalation */ debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_sq_ulp"); - zfcp_cmd_dbf_event_fsf( - "sqdeperp", - fsf_req, - &header->fsf_status_qual, - sizeof (union fsf_status_qual)); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; default: -- cgit v1.2.2 From 516a4201bacfd61ea957039d6f47276ee9c32a0d Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Mon, 13 Jun 2005 13:17:44 +0200 Subject: [SCSI] zfcp: fix: mark fsf request failed when receiving unknown status qualifier From: Maxim Shchetynin Correct a bug in zfcp_fsf_send_fcp_command_handler. An fsf request was not marked as failed if an unknown status qualifier was returned. Signed-off-by: Andreas Herrmann Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_fsf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 225e3631e8d2..bf66fc6d8a97 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -3931,19 +3931,16 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_sq_ltest"); zfcp_test_link(unit->port); - fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: /* FIXME(hw) need proper specs for proper action */ /* let scsi stack deal with retries and escalation */ debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_sq_ulp"); - fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; default: - /* FIXME: shall we consider this a successful transfer? */ ZFCP_LOG_NORMAL - ("bug: Wrong status qualifier 0x%x arrived.\n", + ("Unknown status qualifier 0x%x arrived.\n", header->fsf_status_qual.word[0]); debug_text_event(fsf_req->adapter->erp_dbf, 0, "fsf_sq_inval:"); @@ -3952,6 +3949,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) sizeof(u32)); break; } + fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_GOOD: -- cgit v1.2.2 From 64b29a130901d5b8578e9f602cf2dae56aaff224 Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Mon, 13 Jun 2005 13:18:56 +0200 Subject: [SCSI] zfcp: fix: problem in send_els_handler when D_ID assignment changes From: Maxim Shchetynin Fixes a bug in zfcp_send_els_handler. If D_ID assignments for ports are changing between initiation of one ELS request and its completion the wrong port might be accessed in the completion for that ELS request. Thus a pointer to the port has to be passed for ELS requests to identify the port structure if required. Signed-off-by: Andreas Herrmann Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_def.h | 2 ++ drivers/s390/scsi/zfcp_erp.c | 24 ++++++++++-------------- drivers/s390/scsi/zfcp_fsf.c | 15 ++++----------- 3 files changed, 16 insertions(+), 25 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 08369b9dad68..37982058e4d9 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -751,6 +751,7 @@ typedef void (*zfcp_send_els_handler_t)(unsigned long); /** * struct zfcp_send_els - used to pass parameters to function zfcp_fsf_send_els * @adapter: adapter where request is sent from + * @port: port where ELS is destinated (port reference count has to be increased) * @d_id: destiniation id of port where request is sent to * @req: scatter-gather list for request * @resp: scatter-gather list for response @@ -765,6 +766,7 @@ typedef void (*zfcp_send_els_handler_t)(unsigned long); */ struct zfcp_send_els { struct zfcp_adapter *adapter; + struct zfcp_port *port; fc_id_t d_id; struct scatterlist *req; struct scatterlist *resp; diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 60ba1ba112d6..41c67e1ec4f7 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -35,7 +35,7 @@ #include "zfcp_ext.h" -static int zfcp_erp_adisc(struct zfcp_adapter *, fc_id_t); +static int zfcp_erp_adisc(struct zfcp_port *); static void zfcp_erp_adisc_handler(unsigned long); static 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) /** * zfcp_erp_adisc - send ADISC ELS command - * @adapter: adapter structure - * @d_id: d_id of port where ADISC is sent to + * @port: port structure */ int -zfcp_erp_adisc(struct zfcp_adapter *adapter, fc_id_t d_id) +zfcp_erp_adisc(struct zfcp_port *port) { + struct zfcp_adapter *adapter = port->adapter; struct zfcp_send_els *send_els; struct zfcp_ls_adisc *adisc; void *address = NULL; @@ -332,7 +332,8 @@ zfcp_erp_adisc(struct zfcp_adapter *adapter, fc_id_t d_id) send_els->req_count = send_els->resp_count = 1; send_els->adapter = adapter; - send_els->d_id = d_id; + send_els->port = port; + send_els->d_id = port->d_id; send_els->handler = zfcp_erp_adisc_handler; send_els->handler_data = (unsigned long) send_els; @@ -350,7 +351,7 @@ zfcp_erp_adisc(struct zfcp_adapter *adapter, fc_id_t d_id) ZFCP_LOG_INFO("ADISC request from s_id 0x%08x to d_id 0x%08x " "(wwpn=0x%016Lx, wwnn=0x%016Lx, " "hard_nport_id=0x%08x, nport_id=0x%08x)\n", - adapter->s_id, d_id, (wwn_t) adisc->wwpn, + adapter->s_id, send_els->d_id, (wwn_t) adisc->wwpn, (wwn_t) adisc->wwnn, adisc->hard_nport_id, adisc->nport_id); @@ -367,7 +368,7 @@ zfcp_erp_adisc(struct zfcp_adapter *adapter, fc_id_t d_id) retval = zfcp_fsf_send_els(send_els); if (retval != 0) { ZFCP_LOG_NORMAL("error: initiation of Send ELS failed for port " - "0x%08x on adapter %s\n", d_id, + "0x%08x on adapter %s\n", send_els->d_id, zfcp_get_busid_by_adapter(adapter)); del_timer(send_els->timer); goto freemem; @@ -411,14 +412,9 @@ zfcp_erp_adisc_handler(unsigned long data) del_timer(send_els->timer); adapter = send_els->adapter; + port = send_els->port; d_id = send_els->d_id; - read_lock(&zfcp_data.config_lock); - port = zfcp_get_port_by_did(send_els->adapter, send_els->d_id); - read_unlock(&zfcp_data.config_lock); - - BUG_ON(port == NULL); - /* request rejected or timed out */ if (send_els->status != 0) { ZFCP_LOG_NORMAL("ELS request rejected/timed out, " @@ -482,7 +478,7 @@ zfcp_test_link(struct zfcp_port *port) int retval; zfcp_port_get(port); - retval = zfcp_erp_adisc(port->adapter, port->d_id); + retval = zfcp_erp_adisc(port); if (retval != 0) { zfcp_port_put(port); ZFCP_LOG_NORMAL("reopen needed for port 0x%016Lx " diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index bf66fc6d8a97..21a6d7633475 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -1771,8 +1771,8 @@ zfcp_fsf_send_els(struct zfcp_send_els *els) static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) { struct zfcp_adapter *adapter; - fc_id_t d_id; struct zfcp_port *port; + fc_id_t d_id; struct fsf_qtcb_header *header; struct fsf_qtcb_bottom_support *bottom; struct zfcp_send_els *send_els; @@ -1781,6 +1781,7 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) send_els = fsf_req->data.send_els; adapter = send_els->adapter; + port = send_els->port; d_id = send_els->d_id; header = &fsf_req->qtcb->header; bottom = &fsf_req->qtcb->bottom.support; @@ -1817,13 +1818,8 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) switch (header->fsf_status_qual.word[0]){ case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest"); - if (send_els->ls_code != ZFCP_LS_ADISC) { - read_lock(&zfcp_data.config_lock); - port = zfcp_get_port_by_did(adapter, d_id); - if (port) - zfcp_test_link(port); - read_unlock(&zfcp_data.config_lock); - } + if (port && (send_els->ls_code != ZFCP_LS_ADISC)) + zfcp_test_link(port); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: @@ -1913,11 +1909,8 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) } } debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); - read_lock(&zfcp_data.config_lock); - port = zfcp_get_port_by_did(adapter, d_id); if (port != NULL) zfcp_erp_port_access_denied(port); - read_unlock(&zfcp_data.config_lock); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; -- cgit v1.2.2 From 1db2c9c0931a53fe013db55fd2ff58859db31e8d Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Mon, 13 Jun 2005 13:20:35 +0200 Subject: [SCSI] zfcp: fix bug during adapter shutdown Fixes a race between zfcp_fsf_req_dismiss_all and zfcp_qdio_reqid_check. During adapter shutdown it occurred that a request was cleaned up twice. First during its normal completion. Second when dismiss_all was called. The fix is to serialize access to fsf request list between zfcp_fsf_req_dismiss_all and zfcp_qdio_reqid_check and delete a fsf request from the list if its completion is triggered. (Additionally a rwlock was replaced by a spinlock and fsf_req_cleanup was eliminated.) Signed-off-by: Andreas Herrmann Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_aux.c | 8 ++--- drivers/s390/scsi/zfcp_def.h | 2 +- drivers/s390/scsi/zfcp_erp.c | 4 +-- drivers/s390/scsi/zfcp_ext.h | 2 +- drivers/s390/scsi/zfcp_fsf.c | 79 ++++++++++++------------------------------- drivers/s390/scsi/zfcp_qdio.c | 28 +++++++-------- drivers/s390/scsi/zfcp_scsi.c | 2 +- 7 files changed, 45 insertions(+), 80 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 6bb4d332b474..c999042dae15 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -520,7 +520,7 @@ zfcp_cfdc_dev_ioctl(struct file *file, unsigned int command, out: if (fsf_req != NULL) - zfcp_fsf_req_cleanup(fsf_req); + zfcp_fsf_req_free(fsf_req); if ((adapter != NULL) && (retval != -ENXIO)) zfcp_adapter_put(adapter); @@ -1149,7 +1149,7 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device) INIT_LIST_HEAD(&adapter->port_remove_lh); /* initialize list of fsf requests */ - rwlock_init(&adapter->fsf_req_list_lock); + spin_lock_init(&adapter->fsf_req_list_lock); INIT_LIST_HEAD(&adapter->fsf_req_list_head); /* initialize abort lock */ @@ -1234,9 +1234,9 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter) zfcp_sysfs_adapter_remove_files(&adapter->ccw_device->dev); dev_set_drvdata(&adapter->ccw_device->dev, NULL); /* sanity check: no pending FSF requests */ - read_lock_irqsave(&adapter->fsf_req_list_lock, flags); + spin_lock_irqsave(&adapter->fsf_req_list_lock, flags); retval = !list_empty(&adapter->fsf_req_list_head); - read_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); + spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); if (retval) { ZFCP_LOG_NORMAL("bug: adapter %s (%p) still in use, " "%i requests outstanding\n", diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 37982058e4d9..bfbbb825f9ab 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -861,7 +861,7 @@ struct zfcp_adapter { u32 ports; /* number of remote ports */ struct timer_list scsi_er_timer; /* SCSI err recovery watch */ struct list_head fsf_req_list_head; /* head of FSF req list */ - rwlock_t fsf_req_list_lock; /* lock for ops on list of + spinlock_t fsf_req_list_lock; /* lock for ops on list of FSF requests */ atomic_t fsf_reqs_active; /* # active FSF reqs */ 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 41c67e1ec4f7..6d73891eec9e 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -891,7 +891,7 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action) if (erp_action->fsf_req) { /* take lock to ensure that request is not being deleted meanwhile */ - write_lock(&adapter->fsf_req_list_lock); + spin_lock(&adapter->fsf_req_list_lock); /* check whether fsf req does still exist */ list_for_each_entry(fsf_req, &adapter->fsf_req_list_head, list) if (fsf_req == erp_action->fsf_req) @@ -934,7 +934,7 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action) */ erp_action->fsf_req = NULL; } - write_unlock(&adapter->fsf_req_list_lock); + spin_unlock(&adapter->fsf_req_list_lock); } else debug_text_event(adapter->erp_dbf, 3, "a_ca_noreq"); diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index d5fd43352071..8f0da2e02a47 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 *, struct timer_list*, int); extern int zfcp_fsf_req_complete(struct zfcp_fsf_req *); extern void zfcp_fsf_incoming_els(struct zfcp_fsf_req *); -extern void zfcp_fsf_req_cleanup(struct zfcp_fsf_req *); +extern void zfcp_fsf_req_free(struct zfcp_fsf_req *); extern struct zfcp_fsf_req *zfcp_fsf_send_fcp_command_task_management( struct zfcp_adapter *, struct zfcp_unit *, u8, int); extern struct zfcp_fsf_req *zfcp_fsf_abort_fcp_command( diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 21a6d7633475..56b2ea97da1f 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 *); static int zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *); static int zfcp_fsf_req_dispatch(struct zfcp_fsf_req *); static void zfcp_fsf_req_dismiss(struct zfcp_fsf_req *); -static void zfcp_fsf_req_free(struct zfcp_fsf_req *); /* association between FSF command and FSF QTCB type */ static u32 fsf_qtcb_type[] = { @@ -149,13 +148,13 @@ zfcp_fsf_req_alloc(mempool_t *pool, int req_flags) * * locks: none */ -static void +void zfcp_fsf_req_free(struct zfcp_fsf_req *fsf_req) { if (likely(fsf_req->pool != NULL)) mempool_free(fsf_req, fsf_req->pool); - else - kfree(fsf_req); + else + kfree(fsf_req); } /* @@ -170,30 +169,21 @@ zfcp_fsf_req_free(struct zfcp_fsf_req *fsf_req) int zfcp_fsf_req_dismiss_all(struct zfcp_adapter *adapter) { - int retval = 0; struct zfcp_fsf_req *fsf_req, *tmp; + unsigned long flags; + LIST_HEAD(remove_queue); - list_for_each_entry_safe(fsf_req, tmp, &adapter->fsf_req_list_head, - list) - zfcp_fsf_req_dismiss(fsf_req); - /* wait_event_timeout? */ - while (!list_empty(&adapter->fsf_req_list_head)) { - ZFCP_LOG_DEBUG("fsf req list of adapter %s not yet empty\n", - zfcp_get_busid_by_adapter(adapter)); - /* wait for woken intiators to clean up their requests */ - msleep(jiffies_to_msecs(ZFCP_FSFREQ_CLEANUP_TIMEOUT)); - } + spin_lock_irqsave(&adapter->fsf_req_list_lock, flags); + list_splice_init(&adapter->fsf_req_list_head, &remove_queue); + atomic_set(&adapter->fsf_reqs_active, 0); + spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); - /* consistency check */ - if (atomic_read(&adapter->fsf_reqs_active)) { - ZFCP_LOG_NORMAL("bug: There are still %d FSF requests pending " - "on adapter %s after cleanup.\n", - atomic_read(&adapter->fsf_reqs_active), - zfcp_get_busid_by_adapter(adapter)); - atomic_set(&adapter->fsf_reqs_active, 0); + list_for_each_entry_safe(fsf_req, tmp, &remove_queue, list) { + list_del(&fsf_req->list); + zfcp_fsf_req_dismiss(fsf_req); } - return retval; + return 0; } /* @@ -226,10 +216,6 @@ zfcp_fsf_req_complete(struct zfcp_fsf_req *fsf_req) { int retval = 0; int cleanup; - struct zfcp_adapter *adapter = fsf_req->adapter; - - /* do some statistics */ - atomic_dec(&adapter->fsf_reqs_active); if (unlikely(fsf_req->fsf_command == FSF_QTCB_UNSOLICITED_STATUS)) { ZFCP_LOG_DEBUG("Status read response received\n"); @@ -260,7 +246,7 @@ zfcp_fsf_req_complete(struct zfcp_fsf_req *fsf_req) * lock must not be held here since it will be * grabed by the called routine, too */ - zfcp_fsf_req_cleanup(fsf_req); + zfcp_fsf_req_free(fsf_req); } else { /* notify initiator waiting for the requests completion */ ZFCP_LOG_TRACE("waking initiator of FSF request %p\n",fsf_req); @@ -936,7 +922,7 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED) { mempool_free(status_buffer, adapter->pool.data_status_read); - zfcp_fsf_req_cleanup(fsf_req); + zfcp_fsf_req_free(fsf_req); goto out; } @@ -1033,7 +1019,7 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) break; } mempool_free(status_buffer, adapter->pool.data_status_read); - zfcp_fsf_req_cleanup(fsf_req); + zfcp_fsf_req_free(fsf_req); /* * recycle buffer and start new request repeat until outbound * queue is empty or adapter shutdown is requested @@ -2258,7 +2244,7 @@ zfcp_fsf_exchange_port_data(struct zfcp_adapter *adapter, wait_event(fsf_req->completion_wq, fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); del_timer_sync(timer); - zfcp_fsf_req_cleanup(fsf_req); + zfcp_fsf_req_free(fsf_req); out: kfree(timer); return retval; @@ -4607,7 +4593,7 @@ zfcp_fsf_req_wait_and_cleanup(struct zfcp_fsf_req *fsf_req, *status = fsf_req->status; /* cleanup request */ - zfcp_fsf_req_cleanup(fsf_req); + zfcp_fsf_req_free(fsf_req); out: return retval; } @@ -4806,9 +4792,9 @@ zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer) inc_seq_no = 0; /* put allocated FSF request at list tail */ - write_lock_irqsave(&adapter->fsf_req_list_lock, flags); + spin_lock_irqsave(&adapter->fsf_req_list_lock, flags); list_add_tail(&fsf_req->list, &adapter->fsf_req_list_head); - write_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); + spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); /* figure out expiration time of timeout and start timeout */ if (unlikely(timer)) { @@ -4852,9 +4838,9 @@ zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer) */ if (timer) del_timer(timer); - write_lock_irqsave(&adapter->fsf_req_list_lock, flags); + spin_lock_irqsave(&adapter->fsf_req_list_lock, flags); list_del(&fsf_req->list); - write_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); + spin_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); /* * adjust the number of free SBALs in request queue as well as * position of first one @@ -4892,25 +4878,4 @@ zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer) return retval; } -/* - * function: zfcp_fsf_req_cleanup - * - * purpose: cleans up an FSF request and removes it from the specified list - * - * returns: - * - * assumption: no pending SB in SBALEs other than QTCB - */ -void -zfcp_fsf_req_cleanup(struct zfcp_fsf_req *fsf_req) -{ - struct zfcp_adapter *adapter = fsf_req->adapter; - unsigned long flags; - - write_lock_irqsave(&adapter->fsf_req_list_lock, flags); - list_del(&fsf_req->list); - write_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); - zfcp_fsf_req_free(fsf_req); -} - #undef ZFCP_LOG_AREA diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index fb218dd9d934..24e16ec331d9 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c @@ -446,37 +446,37 @@ int zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, void *sbale_addr) { struct zfcp_fsf_req *fsf_req; - int retval = 0; /* invalid (per convention used in this driver) */ if (unlikely(!sbale_addr)) { ZFCP_LOG_NORMAL("bug: invalid reqid\n"); - retval = -EINVAL; - goto out; + return -EINVAL; } /* valid request id and thus (hopefully :) valid fsf_req address */ fsf_req = (struct zfcp_fsf_req *) sbale_addr; + /* serialize with zfcp_fsf_req_dismiss_all */ + spin_lock(&adapter->fsf_req_list_lock); + if (list_empty(&adapter->fsf_req_list_head)) { + spin_unlock(&adapter->fsf_req_list_lock); + return 0; + } + list_del(&fsf_req->list); + atomic_dec(&adapter->fsf_reqs_active); + spin_unlock(&adapter->fsf_req_list_lock); + if (unlikely(adapter != fsf_req->adapter)) { ZFCP_LOG_NORMAL("bug: invalid reqid (fsf_req=%p, " "fsf_req->adapter=%p, adapter=%p)\n", fsf_req, fsf_req->adapter, adapter); - retval = -EINVAL; - goto out; - } - - ZFCP_LOG_TRACE("fsf_req at %p, QTCB at %p\n", fsf_req, fsf_req->qtcb); - if (likely(fsf_req->qtcb)) { - ZFCP_LOG_TRACE("hex dump of QTCB:\n"); - ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE, (char *) fsf_req->qtcb, - sizeof(struct fsf_qtcb)); + return -EINVAL; } /* finish the FSF request */ zfcp_fsf_req_complete(fsf_req); - out: - return retval; + + return 0; } /** diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index e21b547fd427..c6f69fc475a2 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -575,7 +575,7 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) *(u64 *) & new_fsf_req->qtcb->header.fsf_status_qual.word[0]; dbf_fsf_qual[1] = *(u64 *) & new_fsf_req->qtcb->header.fsf_status_qual.word[2]; - zfcp_fsf_req_cleanup(new_fsf_req); + zfcp_fsf_req_free(new_fsf_req); #else retval = zfcp_fsf_req_wait_and_cleanup(new_fsf_req, ZFCP_UNINTERRUPTIBLE, &status); -- cgit v1.2.2 From cd8a383ebc93f8ded9cefee53a337542c3aacad7 Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Mon, 13 Jun 2005 13:22:25 +0200 Subject: [SCSI] zfcp: fix module parameter parsing From: Heiko Carstens Fixes module parameter parsing for "device" parameter. The original module parameter was changed while parsing it. This corrupted the output in sysfs (/sys/module/zfcp/parameters/device). Signed-off-by: Andreas Herrmann Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_aux.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index c999042dae15..e17b4d58a9f6 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -218,13 +218,20 @@ zfcp_in_els_dbf_event(struct zfcp_adapter *adapter, const char *text, * Parse "device=..." parameter string. */ static int __init -zfcp_device_setup(char *str) +zfcp_device_setup(char *devstr) { - char *tmp; + char *tmp, *str; + size_t len; - if (!str) + if (!devstr) return 0; + len = strlen(devstr) + 1; + str = (char *) kmalloc(len, GFP_KERNEL); + if (!str) + goto err_out; + memcpy(str, devstr, len); + tmp = strchr(str, ','); if (!tmp) goto err_out; @@ -241,10 +248,12 @@ zfcp_device_setup(char *str) zfcp_data.init_fcp_lun = simple_strtoull(tmp, &tmp, 0); if (*tmp != '\0') goto err_out; + kfree(str); return 1; err_out: ZFCP_LOG_NORMAL("Parse error for device parameter string %s\n", str); + kfree(str); return 0; } -- cgit v1.2.2 From d736a27b7efbc835c7b83db5c1bbd41edbadf32e Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Mon, 13 Jun 2005 13:23:57 +0200 Subject: [SCSI] zfcp: fix handling of port boxed and lun boxed fsf states From: Maxim Shchetynin Signed-off-by: Andreas Herrmann Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_def.h | 1 + drivers/s390/scsi/zfcp_erp.c | 68 +++++++++++++++++++++++++++++++++++++------- drivers/s390/scsi/zfcp_ext.h | 2 ++ drivers/s390/scsi/zfcp_fsf.c | 32 +++++++++------------ 4 files changed, 75 insertions(+), 28 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index bfbbb825f9ab..4103b5be7683 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -490,6 +490,7 @@ do { \ #define ZFCP_STATUS_COMMON_CLOSING 0x02000000 #define ZFCP_STATUS_COMMON_ERP_INUSE 0x01000000 #define ZFCP_STATUS_COMMON_ACCESS_DENIED 0x00800000 +#define ZFCP_STATUS_COMMON_ACCESS_BOXED 0x00400000 /* adapter status */ #define ZFCP_STATUS_ADAPTER_QDIOUP 0x00000002 diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 6d73891eec9e..0cf31f7d1c0f 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -3481,6 +3481,45 @@ zfcp_erp_action_to_ready(struct zfcp_erp_action *erp_action) list_move(&erp_action->list, &erp_action->adapter->erp_ready_head); } +/* + * function: zfcp_erp_port_boxed + * + * purpose: + */ +void +zfcp_erp_port_boxed(struct zfcp_port *port) +{ + struct zfcp_adapter *adapter = port->adapter; + unsigned long flags; + + debug_text_event(adapter->erp_dbf, 3, "p_access_boxed"); + debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); + read_lock_irqsave(&zfcp_data.config_lock, flags); + zfcp_erp_modify_port_status(port, + ZFCP_STATUS_COMMON_ACCESS_BOXED, + ZFCP_SET); + read_unlock_irqrestore(&zfcp_data.config_lock, flags); + zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED); +} + +/* + * function: zfcp_erp_unit_boxed + * + * purpose: + */ +void +zfcp_erp_unit_boxed(struct zfcp_unit *unit) +{ + struct zfcp_adapter *adapter = unit->port->adapter; + + debug_text_event(adapter->erp_dbf, 3, "u_access_boxed"); + debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); + zfcp_erp_modify_unit_status(unit, + ZFCP_STATUS_COMMON_ACCESS_BOXED, + ZFCP_SET); + zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED); +} + /* * function: zfcp_erp_port_access_denied * @@ -3492,11 +3531,13 @@ zfcp_erp_port_access_denied(struct zfcp_port *port) struct zfcp_adapter *adapter = port->adapter; unsigned long flags; - debug_text_event(adapter->erp_dbf, 3, "p_access_block"); + debug_text_event(adapter->erp_dbf, 3, "p_access_denied"); debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); read_lock_irqsave(&zfcp_data.config_lock, flags); - zfcp_erp_modify_port_status(port, ZFCP_STATUS_COMMON_ERP_FAILED | - ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); + zfcp_erp_modify_port_status(port, + ZFCP_STATUS_COMMON_ERP_FAILED | + ZFCP_STATUS_COMMON_ACCESS_DENIED, + ZFCP_SET); read_unlock_irqrestore(&zfcp_data.config_lock, flags); } @@ -3510,10 +3551,12 @@ zfcp_erp_unit_access_denied(struct zfcp_unit *unit) { struct zfcp_adapter *adapter = unit->port->adapter; - debug_text_event(adapter->erp_dbf, 3, "u_access_block"); + debug_text_event(adapter->erp_dbf, 3, "u_access_denied"); debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); - zfcp_erp_modify_unit_status(unit, ZFCP_STATUS_COMMON_ERP_FAILED | - ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); + zfcp_erp_modify_unit_status(unit, + ZFCP_STATUS_COMMON_ERP_FAILED | + ZFCP_STATUS_COMMON_ACCESS_DENIED, + ZFCP_SET); } /* @@ -3527,7 +3570,7 @@ zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter) struct zfcp_port *port; unsigned long flags; - debug_text_event(adapter->erp_dbf, 3, "a_access_unblock"); + debug_text_event(adapter->erp_dbf, 3, "a_access_recover"); debug_event(adapter->erp_dbf, 3, &adapter->name, 8); read_lock_irqsave(&zfcp_data.config_lock, flags); @@ -3550,10 +3593,12 @@ zfcp_erp_port_access_changed(struct zfcp_port *port) struct zfcp_adapter *adapter = port->adapter; struct zfcp_unit *unit; - debug_text_event(adapter->erp_dbf, 3, "p_access_unblock"); + debug_text_event(adapter->erp_dbf, 3, "p_access_recover"); debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, + &port->status) && + !atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_BOXED, &port->status)) { if (!atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status)) list_for_each_entry(unit, &port->unit_list_head, list) @@ -3580,10 +3625,13 @@ zfcp_erp_unit_access_changed(struct zfcp_unit *unit) { struct zfcp_adapter *adapter = unit->port->adapter; - debug_text_event(adapter->erp_dbf, 3, "u_access_unblock"); + debug_text_event(adapter->erp_dbf, 3, "u_access_recover"); debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); - if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, &unit->status)) + if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, + &unit->status) && + !atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_BOXED, + &unit->status)) return; 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 8f0da2e02a47..42df7e57eeae 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h @@ -171,6 +171,8 @@ extern int zfcp_erp_async_handler(struct zfcp_erp_action *, unsigned long); extern int zfcp_test_link(struct zfcp_port *); +extern void zfcp_erp_port_boxed(struct zfcp_port *); +extern void zfcp_erp_unit_boxed(struct zfcp_unit *); extern void zfcp_erp_port_access_denied(struct zfcp_port *); extern void zfcp_erp_unit_access_denied(struct zfcp_unit *); extern 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 56b2ea97da1f..0d9f20edc490 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -1228,7 +1228,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) zfcp_get_busid_by_unit(unit)); debug_text_event(new_fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); - zfcp_erp_port_reopen(unit->port, 0); + zfcp_erp_port_boxed(unit->port); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -1240,10 +1240,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) unit->fcp_lun, unit->port->wwpn, zfcp_get_busid_by_unit(unit)); debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); - zfcp_erp_unit_reopen(unit, 0); - zfcp_cmd_dbf_event_fsf("unitbox", new_fsf_req, - &new_fsf_req->qtcb->header.fsf_status_qual, - sizeof(union fsf_status_qual)); + zfcp_erp_unit_boxed(unit); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -1573,7 +1570,7 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) "(adapter %s, port d_id=0x%08x)\n", zfcp_get_busid_by_port(port), port->d_id); debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); - zfcp_erp_port_reopen(port, 0); + zfcp_erp_port_boxed(port); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -2460,6 +2457,9 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) /* mark port as open */ atomic_set_mask(ZFCP_STATUS_COMMON_OPEN | ZFCP_STATUS_PORT_PHYS_OPEN, &port->status); + atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | + ZFCP_STATUS_COMMON_ACCESS_BOXED, + &port->status); retval = 0; /* check whether D_ID has changed during open */ /* @@ -2803,7 +2803,7 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) port->wwpn, zfcp_get_busid_by_port(port)); debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_pboxed"); - zfcp_erp_port_reopen(port, 0); + zfcp_erp_port_boxed(port); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -3035,7 +3035,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) "needs to be reopened\n", unit->port->wwpn, zfcp_get_busid_by_unit(unit)); debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); - zfcp_erp_port_reopen(unit->port, 0); + zfcp_erp_port_boxed(unit->port); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -3145,7 +3145,9 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) unit->handle); /* mark unit as open */ atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status); - + atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | + ZFCP_STATUS_COMMON_ACCESS_BOXED, + &unit->status); if (adapter->supported_features & FSF_FEATURE_LUN_SHARING){ if (!exclusive) atomic_set_mask(ZFCP_STATUS_UNIT_SHARED, @@ -3335,7 +3337,7 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) unit->port->wwpn, zfcp_get_busid_by_unit(unit)); debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); - zfcp_erp_port_reopen(unit->port, 0); + zfcp_erp_port_boxed(unit->port); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -3881,10 +3883,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) "needs to be reopened\n", unit->port->wwpn, zfcp_get_busid_by_unit(unit)); debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); - zfcp_erp_port_reopen(unit->port, 0); - zfcp_cmd_dbf_event_fsf("portbox", fsf_req, - &header->fsf_status_qual, - sizeof (union fsf_status_qual)); + zfcp_erp_port_boxed(unit->port); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -3895,10 +3894,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_unit(unit), unit->port->wwpn, unit->fcp_lun); debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); - zfcp_erp_unit_reopen(unit, 0); - zfcp_cmd_dbf_event_fsf("unitbox", fsf_req, - &header->fsf_status_qual, - sizeof(union fsf_status_qual)); + zfcp_erp_unit_boxed(unit); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; -- cgit v1.2.2 From 8fa728a26886f56a9ee10a44fea0ddda301d21c3 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sat, 28 May 2005 07:54:40 -0400 Subject: [SCSI] allow sleeping in ->eh_abort_handler() Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_scsi.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index c6f69fc475a2..6e4447598495 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) * FAILED - otherwise */ int -zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) +__zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) { int retval = SUCCESS; struct zfcp_fsf_req *new_fsf_req, *old_fsf_req; @@ -611,6 +611,17 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) return retval; } +int +zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) +{ + int rc; + struct Scsi_Host *scsi_host = scpnt->device->host; + spin_lock_irq(scsi_host->host_lock); + rc = __zfcp_scsi_eh_abort_handler(scpnt); + spin_unlock_irq(scsi_host->host_lock); + return rc; +} + /* * function: zfcp_scsi_eh_device_reset_handler * -- cgit v1.2.2 From 94d0e7b805961c44e4dc486ffc21075084bb7175 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sat, 28 May 2005 07:55:48 -0400 Subject: [SCSI] allow sleeping in ->eh_device_reset_handler() Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_scsi.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 6e4447598495..be7c91d4ae8c 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -636,8 +636,6 @@ zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt) struct zfcp_unit *unit = (struct zfcp_unit *) scpnt->device->hostdata; struct Scsi_Host *scsi_host = scpnt->device->host; - spin_unlock_irq(scsi_host->host_lock); - if (!unit) { ZFCP_LOG_NORMAL("bug: Tried reset for nonexistent unit\n"); retval = SUCCESS; @@ -680,7 +678,6 @@ zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt) retval = SUCCESS; } out: - spin_lock_irq(scsi_host->host_lock); return retval; } -- cgit v1.2.2 From 68b3aa7c9805aee9005a8ca53c5e99177961fbb9 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sat, 28 May 2005 07:56:31 -0400 Subject: [SCSI] allow sleeping in ->eh_bus_reset_handler() Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_scsi.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index be7c91d4ae8c..ac5a5da434b3 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -731,8 +731,6 @@ zfcp_scsi_eh_bus_reset_handler(struct scsi_cmnd *scpnt) struct zfcp_unit *unit; struct Scsi_Host *scsi_host = scpnt->device->host; - spin_unlock_irq(scsi_host->host_lock); - unit = (struct zfcp_unit *) scpnt->device->hostdata; ZFCP_LOG_NORMAL("bus reset because of problems with " "unit 0x%016Lx\n", unit->fcp_lun); @@ -740,7 +738,6 @@ zfcp_scsi_eh_bus_reset_handler(struct scsi_cmnd *scpnt) zfcp_erp_wait(unit->port->adapter); retval = SUCCESS; - spin_lock_irq(scsi_host->host_lock); return retval; } -- cgit v1.2.2 From df0ae2497ddefd72a87f3a3b34ff32455d7d4ae0 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sat, 28 May 2005 07:57:14 -0400 Subject: [SCSI] allow sleeping in ->eh_host_reset_handler() Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_scsi.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index ac5a5da434b3..6965992ddbbf 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -755,8 +755,6 @@ zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt) struct zfcp_unit *unit; struct Scsi_Host *scsi_host = scpnt->device->host; - spin_unlock_irq(scsi_host->host_lock); - unit = (struct zfcp_unit *) scpnt->device->hostdata; ZFCP_LOG_NORMAL("host reset because of problems with " "unit 0x%016Lx\n", unit->fcp_lun); @@ -764,7 +762,6 @@ zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt) zfcp_erp_wait(unit->port->adapter); retval = SUCCESS; - spin_lock_irq(scsi_host->host_lock); return retval; } -- cgit v1.2.2