Commit 12c845ae authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] s390: zfcp log messages part 1

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

zfcp host adapter log message cleanup part 1:
 - Shorten log output.
 - Increase log level for some messages.
 - Always print leading zeroes for wwpn and fcp-lun.
parent f9a56f8a
...@@ -400,11 +400,6 @@ zfcp_module_init(void) ...@@ -400,11 +400,6 @@ zfcp_module_init(void)
atomic_set(&zfcp_data.loglevel, loglevel); atomic_set(&zfcp_data.loglevel, loglevel);
ZFCP_LOG_DEBUG(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
ZFCP_LOG_TRACE("Start Address of module: 0x%lx\n",
(unsigned long) &zfcp_module_init);
/* initialize adapter list */ /* initialize adapter list */
INIT_LIST_HEAD(&zfcp_data.adapter_list_head); INIT_LIST_HEAD(&zfcp_data.adapter_list_head);
...@@ -419,22 +414,18 @@ zfcp_module_init(void) ...@@ -419,22 +414,18 @@ zfcp_module_init(void)
retval = register_ioctl32_conversion(zfcp_ioctl_trans.cmd, retval = register_ioctl32_conversion(zfcp_ioctl_trans.cmd,
zfcp_ioctl_trans.handler); zfcp_ioctl_trans.handler);
if (retval != 0) { if (retval != 0) {
ZFCP_LOG_INFO("Cannot register a 32-bit support of " ZFCP_LOG_INFO("registration of ioctl32 conversion failed\n");
"the IOC handler\n");
goto out_ioctl32; goto out_ioctl32;
} }
#endif #endif
retval = misc_register(&zfcp_cfdc_misc); retval = misc_register(&zfcp_cfdc_misc);
if (retval != 0) { if (retval != 0) {
ZFCP_LOG_INFO( ZFCP_LOG_INFO("registration of misc device "
"Device file for the control file data channel " "zfcp_cfdc failed\n");
"cannot be registered\n");
goto out_misc_register; goto out_misc_register;
} else { } else {
ZFCP_LOG_INFO( ZFCP_LOG_TRACE("major/minor for zfcp_cfdc: %d/%d\n",
"Device file for the control file data channel " ZFCP_CFDC_DEV_MAJOR, zfcp_cfdc_misc.minor);
"has become MAJOR/MINOR numbers %d/%d\n",
ZFCP_CFDC_DEV_MAJOR, zfcp_cfdc_misc.minor);
} }
/* Initialise proc semaphores */ /* Initialise proc semaphores */
...@@ -452,7 +443,7 @@ zfcp_module_init(void) ...@@ -452,7 +443,7 @@ zfcp_module_init(void)
/* setup dynamic I/O */ /* setup dynamic I/O */
retval = zfcp_ccw_register(); retval = zfcp_ccw_register();
if (retval) { if (retval) {
ZFCP_LOG_NORMAL("Registering with common I/O layer failed.\n"); ZFCP_LOG_NORMAL("registration with common I/O layer failed\n");
goto out_ccw_register; goto out_ccw_register;
} }
...@@ -521,46 +512,35 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file, ...@@ -521,46 +512,35 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file,
char *bus_id = NULL; char *bus_id = NULL;
int retval = 0; int retval = 0;
ZFCP_LOG_NORMAL(
"Control file data channel transaction opened\n");
sg_list = kmalloc(sizeof(struct zfcp_sg_list), GFP_KERNEL); sg_list = kmalloc(sizeof(struct zfcp_sg_list), GFP_KERNEL);
if (sg_list == NULL) { if (sg_list == NULL) {
ZFCP_LOG_NORMAL(
"Not enough memory for the scatter-gather list\n");
retval = -ENOMEM; retval = -ENOMEM;
goto out; goto out;
} }
sg_list->count = 0; sg_list->count = 0;
if (command != ZFCP_CFDC_IOC) { if (command != ZFCP_CFDC_IOC) {
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("IOC request code 0x%x invalid\n", command);
"IOC request code 0x%x is not valid\n",
command);
retval = -ENOTTY; retval = -ENOTTY;
goto out; goto out;
} }
if ((sense_data_user = (struct zfcp_cfdc_sense_data*)buffer) == NULL) { if ((sense_data_user = (struct zfcp_cfdc_sense_data*)buffer) == NULL) {
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("sense data record is required\n");
"Sense data record is required\n");
retval = -EINVAL; retval = -EINVAL;
goto out; goto out;
} }
retval = copy_from_user(&sense_data, sense_data_user, retval = copy_from_user(&sense_data, sense_data_user,
sizeof(struct zfcp_cfdc_sense_data)); sizeof(struct zfcp_cfdc_sense_data));
if (retval) { if (retval) {
ZFCP_LOG_NORMAL("Cannot copy sense data record from user space "
"memory\n");
retval = -EFAULT; retval = -EFAULT;
goto out; goto out;
} }
if (sense_data.signature != ZFCP_CFDC_SIGNATURE) { if (sense_data.signature != ZFCP_CFDC_SIGNATURE) {
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("invalid sense data request signature 0x%08x\n",
"No valid sense data request signature 0x%08x found\n", ZFCP_CFDC_SIGNATURE);
ZFCP_CFDC_SIGNATURE);
retval = -EINVAL; retval = -EINVAL;
goto out; goto out;
} }
...@@ -593,16 +573,14 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file, ...@@ -593,16 +573,14 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file,
break; break;
default: default:
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("invalid command code 0x%08x\n",
"Command code 0x%08x is not valid\n", sense_data.command);
sense_data.command);
retval = -EINVAL; retval = -EINVAL;
goto out; goto out;
} }
bus_id = kmalloc(BUS_ID_SIZE, GFP_KERNEL); bus_id = kmalloc(BUS_ID_SIZE, GFP_KERNEL);
if (bus_id == NULL) { if (bus_id == NULL) {
ZFCP_LOG_NORMAL("Out of memory!\n");
retval = -ENOMEM; retval = -ENOMEM;
goto out; goto out;
} }
...@@ -626,7 +604,7 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file, ...@@ -626,7 +604,7 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file,
kfree(bus_id); kfree(bus_id);
if (retval != 0) { if (retval != 0) {
ZFCP_LOG_NORMAL("Specified adapter does not exist\n"); ZFCP_LOG_INFO("invalid adapter\n");
goto out; goto out;
} }
...@@ -634,8 +612,6 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file, ...@@ -634,8 +612,6 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file,
retval = zfcp_sg_list_alloc(sg_list, retval = zfcp_sg_list_alloc(sg_list,
ZFCP_CFDC_MAX_CONTROL_FILE_SIZE); ZFCP_CFDC_MAX_CONTROL_FILE_SIZE);
if (retval) { if (retval) {
ZFCP_LOG_NORMAL("Not enough memory for the "
"scatter-gather list\n");
retval = -ENOMEM; retval = -ENOMEM;
goto out; goto out;
} }
...@@ -647,8 +623,6 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file, ...@@ -647,8 +623,6 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file,
sg_list, &sense_data_user->control_file, sg_list, &sense_data_user->control_file,
ZFCP_CFDC_MAX_CONTROL_FILE_SIZE); ZFCP_CFDC_MAX_CONTROL_FILE_SIZE);
if (retval) { if (retval) {
ZFCP_LOG_NORMAL("Cannot copy control file from user "
"space memory\n");
retval = -EFAULT; retval = -EFAULT;
goto out; goto out;
} }
...@@ -657,12 +631,10 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file, ...@@ -657,12 +631,10 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file,
retval = zfcp_fsf_control_file( retval = zfcp_fsf_control_file(
adapter, &fsf_req, fsf_command, option, sg_list); adapter, &fsf_req, fsf_command, option, sg_list);
if (retval == -EOPNOTSUPP) { if (retval == -EOPNOTSUPP) {
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("adapter does not support cfdc\n");
"Specified adapter does not support control file\n");
goto out; goto out;
} else if (retval != 0) { } else if (retval != 0) {
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("initiation of cfdc up/download failed\n");
"Cannot create or queue FSF request or create SBALs\n");
retval = -EPERM; retval = -EPERM;
goto out; goto out;
} }
...@@ -679,8 +651,6 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file, ...@@ -679,8 +651,6 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file,
retval = copy_to_user(sense_data_user, &sense_data, retval = copy_to_user(sense_data_user, &sense_data,
sizeof(struct zfcp_cfdc_sense_data)); sizeof(struct zfcp_cfdc_sense_data));
if (retval) { if (retval) {
ZFCP_LOG_NORMAL(
"Cannot copy sense data record to user space memory\n");
retval = -EFAULT; retval = -EFAULT;
goto out; goto out;
} }
...@@ -690,8 +660,6 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file, ...@@ -690,8 +660,6 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file,
&sense_data_user->control_file, sg_list, &sense_data_user->control_file, sg_list,
ZFCP_CFDC_MAX_CONTROL_FILE_SIZE); ZFCP_CFDC_MAX_CONTROL_FILE_SIZE);
if (retval) { if (retval) {
ZFCP_LOG_NORMAL("Cannot copy control file to user "
"space memory\n");
retval = -EFAULT; retval = -EFAULT;
goto out; goto out;
} }
...@@ -709,9 +677,6 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file, ...@@ -709,9 +677,6 @@ zfcp_cfdc_dev_ioctl(struct inode *inode, struct file *file,
kfree(sg_list); kfree(sg_list);
} }
ZFCP_LOG_NORMAL(
"Control file data channel transaction closed\n");
return retval; return retval;
} }
...@@ -804,7 +769,6 @@ zfcp_sg_list_copy_from_user(struct zfcp_sg_list *sg_list, void *user_buffer, ...@@ -804,7 +769,6 @@ zfcp_sg_list_copy_from_user(struct zfcp_sg_list *sg_list, void *user_buffer,
zfcp_buffer = (void*) zfcp_buffer = (void*)
((page_to_pfn(sg->page) << PAGE_SHIFT) + sg->offset); ((page_to_pfn(sg->page) << PAGE_SHIFT) + sg->offset);
if (copy_from_user(zfcp_buffer, user_buffer, length)) { if (copy_from_user(zfcp_buffer, user_buffer, length)) {
ZFCP_LOG_INFO("Memory error (copy_from_user)\n");
retval = -EFAULT; retval = -EFAULT;
goto out; goto out;
} }
...@@ -839,7 +803,6 @@ zfcp_sg_list_copy_to_user(void *user_buffer, struct zfcp_sg_list *sg_list, ...@@ -839,7 +803,6 @@ zfcp_sg_list_copy_to_user(void *user_buffer, struct zfcp_sg_list *sg_list,
zfcp_buffer = (void*) zfcp_buffer = (void*)
((page_to_pfn(sg->page) << PAGE_SHIFT) + sg->offset); ((page_to_pfn(sg->page) << PAGE_SHIFT) + sg->offset);
if (copy_to_user(user_buffer, zfcp_buffer, length)) { if (copy_to_user(user_buffer, zfcp_buffer, length)) {
ZFCP_LOG_INFO("Memory error (copy_to_user)\n");
retval = -EFAULT; retval = -EFAULT;
goto out; goto out;
} }
...@@ -1037,63 +1000,48 @@ zfcp_allocate_low_mem_buffers(struct zfcp_adapter *adapter) ...@@ -1037,63 +1000,48 @@ zfcp_allocate_low_mem_buffers(struct zfcp_adapter *adapter)
zfcp_mempool_alloc, zfcp_mempool_free, (void *) zfcp_mempool_alloc, zfcp_mempool_free, (void *)
sizeof(struct zfcp_fsf_req_pool_element)); sizeof(struct zfcp_fsf_req_pool_element));
if (NULL == adapter->pool.fsf_req_erp) { if (NULL == adapter->pool.fsf_req_erp)
ZFCP_LOG_INFO("error: pool allocation failed (fsf_req_erp)\n");
return -ENOMEM; return -ENOMEM;
}
adapter->pool.fsf_req_scsi = adapter->pool.fsf_req_scsi =
mempool_create(ZFCP_POOL_FSF_REQ_SCSI_NR, mempool_create(ZFCP_POOL_FSF_REQ_SCSI_NR,
zfcp_mempool_alloc, zfcp_mempool_free, (void *) zfcp_mempool_alloc, zfcp_mempool_free, (void *)
sizeof(struct zfcp_fsf_req_pool_element)); sizeof(struct zfcp_fsf_req_pool_element));
if (NULL == adapter->pool.fsf_req_scsi) { if (NULL == adapter->pool.fsf_req_scsi)
ZFCP_LOG_INFO("error: pool allocation failed (fsf_req_scsi)\n");
return -ENOMEM; return -ENOMEM;
}
adapter->pool.fsf_req_abort = adapter->pool.fsf_req_abort =
mempool_create(ZFCP_POOL_FSF_REQ_ABORT_NR, mempool_create(ZFCP_POOL_FSF_REQ_ABORT_NR,
zfcp_mempool_alloc, zfcp_mempool_free, (void *) zfcp_mempool_alloc, zfcp_mempool_free, (void *)
sizeof(struct zfcp_fsf_req_pool_element)); sizeof(struct zfcp_fsf_req_pool_element));
if (NULL == adapter->pool.fsf_req_abort) { if (NULL == adapter->pool.fsf_req_abort)
ZFCP_LOG_INFO("error: pool allocation failed "
"(fsf_req_abort)\n");
return -ENOMEM; return -ENOMEM;
}
adapter->pool.fsf_req_status_read = adapter->pool.fsf_req_status_read =
mempool_create(ZFCP_POOL_STATUS_READ_NR, mempool_create(ZFCP_POOL_STATUS_READ_NR,
zfcp_mempool_alloc, zfcp_mempool_free, zfcp_mempool_alloc, zfcp_mempool_free,
(void *) sizeof(struct zfcp_fsf_req)); (void *) sizeof(struct zfcp_fsf_req));
if (NULL == adapter->pool.fsf_req_status_read) { if (NULL == adapter->pool.fsf_req_status_read)
ZFCP_LOG_INFO("error: pool allocation failed "
"(fsf_req_status_read\n");
return -ENOMEM; return -ENOMEM;
}
adapter->pool.data_status_read = adapter->pool.data_status_read =
mempool_create(ZFCP_POOL_STATUS_READ_NR, mempool_create(ZFCP_POOL_STATUS_READ_NR,
zfcp_mempool_alloc, zfcp_mempool_free, zfcp_mempool_alloc, zfcp_mempool_free,
(void *) sizeof(struct fsf_status_read_buffer)); (void *) sizeof(struct fsf_status_read_buffer));
if (NULL == adapter->pool.data_status_read) { if (NULL == adapter->pool.data_status_read)
ZFCP_LOG_INFO("error: pool allocation failed "
"(data_status_read)\n");
return -ENOMEM; return -ENOMEM;
}
adapter->pool.data_gid_pn = adapter->pool.data_gid_pn =
mempool_create(ZFCP_POOL_DATA_GID_PN_NR, mempool_create(ZFCP_POOL_DATA_GID_PN_NR,
zfcp_mempool_alloc, zfcp_mempool_free, (void *) zfcp_mempool_alloc, zfcp_mempool_free, (void *)
sizeof(struct zfcp_gid_pn_data)); sizeof(struct zfcp_gid_pn_data));
if (NULL == adapter->pool.data_gid_pn) { if (NULL == adapter->pool.data_gid_pn)
ZFCP_LOG_INFO("error: pool allocation failed (data_gid_pn)\n");
return -ENOMEM; return -ENOMEM;
}
return 0; return 0;
} }
...@@ -1229,7 +1177,7 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device) ...@@ -1229,7 +1177,7 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
/* try to allocate new adapter data structure (zeroed) */ /* try to allocate new adapter data structure (zeroed) */
adapter = kmalloc(sizeof (struct zfcp_adapter), GFP_KERNEL); adapter = kmalloc(sizeof (struct zfcp_adapter), GFP_KERNEL);
if (!adapter) { if (!adapter) {
ZFCP_LOG_INFO("error: Allocation of base adapter " ZFCP_LOG_INFO("error: allocation of base adapter "
"structure failed\n"); "structure failed\n");
goto out; goto out;
} }
...@@ -1249,8 +1197,10 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device) ...@@ -1249,8 +1197,10 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
goto qdio_allocate_failed; goto qdio_allocate_failed;
retval = zfcp_allocate_low_mem_buffers(adapter); retval = zfcp_allocate_low_mem_buffers(adapter);
if (retval) if (retval) {
ZFCP_LOG_INFO("error: pool allocation failed\n");
goto failed_low_mem_buffers; goto failed_low_mem_buffers;
}
/* initialise reference count stuff */ /* initialise reference count stuff */
atomic_set(&adapter->refcount, 0); atomic_set(&adapter->refcount, 0);
...@@ -1309,10 +1259,8 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device) ...@@ -1309,10 +1259,8 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
failed_low_mem_buffers: failed_low_mem_buffers:
zfcp_free_low_mem_buffers(adapter); zfcp_free_low_mem_buffers(adapter);
if (qdio_free(ccw_device) != 0) if (qdio_free(ccw_device) != 0)
ZFCP_LOG_NORMAL ZFCP_LOG_NORMAL("bug: qdio_free for adapter %s failed\n",
("bug: could not free memory used by data transfer " zfcp_get_busid_by_adapter(adapter));
"mechanism for adapter %s\n",
zfcp_get_busid_by_adapter(adapter));
qdio_allocate_failed: qdio_allocate_failed:
zfcp_qdio_free_queues(adapter); zfcp_qdio_free_queues(adapter);
queues_alloc_failed: queues_alloc_failed:
...@@ -1343,12 +1291,10 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter) ...@@ -1343,12 +1291,10 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
retval = !list_empty(&adapter->fsf_req_list_head); retval = !list_empty(&adapter->fsf_req_list_head);
read_unlock_irqrestore(&adapter->fsf_req_list_lock, flags); read_unlock_irqrestore(&adapter->fsf_req_list_lock, flags);
if (retval) { if (retval) {
ZFCP_LOG_NORMAL("bug: Adapter %s is still in use, " ZFCP_LOG_NORMAL("bug: adapter %s (%p) still in use, "
"%i requests are still outstanding " "%i requests outstanding\n",
"(debug info 0x%lx)\n", zfcp_get_busid_by_adapter(adapter), adapter,
zfcp_get_busid_by_adapter(adapter), atomic_read(&adapter->fsf_reqs_active));
atomic_read(&adapter->fsf_reqs_active),
(unsigned long) adapter);
retval = -EBUSY; retval = -EBUSY;
goto out; goto out;
} }
...@@ -1361,21 +1307,20 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter) ...@@ -1361,21 +1307,20 @@ zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
/* decrease number of adapters in list */ /* decrease number of adapters in list */
zfcp_data.adapters--; zfcp_data.adapters--;
ZFCP_LOG_TRACE("adapter 0x%lx removed from list, " ZFCP_LOG_TRACE("adapter %s (%p) removed from list, "
"%i adapters still in list\n", "%i adapters still in list\n",
(unsigned long) adapter, zfcp_data.adapters); zfcp_get_busid_by_adapter(adapter),
adapter, zfcp_data.adapters);
retval = qdio_free(adapter->ccw_device); retval = qdio_free(adapter->ccw_device);
if (retval) if (retval)
ZFCP_LOG_NORMAL ZFCP_LOG_NORMAL("bug: qdio_free for adapter %s failed\n",
("bug: could not free memory used by data transfer " zfcp_get_busid_by_adapter(adapter));
"mechanism for adapter %s\n",
zfcp_get_busid_by_adapter(adapter));
zfcp_free_low_mem_buffers(adapter); zfcp_free_low_mem_buffers(adapter);
/* free memory of adapter data structure and queues */ /* free memory of adapter data structure and queues */
zfcp_qdio_free_queues(adapter); zfcp_qdio_free_queues(adapter);
ZFCP_LOG_TRACE("Freeing adapter structure.\n"); ZFCP_LOG_TRACE("freeing adapter structure\n");
kfree(adapter); kfree(adapter);
out: out:
return; return;
...@@ -1504,9 +1449,8 @@ zfcp_nameserver_enqueue(struct zfcp_adapter *adapter) ...@@ -1504,9 +1449,8 @@ zfcp_nameserver_enqueue(struct zfcp_adapter *adapter)
/* generate port structure */ /* generate port structure */
port = zfcp_port_enqueue(adapter, 0, ZFCP_STATUS_PORT_NAMESERVER); port = zfcp_port_enqueue(adapter, 0, ZFCP_STATUS_PORT_NAMESERVER);
if (!port) { if (!port) {
ZFCP_LOG_INFO("error: Could not establish a connection to the " ZFCP_LOG_INFO("error: enqueue of nameserver port for "
"fabric name server connected to the " "adapter %s failed\n",
"adapter %s\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
return -ENXIO; return -ENXIO;
} }
...@@ -1569,8 +1513,8 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter, ...@@ -1569,8 +1513,8 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter,
range_mask = ZFCP_PORTS_RANGE_FABRIC; range_mask = ZFCP_PORTS_RANGE_FABRIC;
break; break;
default: default:
ZFCP_LOG_INFO("Received RSCN with unknown " ZFCP_LOG_INFO("incoming RSCN with unknown "
"address format.\n"); "address format\n");
continue; continue;
} }
read_lock_irqsave(&zfcp_data.config_lock, flags); read_lock_irqsave(&zfcp_data.config_lock, flags);
...@@ -1581,11 +1525,8 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter, ...@@ -1581,11 +1525,8 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter,
/* Do we know this port? If not skip it. */ /* Do we know this port? If not skip it. */
if (!atomic_test_mask if (!atomic_test_mask
(ZFCP_STATUS_PORT_DID_DID, &port->status)) { (ZFCP_STATUS_PORT_DID_DID, &port->status)) {
ZFCP_LOG_INFO ZFCP_LOG_INFO("incoming RSCN, trying to open "
("Received state change notification." "port 0x%016Lx\n", port->wwpn);
"Trying to open the port with wwpn "
"0x%Lx. Hope it's there now.\n",
port->wwpn);
debug_text_event(adapter->erp_dbf, 1, debug_text_event(adapter->erp_dbf, 1,
"unsol_els_rscnu:"); "unsol_els_rscnu:");
zfcp_erp_port_reopen(port, zfcp_erp_port_reopen(port,
...@@ -1599,7 +1540,7 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter, ...@@ -1599,7 +1540,7 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter,
*/ */
if ((port->d_id & range_mask) if ((port->d_id & range_mask)
== (fcp_rscn_element->nport_did & range_mask)) { == (fcp_rscn_element->nport_did & range_mask)) {
ZFCP_LOG_TRACE("reopen did 0x%x\n", ZFCP_LOG_TRACE("reopen did 0x%08x\n",
fcp_rscn_element->nport_did); fcp_rscn_element->nport_did);
/* /*
* Unfortunately, an RSCN does not specify the * Unfortunately, an RSCN does not specify the
...@@ -1611,10 +1552,8 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter, ...@@ -1611,10 +1552,8 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter,
* Where would such code be put in? * Where would such code be put in?
* (inside or outside erp) * (inside or outside erp)
*/ */
ZFCP_LOG_INFO ZFCP_LOG_INFO("incoming RSCN, trying to open "
("Received state change notification." "port 0x%016Lx\n", port->wwpn);
"Trying to reopen the port with wwpn "
"0x%Lx.\n", port->wwpn);
debug_text_event(adapter->erp_dbf, 1, debug_text_event(adapter->erp_dbf, 1,
"unsol_els_rscnk:"); "unsol_els_rscnk:");
zfcp_test_link(port); zfcp_test_link(port);
...@@ -1642,10 +1581,8 @@ zfcp_fsf_incoming_els_plogi(struct zfcp_adapter *adapter, ...@@ -1642,10 +1581,8 @@ zfcp_fsf_incoming_els_plogi(struct zfcp_adapter *adapter,
read_unlock_irqrestore(&zfcp_data.config_lock, flags); read_unlock_irqrestore(&zfcp_data.config_lock, flags);
if (!port || (port->wwpn != (*(wwn_t *) & els_logi->nport_wwn))) { if (!port || (port->wwpn != (*(wwn_t *) & els_logi->nport_wwn))) {
ZFCP_LOG_DEBUG("Re-open port indication received " ZFCP_LOG_DEBUG("ignored incoming PLOGI for nonexisting port "
"for the non-existing port with D_ID " "with d_id 0x%08x on adapter %s\n",
"0x%3.3x, on the adapter "
"%s. Ignored.\n",
status_buffer->d_id, status_buffer->d_id,
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
} else { } else {
...@@ -1673,10 +1610,8 @@ zfcp_fsf_incoming_els_logo(struct zfcp_adapter *adapter, ...@@ -1673,10 +1610,8 @@ zfcp_fsf_incoming_els_logo(struct zfcp_adapter *adapter,
read_unlock_irqrestore(&zfcp_data.config_lock, flags); read_unlock_irqrestore(&zfcp_data.config_lock, flags);
if (!port || (port->wwpn != els_logo->nport_wwpn)) { if (!port || (port->wwpn != els_logo->nport_wwpn)) {
ZFCP_LOG_DEBUG("Re-open port indication received " ZFCP_LOG_DEBUG("ignored incoming LOGO for nonexisting port "
"for the non-existing port with D_ID " "with d_id 0x%08x on adapter %s\n",
"0x%3.3x, on the adapter "
"%s. Ignored.\n",
status_buffer->d_id, status_buffer->d_id,
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
} else { } else {
...@@ -1691,9 +1626,8 @@ zfcp_fsf_incoming_els_unknown(struct zfcp_adapter *adapter, ...@@ -1691,9 +1626,8 @@ zfcp_fsf_incoming_els_unknown(struct zfcp_adapter *adapter,
struct fsf_status_read_buffer *status_buffer) struct fsf_status_read_buffer *status_buffer)
{ {
zfcp_in_els_dbf_event(adapter, "##undef", status_buffer, 24); zfcp_in_els_dbf_event(adapter, "##undef", status_buffer, 24);
ZFCP_LOG_NORMAL("warning: Unknown incoming ELS (0x%x) received " ZFCP_LOG_NORMAL("warning: unknown incoming ELS 0x%08x "
"for the adapter %s\n", "for adapter %s\n", *(u32 *) (status_buffer->payload),
*(u32 *) (status_buffer->payload),
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
} }
...@@ -1739,12 +1673,10 @@ zfcp_gid_pn_buffers_alloc(struct zfcp_gid_pn_data **gid_pn, mempool_t *pool) ...@@ -1739,12 +1673,10 @@ zfcp_gid_pn_buffers_alloc(struct zfcp_gid_pn_data **gid_pn, mempool_t *pool)
} }
} else { } else {
data = kmalloc(sizeof(struct zfcp_gid_pn_data), GFP_ATOMIC); data = kmalloc(sizeof(struct zfcp_gid_pn_data), GFP_ATOMIC);
} }
if (NULL == data){ if (NULL == data)
ZFCP_LOG_DEBUG("Out of memory.\n");
return -ENOMEM; return -ENOMEM;
}
memset(data, 0, sizeof(*data)); memset(data, 0, sizeof(*data));
data->ct.req = &data->req; data->ct.req = &data->req;
...@@ -1766,11 +1698,10 @@ zfcp_gid_pn_buffers_alloc(struct zfcp_gid_pn_data **gid_pn, mempool_t *pool) ...@@ -1766,11 +1698,10 @@ zfcp_gid_pn_buffers_alloc(struct zfcp_gid_pn_data **gid_pn, mempool_t *pool)
static void static void
zfcp_gid_pn_buffers_free(struct zfcp_gid_pn_data *gid_pn) zfcp_gid_pn_buffers_free(struct zfcp_gid_pn_data *gid_pn)
{ {
if ((gid_pn->ct.pool != 0)) { if ((gid_pn->ct.pool != 0))
mempool_free(gid_pn, gid_pn->ct.pool); mempool_free(gid_pn, gid_pn->ct.pool);
} else { else
kfree(gid_pn); kfree(gid_pn);
}
return; return;
} }
...@@ -1789,11 +1720,10 @@ zfcp_ns_gid_pn_request(struct zfcp_erp_action *erp_action) ...@@ -1789,11 +1720,10 @@ zfcp_ns_gid_pn_request(struct zfcp_erp_action *erp_action)
ret = zfcp_gid_pn_buffers_alloc(&gid_pn, adapter->pool.data_gid_pn); ret = zfcp_gid_pn_buffers_alloc(&gid_pn, adapter->pool.data_gid_pn);
if (ret < 0) { if (ret < 0) {
ZFCP_LOG_INFO("error: Out of memory. Could not allocate " ZFCP_LOG_INFO("error: buffer allocation for gid_pn nameserver "
"buffers for nameserver request GID_PN. " "request failed for adapter %s\n",
"(adapter: %s)\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
goto out; goto out;
} }
/* setup nameserver request */ /* setup nameserver request */
...@@ -1817,8 +1747,8 @@ zfcp_ns_gid_pn_request(struct zfcp_erp_action *erp_action) ...@@ -1817,8 +1747,8 @@ zfcp_ns_gid_pn_request(struct zfcp_erp_action *erp_action)
ret = zfcp_fsf_send_ct(&gid_pn->ct, adapter->pool.fsf_req_erp, ret = zfcp_fsf_send_ct(&gid_pn->ct, adapter->pool.fsf_req_erp,
erp_action); erp_action);
if (ret) { if (ret) {
ZFCP_LOG_INFO("error: Could not send nameserver request GID_PN." ZFCP_LOG_INFO("error: initiation of gid_pn nameserver request "
"(adapter %s)\n", "failed for adapter %s\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
zfcp_gid_pn_buffers_free(gid_pn); zfcp_gid_pn_buffers_free(gid_pn);
...@@ -1862,26 +1792,23 @@ static void zfcp_ns_gid_pn_handler(unsigned long data) ...@@ -1862,26 +1792,23 @@ static void zfcp_ns_gid_pn_handler(unsigned long data)
} }
/* paranoia */ /* paranoia */
if (ct_iu_req->wwpn != port->wwpn) { if (ct_iu_req->wwpn != port->wwpn) {
ZFCP_LOG_NORMAL( ZFCP_LOG_NORMAL("bug: wwpn 0x%016Lx returned by nameserver "
"bug: Port WWPN returned by nameserver lookup " "lookup does not match expected wwpn 0x%016Lx "
"does not correspond to the expected value " "for adapter %s\n", ct_iu_req->wwpn, port->wwpn,
"(adapter: %s, debug info: 0x%016Lx, 0x%016Lx)\n", zfcp_get_busid_by_port(port));
zfcp_get_busid_by_port(port), port->wwpn,
ct_iu_req->wwpn);
goto failed; goto failed;
} }
/* looks like a valid d_id */ /* looks like a valid d_id */
port->d_id = ct_iu_resp->d_id & ZFCP_DID_MASK; port->d_id = ct_iu_resp->d_id & ZFCP_DID_MASK;
atomic_set_mask(ZFCP_STATUS_PORT_DID_DID, &port->status); atomic_set_mask(ZFCP_STATUS_PORT_DID_DID, &port->status);
ZFCP_LOG_DEBUG("busid %s: WWPN=0x%Lx ---> D_ID=0x%6.6x\n", ZFCP_LOG_DEBUG("adapter %s: wwpn=0x%016Lx ---> d_id=0x%08x\n",
zfcp_get_busid_by_port(port), zfcp_get_busid_by_port(port), port->wwpn, port->d_id);
port->wwpn, (unsigned int) port->d_id);
goto out; goto out;
failed: failed:
ZFCP_LOG_NORMAL("warning: WWPN 0x%Lx not found by nameserver lookup " ZFCP_LOG_NORMAL("warning: failed gid_pn nameserver request for wwpn "
"(adapter: %s)\n", "0x%016Lx for adapter %s\n",
port->wwpn, zfcp_get_busid_by_port(port)); port->wwpn, zfcp_get_busid_by_port(port));
ZFCP_LOG_DEBUG("CT IUs do not match:\n"); ZFCP_LOG_DEBUG("CT IUs do not match:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) ct_iu_req, ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) ct_iu_req,
......
...@@ -164,9 +164,8 @@ zfcp_ccw_set_online(struct ccw_device *ccw_device) ...@@ -164,9 +164,8 @@ zfcp_ccw_set_online(struct ccw_device *ccw_device)
goto out; goto out;
retval = zfcp_erp_thread_setup(adapter); retval = zfcp_erp_thread_setup(adapter);
if (retval) { if (retval) {
ZFCP_LOG_INFO("error: out of resources. " ZFCP_LOG_INFO("error: start of error recovery thread for "
"error recovery thread for adapter %s " "adapter %s failed\n",
"could not be started\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
goto out_erp_thread; goto out_erp_thread;
} }
...@@ -231,15 +230,15 @@ zfcp_ccw_notify(struct ccw_device *ccw_device, int event) ...@@ -231,15 +230,15 @@ zfcp_ccw_notify(struct ccw_device *ccw_device, int event)
adapter = dev_get_drvdata(&ccw_device->dev); adapter = dev_get_drvdata(&ccw_device->dev);
switch (event) { switch (event) {
case CIO_GONE: case CIO_GONE:
ZFCP_LOG_NORMAL("Adapter %s: device gone.\n", ZFCP_LOG_NORMAL("adapter %s: device gone\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
break; break;
case CIO_NO_PATH: case CIO_NO_PATH:
ZFCP_LOG_NORMAL("Adapter %s: no path.\n", ZFCP_LOG_NORMAL("adapter %s: no path\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
break; break;
case CIO_OPER: case CIO_OPER:
ZFCP_LOG_NORMAL("Adapter %s: operational again.\n", ZFCP_LOG_NORMAL("adapter %s: operational again\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
zfcp_erp_modify_adapter_status(adapter, zfcp_erp_modify_adapter_status(adapter,
ZFCP_STATUS_COMMON_RUNNING, ZFCP_STATUS_COMMON_RUNNING,
......
...@@ -1032,7 +1032,6 @@ struct zfcp_unit { ...@@ -1032,7 +1032,6 @@ struct zfcp_unit {
refcount drop to zero */ refcount drop to zero */
struct zfcp_port *port; /* remote port of unit */ struct zfcp_port *port; /* remote port of unit */
atomic_t status; /* status of this logical unit */ atomic_t status; /* status of this logical unit */
u32 lun_access; /* access flags for this unit */
scsi_lun_t scsi_lun; /* own SCSI LUN */ scsi_lun_t scsi_lun; /* own SCSI LUN */
fcp_lun_t fcp_lun; /* own FCP_LUN */ fcp_lun_t fcp_lun; /* own FCP_LUN */
u32 handle; /* handle assigned by FSF */ u32 handle; /* handle assigned by FSF */
......
...@@ -158,31 +158,6 @@ zfcp_erp_adapter_shutdown_all(void) ...@@ -158,31 +158,6 @@ zfcp_erp_adapter_shutdown_all(void)
return retval; return retval;
} }
/*
* function: zfcp_erp_scsi_low_mem_buffer_timeout_handler
*
* purpose: This function needs to be called whenever the SCSI command
* in the low memory buffer does not return.
* Re-opening the adapter means that the command can be returned
* by zfcp (it is guarranteed that it does not return via the
* adapter anymore). The buffer can then be used again.
*
* returns: sod all
*/
void
zfcp_erp_scsi_low_mem_buffer_timeout_handler(unsigned long data)
{
struct zfcp_adapter *adapter = (struct zfcp_adapter *) data;
ZFCP_LOG_NORMAL("warning: Emergency buffer for SCSI I/O timed out. "
"Restarting all operations on the adapter %s.\n",
zfcp_get_busid_by_adapter(adapter));
debug_text_event(adapter->erp_dbf, 1, "scsi_lmem_tout");
zfcp_erp_adapter_reopen(adapter, 0);
return;
}
/* /*
* function: zfcp_fsf_scsi_er_timeout_handler * function: zfcp_fsf_scsi_er_timeout_handler
* *
...@@ -199,10 +174,9 @@ zfcp_fsf_scsi_er_timeout_handler(unsigned long data) ...@@ -199,10 +174,9 @@ zfcp_fsf_scsi_er_timeout_handler(unsigned long data)
{ {
struct zfcp_adapter *adapter = (struct zfcp_adapter *) data; struct zfcp_adapter *adapter = (struct zfcp_adapter *) data;
ZFCP_LOG_NORMAL ZFCP_LOG_NORMAL("warning: SCSI error recovery timed out. "
("warning: Emergency buffer for SCSI error handling timed out. " "Restarting all operations on the adapter %s\n",
"Restarting all operations on the adapter %s.\n", zfcp_get_busid_by_adapter(adapter));
zfcp_get_busid_by_adapter(adapter));
debug_text_event(adapter->erp_dbf, 1, "eh_lmem_tout"); debug_text_event(adapter->erp_dbf, 1, "eh_lmem_tout");
zfcp_erp_adapter_reopen(adapter, 0); zfcp_erp_adapter_reopen(adapter, 0);
...@@ -225,13 +199,13 @@ zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter, int clear_mask) ...@@ -225,13 +199,13 @@ zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter, int clear_mask)
int retval; int retval;
debug_text_event(adapter->erp_dbf, 5, "a_ro"); debug_text_event(adapter->erp_dbf, 5, "a_ro");
ZFCP_LOG_DEBUG("Reopen on the adapter %s.\n", ZFCP_LOG_DEBUG("reopen adapter %s\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
zfcp_erp_adapter_block(adapter, clear_mask); zfcp_erp_adapter_block(adapter, clear_mask);
if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &adapter->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &adapter->status)) {
ZFCP_LOG_DEBUG("skipped reopen on the failed adapter %s.\n", ZFCP_LOG_DEBUG("skipped reopen of failed adapter %s\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
debug_text_event(adapter->erp_dbf, 5, "a_ro_f"); debug_text_event(adapter->erp_dbf, 5, "a_ro_f");
/* ensure propagation of failed status to new devices */ /* ensure propagation of failed status to new devices */
...@@ -390,9 +364,8 @@ zfcp_els(struct zfcp_port *port, u8 ls_code) ...@@ -390,9 +364,8 @@ zfcp_els(struct zfcp_port *port, u8 ls_code)
case ZFCP_LS_RTV: case ZFCP_LS_RTV:
send_els->req->length = sizeof(struct zfcp_ls_rtv); send_els->req->length = sizeof(struct zfcp_ls_rtv);
send_els->resp->length = sizeof(struct zfcp_ls_rtv_acc); send_els->resp->length = sizeof(struct zfcp_ls_rtv_acc);
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("RTV request from s_id 0x%08x to d_id 0x%08x\n",
"RTV request from sid 0x%06x to did 0x%06x\n", port->adapter->s_id, port->d_id);
port->adapter->s_id, port->d_id);
break; break;
case ZFCP_LS_RLS: case ZFCP_LS_RLS:
...@@ -400,10 +373,9 @@ zfcp_els(struct zfcp_port *port, u8 ls_code) ...@@ -400,10 +373,9 @@ zfcp_els(struct zfcp_port *port, u8 ls_code)
send_els->resp->length = sizeof(struct zfcp_ls_rls_acc); send_els->resp->length = sizeof(struct zfcp_ls_rls_acc);
rls = (struct zfcp_ls_rls*)req; rls = (struct zfcp_ls_rls*)req;
rls->port_id = port->adapter->s_id; rls->port_id = port->adapter->s_id;
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("RLS request from s_id 0x%08x to d_id 0x%08x "
"RLS request from sid 0x%06x to did 0x%06x " "(port_id=0x%08x)\n",
"with payload(port_id=0x%06x)\n", port->adapter->s_id, port->d_id, rls->port_id);
port->adapter->s_id, port->d_id, rls->port_id);
break; break;
case ZFCP_LS_PDISC: case ZFCP_LS_PDISC:
...@@ -412,11 +384,10 @@ zfcp_els(struct zfcp_port *port, u8 ls_code) ...@@ -412,11 +384,10 @@ zfcp_els(struct zfcp_port *port, u8 ls_code)
pdisc = (struct zfcp_ls_pdisc*)req; pdisc = (struct zfcp_ls_pdisc*)req;
pdisc->wwpn = port->adapter->wwpn; pdisc->wwpn = port->adapter->wwpn;
pdisc->wwnn = port->adapter->wwnn; pdisc->wwnn = port->adapter->wwnn;
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("PDISC request from s_id 0x%08x to d_id 0x%08x "
"PDISC request from sid 0x%06x to did 0x%06x " "(wwpn=0x%016Lx, wwnn=0x%016Lx)\n",
"with payload(wwpn=0x%016Lx wwnn=0x%016Lx)\n", port->adapter->s_id, port->d_id,
port->adapter->s_id, port->d_id, pdisc->wwpn, pdisc->wwnn);
pdisc->wwpn, pdisc->wwnn);
break; break;
case ZFCP_LS_ADISC: case ZFCP_LS_ADISC:
...@@ -427,35 +398,33 @@ zfcp_els(struct zfcp_port *port, u8 ls_code) ...@@ -427,35 +398,33 @@ zfcp_els(struct zfcp_port *port, u8 ls_code)
adisc->wwpn = port->adapter->wwpn; adisc->wwpn = port->adapter->wwpn;
adisc->wwnn = port->adapter->wwnn; adisc->wwnn = port->adapter->wwnn;
adisc->nport_id = port->adapter->s_id; adisc->nport_id = port->adapter->s_id;
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("ADISC request from s_id 0x%08x to d_id 0x%08x "
"ADISC request from sid 0x%06x to did 0x%06x " "(wwpn=0x%016Lx, wwnn=0x%016Lx, "
"with payload(wwpn=0x%016Lx wwnn=0x%016Lx " "hard_nport_id=0x%08x, nport_id=0x%08x)\n",
"hard_nport_id=0x%06x nport_id=0x%06x)\n", port->adapter->s_id, port->d_id,
port->adapter->s_id, port->d_id, adisc->wwpn, adisc->wwnn,
adisc->wwpn, adisc->wwnn, adisc->hard_nport_id, adisc->nport_id);
adisc->hard_nport_id, adisc->nport_id);
break; break;
default: default:
ZFCP_LOG_NORMAL( ZFCP_LOG_NORMAL("ELS command code 0x%02x is not supported\n",
"ELS command code 0x%02x is not supported\n", ls_code); ls_code);
retval = -EINVAL; retval = -EINVAL;
goto invalid_ls_code; goto invalid_ls_code;
} }
retval = zfcp_fsf_send_els(send_els); retval = zfcp_fsf_send_els(send_els);
if (retval != 0) { if (retval != 0) {
ZFCP_LOG_NORMAL( ZFCP_LOG_NORMAL("error: initiation of Send ELS failed for port "
"ELS request could not be processed " "0x%016Lx on adapter %s\n",
"(sid=0x%06x did=0x%06x)\n", port->wwpn, zfcp_get_busid_by_port(port));
port->adapter->s_id, port->d_id);
retval = -EPERM; retval = -EPERM;
} }
goto out; goto out;
nomem: nomem:
ZFCP_LOG_INFO("Out of memory!\n"); ZFCP_LOG_DEBUG("out of memory\n");
retval = -ENOMEM; retval = -ENOMEM;
invalid_ls_code: invalid_ls_code:
...@@ -513,68 +482,53 @@ zfcp_els_handler(unsigned long data) ...@@ -513,68 +482,53 @@ zfcp_els_handler(unsigned long data)
switch (rjt->reason_code) { switch (rjt->reason_code) {
case ZFCP_LS_RJT_INVALID_COMMAND_CODE: case ZFCP_LS_RJT_INVALID_COMMAND_CODE:
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("invalid LS command code "
"Invalid command code " "(wwpn=0x%016Lx, command=0x%02x)\n",
"(wwpn=0x%016Lx command=0x%02x)\n", port->wwpn, req_code);
(unsigned long long)port->wwpn,
req_code);
break; break;
case ZFCP_LS_RJT_LOGICAL_ERROR: case ZFCP_LS_RJT_LOGICAL_ERROR:
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("logical error (wwpn=0x%016Lx, "
"Logical error " "reason_expl=0x%02x)\n",
"(wwpn=0x%016Lx reason_explanation=0x%02x)\n", port->wwpn, rjt->reason_expl);
(unsigned long long)port->wwpn,
rjt->reason_expl);
break; break;
case ZFCP_LS_RJT_LOGICAL_BUSY: case ZFCP_LS_RJT_LOGICAL_BUSY:
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("logical busy (wwpn=0x%016Lx, "
"Logical busy " "reason_expl=0x%02x)\n",
"(wwpn=0x%016Lx reason_explanation=0x%02x)\n", port->wwpn, rjt->reason_expl);
(unsigned long long)port->wwpn,
rjt->reason_expl);
break; break;
case ZFCP_LS_RJT_PROTOCOL_ERROR: case ZFCP_LS_RJT_PROTOCOL_ERROR:
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("protocol error (wwpn=0x%016Lx, "
"Protocol error " "reason_expl=0x%02x)\n",
"(wwpn=0x%016Lx reason_explanation=0x%02x)\n", port->wwpn, rjt->reason_expl);
(unsigned long long)port->wwpn,
rjt->reason_expl);
break; break;
case ZFCP_LS_RJT_UNABLE_TO_PERFORM: case ZFCP_LS_RJT_UNABLE_TO_PERFORM:
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("unable to perform command requested "
"Unable to perform command requested " "(wwpn=0x%016Lx, reason_expl=0x%02x)\n",
"(wwpn=0x%016Lx reason_explanation=0x%02x)\n", port->wwpn, rjt->reason_expl);
(unsigned long long)port->wwpn,
rjt->reason_expl);
break; break;
case ZFCP_LS_RJT_COMMAND_NOT_SUPPORTED: case ZFCP_LS_RJT_COMMAND_NOT_SUPPORTED:
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("command not supported (wwpn=0x%016Lx, "
"Command not supported " "command=0x%02x)\n",
"(wwpn=0x%016Lx command=0x%02x)\n", port->wwpn, req_code);
(unsigned long long)port->wwpn,
req_code);
break; break;
case ZFCP_LS_RJT_VENDOR_UNIQUE_ERROR: case ZFCP_LS_RJT_VENDOR_UNIQUE_ERROR:
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("vendor specific error (wwpn=0x%016Lx, "
"Vendor unique error " "vendor_unique=0x%02x)\n",
"(wwpn=0x%016Lx vendor_unique=0x%02x)\n", port->wwpn, rjt->vendor_unique);
(unsigned long long)port->wwpn,
rjt->vendor_unique);
break; break;
default: default:
ZFCP_LOG_NORMAL( ZFCP_LOG_NORMAL("ELS rejected by remote port 0x%016Lx "
"ELS has been rejected by remote port " "on adapter %s (reason_code=0x%02x)\n",
"with WWPN 0x%Lx on the adapter %s " port->wwpn,
"with the reason code 0x%02x\n", zfcp_get_busid_by_port(port),
port->wwpn, zfcp_get_busid_by_port(port), rjt->reason_code);
rjt->reason_code);
} }
retval = -ENXIO; retval = -ENXIO;
break; break;
...@@ -584,57 +538,51 @@ zfcp_els_handler(unsigned long data) ...@@ -584,57 +538,51 @@ zfcp_els_handler(unsigned long data)
case ZFCP_LS_RTV: case ZFCP_LS_RTV:
rtv = (struct zfcp_ls_rtv_acc*)resp; rtv = (struct zfcp_ls_rtv_acc*)resp;
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("RTV response from d_id 0x%08x to s_id "
"RTV response from did 0x%06x to sid 0x%06x " "0x%08x (R_A_TOV=%ds E_D_TOV=%d%cs)\n",
"with payload(R_A_TOV=%ds E_D_TOV=%d%cs)\n", port->d_id, port->adapter->s_id,
port->d_id, port->adapter->s_id, rtv->r_a_tov, rtv->e_d_tov,
rtv->r_a_tov, rtv->e_d_tov, rtv->qualifier &
rtv->qualifier & ZFCP_LS_RTV_E_D_TOV_FLAG ? ZFCP_LS_RTV_E_D_TOV_FLAG ? 'n' : 'm');
'n' : 'm');
break; break;
case ZFCP_LS_RLS: case ZFCP_LS_RLS:
rls = (struct zfcp_ls_rls_acc*)resp; rls = (struct zfcp_ls_rls_acc*)resp;
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("RLS response from d_id 0x%08x to s_id "
"RLS response from did 0x%06x to sid 0x%06x " "0x%08x (link_failure_count=%u, "
"with payload(link_failure_count=%u " "loss_of_sync_count=%u, "
"loss_of_sync_count=%u " "loss_of_signal_count=%u, "
"loss_of_signal_count=%u " "primitive_sequence_protocol_error=%u, "
"primitive_sequence_protocol_error=%u " "invalid_transmition_word=%u, "
"invalid_transmition_word=%u " "invalid_crc_count=%u)\n",
"invalid_crc_count=%u)\n", port->d_id, port->adapter->s_id,
port->d_id, port->adapter->s_id, rls->link_failure_count,
rls->link_failure_count, rls->loss_of_sync_count,
rls->loss_of_sync_count, rls->loss_of_signal_count,
rls->loss_of_signal_count, rls->prim_seq_prot_error,
rls->prim_seq_prot_error, rls->invalid_transmition_word,
rls->invalid_transmition_word, rls->invalid_crc_count);
rls->invalid_crc_count);
break; break;
case ZFCP_LS_PDISC: case ZFCP_LS_PDISC:
pdisc = (struct zfcp_ls_pdisc_acc*)resp; pdisc = (struct zfcp_ls_pdisc_acc*)resp;
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("PDISC response from d_id 0x%08x to s_id "
"PDISC response from did 0x%06x to sid 0x%06x " "0x%08x (wwpn=0x%016Lx, wwnn=0x%016Lx, "
"with payload(wwpn=0x%016Lx wwnn=0x%016Lx " "vendor='%-16s')\n", port->d_id,
"vendor='%-16s')\n", port->adapter->s_id, pdisc->wwpn,
port->d_id, port->adapter->s_id, pdisc->wwnn, pdisc->vendor_version);
(unsigned long long)pdisc->wwpn,
(unsigned long long)pdisc->wwnn,
pdisc->vendor_version);
break; break;
case ZFCP_LS_ADISC: case ZFCP_LS_ADISC:
adisc = (struct zfcp_ls_adisc_acc*)resp; adisc = (struct zfcp_ls_adisc_acc*)resp;
ZFCP_LOG_NORMAL( ZFCP_LOG_INFO("ADISC response from d_id 0x%08x to s_id "
"ADISC response from did 0x%06x to sid 0x%06x " "0x%08x (wwpn=0x%016Lx, wwnn=0x%016Lx, "
"with payload(wwpn=0x%016Lx wwnn=0x%016Lx " "hard_nport_id=0x%08x, "
"hard_nport_id=0x%06x nport_id=0x%06x)\n", "nport_id=0x%08x)\n", port->d_id,
port->d_id, port->adapter->s_id, port->adapter->s_id, adisc->wwpn,
(unsigned long long)adisc->wwpn, adisc->wwnn, adisc->hard_nport_id,
(unsigned long long)adisc->wwnn, adisc->nport_id);
adisc->hard_nport_id, adisc->nport_id); /* FIXME: set wwnn in during open port */
/* FIXME: missing wwnn value in port struct */
if (port->wwnn == 0) if (port->wwnn == 0)
port->wwnn = adisc->wwnn; port->wwnn = adisc->wwnn;
break; break;
...@@ -642,17 +590,16 @@ zfcp_els_handler(unsigned long data) ...@@ -642,17 +590,16 @@ zfcp_els_handler(unsigned long data)
break; break;
default: default:
ZFCP_LOG_NORMAL( ZFCP_LOG_NORMAL("unknown payload code 0x%02x received for "
"Unknown payload code 0x%02x received on a request " "request 0x%02x to d_id 0x%08x, reopen needed "
"0x%02x from sid 0x%06x to did 0x%06x, " "for port 0x%016Lx on adapter %s\n", resp_code,
"port needs to be reopened\n", req_code, port->d_id, port->wwpn,
req_code, resp_code, port->adapter->s_id, port->d_id); zfcp_get_busid_by_port(port));
retval = zfcp_erp_port_forced_reopen(port, 0); retval = zfcp_erp_port_forced_reopen(port, 0);
if (retval != 0) { if (retval != 0) {
ZFCP_LOG_NORMAL( ZFCP_LOG_NORMAL("reopen of remote port 0x%016Lx on "
"Cannot reopen a remote port " "adapter %s failed\n", port->wwpn,
"with WWPN 0x%Lx on the adapter %s\n", zfcp_get_busid_by_port(port));
port->wwpn, zfcp_get_busid_by_port(port));
retval = -EPERM; retval = -EPERM;
} }
} }
...@@ -681,16 +628,14 @@ zfcp_test_link(struct zfcp_port *port) ...@@ -681,16 +628,14 @@ zfcp_test_link(struct zfcp_port *port)
retval = zfcp_els(port, ZFCP_LS_ADISC); retval = zfcp_els(port, ZFCP_LS_ADISC);
if (retval != 0) { if (retval != 0) {
ZFCP_LOG_NORMAL( ZFCP_LOG_NORMAL("reopen needed for port 0x%016Lx "
"Port with WWPN 0x%Lx on the adapter %s " "on adapter %s\n ", port->wwpn,
"needs to be reopened\n", zfcp_get_busid_by_port(port));
port->wwpn, zfcp_get_busid_by_port(port));
retval = zfcp_erp_port_forced_reopen(port, 0); retval = zfcp_erp_port_forced_reopen(port, 0);
if (retval != 0) { if (retval != 0) {
ZFCP_LOG_NORMAL( ZFCP_LOG_NORMAL("reopen of remote port 0x%016Lx "
"Cannot reopen a remote port " "on adapter %s failed\n", port->wwpn,
"with WWPN 0x%Lx on the adapter %s\n", zfcp_get_busid_by_port(port));
port->wwpn, zfcp_get_busid_by_port(port));
retval = -EPERM; retval = -EPERM;
} }
} }
...@@ -718,16 +663,15 @@ zfcp_erp_port_forced_reopen_internal(struct zfcp_port *port, int clear_mask) ...@@ -718,16 +663,15 @@ zfcp_erp_port_forced_reopen_internal(struct zfcp_port *port, int clear_mask)
debug_text_event(adapter->erp_dbf, 5, "pf_ro"); debug_text_event(adapter->erp_dbf, 5, "pf_ro");
debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t));
ZFCP_LOG_DEBUG("Forced reopen of the port with WWPN 0x%Lx " ZFCP_LOG_DEBUG("forced reopen of port 0x%016Lx on adapter %s\n",
"on the adapter %s.\n",
port->wwpn, zfcp_get_busid_by_port(port)); port->wwpn, zfcp_get_busid_by_port(port));
zfcp_erp_port_block(port, clear_mask); zfcp_erp_port_block(port, clear_mask);
if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &port->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &port->status)) {
ZFCP_LOG_DEBUG("skipped forced reopen on the failed port " ZFCP_LOG_DEBUG("skipped forced reopen of failed port 0x%016Lx "
"with WWPN 0x%Lx on the adapter %s.\n", "on adapter %s\n", port->wwpn,
port->wwpn, zfcp_get_busid_by_port(port)); zfcp_get_busid_by_port(port));
debug_text_event(adapter->erp_dbf, 5, "pf_ro_f"); debug_text_event(adapter->erp_dbf, 5, "pf_ro_f");
debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t));
retval = -EIO; retval = -EIO;
...@@ -786,17 +730,15 @@ zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask) ...@@ -786,17 +730,15 @@ zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask)
debug_text_event(adapter->erp_dbf, 5, "p_ro"); debug_text_event(adapter->erp_dbf, 5, "p_ro");
debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t));
ZFCP_LOG_DEBUG("Reopen of the port with WWPN 0x%Lx " ZFCP_LOG_DEBUG("reopen of port 0x%016Lx on adapter %s\n",
"on the adapter %s.\n",
port->wwpn, zfcp_get_busid_by_port(port)); port->wwpn, zfcp_get_busid_by_port(port));
zfcp_erp_port_block(port, clear_mask); zfcp_erp_port_block(port, clear_mask);
if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &port->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &port->status)) {
ZFCP_LOG_DEBUG ZFCP_LOG_DEBUG("skipped reopen of failed port 0x%016Lx "
("skipped reopen on the failed port with WWPN 0x%Lx " "on adapter %s\n", port->wwpn,
"on the adapter %s.\n", port->wwpn, zfcp_get_busid_by_port(port));
zfcp_get_busid_by_port(port));
debug_text_event(adapter->erp_dbf, 5, "p_ro_f"); debug_text_event(adapter->erp_dbf, 5, "p_ro_f");
debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t));
/* ensure propagation of failed status to new devices */ /* ensure propagation of failed status to new devices */
...@@ -855,20 +797,17 @@ zfcp_erp_unit_reopen_internal(struct zfcp_unit *unit, int clear_mask) ...@@ -855,20 +797,17 @@ zfcp_erp_unit_reopen_internal(struct zfcp_unit *unit, int clear_mask)
debug_text_event(adapter->erp_dbf, 5, "u_ro"); debug_text_event(adapter->erp_dbf, 5, "u_ro");
debug_event(adapter->erp_dbf, 5, &unit->fcp_lun, sizeof (fcp_lun_t)); debug_event(adapter->erp_dbf, 5, &unit->fcp_lun, sizeof (fcp_lun_t));
ZFCP_LOG_DEBUG("Reopen of the unit with FCP LUN 0x%Lx on the " ZFCP_LOG_DEBUG("reopen of unit 0x%016Lx on port 0x%016Lx "
"port with WWPN 0x%Lx " "on adapter %s\n", unit->fcp_lun,
"on the adapter %s.\n",
unit->fcp_lun,
unit->port->wwpn, zfcp_get_busid_by_unit(unit)); unit->port->wwpn, zfcp_get_busid_by_unit(unit));
zfcp_erp_unit_block(unit, clear_mask); zfcp_erp_unit_block(unit, clear_mask);
if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &unit->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &unit->status)) {
ZFCP_LOG_DEBUG ZFCP_LOG_DEBUG("skipped reopen of failed unit 0x%016Lx "
("skipped reopen on the failed unit with FCP LUN 0x%Lx " "on port 0x%016Lx on adapter %s\n",
"on the port with WWPN 0x%Lx " "on the adapter %s.\n", unit->fcp_lun, unit->port->wwpn,
unit->fcp_lun, unit->port->wwpn, zfcp_get_busid_by_unit(unit));
zfcp_get_busid_by_unit(unit));
debug_text_event(adapter->erp_dbf, 5, "u_ro_f"); debug_text_event(adapter->erp_dbf, 5, "u_ro_f");
debug_event(adapter->erp_dbf, 5, &unit->fcp_lun, debug_event(adapter->erp_dbf, 5, &unit->fcp_lun,
sizeof (fcp_lun_t)); sizeof (fcp_lun_t));
...@@ -1115,14 +1054,10 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action) ...@@ -1115,14 +1054,10 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action)
fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED;
} }
if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) {
ZFCP_LOG_NORMAL ZFCP_LOG_NORMAL("error: erp step timed out "
("error: Error Recovery Procedure " "(action=%d, fsf_req=%p)\n ",
"step timed out. The action flag " erp_action->action,
"is 0x%x. The FSF request " erp_action->fsf_req);
"is at 0x%lx\n",
erp_action->action,
(unsigned long)
erp_action->fsf_req);
} }
/* /*
* If fsf_req is neither dismissed nor completed * If fsf_req is neither dismissed nor completed
...@@ -1287,9 +1222,8 @@ zfcp_erp_thread_setup(struct zfcp_adapter *adapter) ...@@ -1287,9 +1222,8 @@ zfcp_erp_thread_setup(struct zfcp_adapter *adapter)
retval = kernel_thread(zfcp_erp_thread, adapter, SIGCHLD); retval = kernel_thread(zfcp_erp_thread, adapter, SIGCHLD);
if (retval < 0) { if (retval < 0) {
ZFCP_LOG_NORMAL("error: Out of resources. Could not create an " ZFCP_LOG_NORMAL("error: creation of erp thread failed for "
"error recovery procedure thread " "adapter %s\n",
"for the adapter %s.\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
debug_text_event(adapter->erp_dbf, 5, "a_thset_fail"); debug_text_event(adapter->erp_dbf, 5, "a_thset_fail");
} else { } else {
...@@ -1475,11 +1409,10 @@ zfcp_erp_strategy(struct zfcp_erp_action *erp_action) ...@@ -1475,11 +1409,10 @@ zfcp_erp_strategy(struct zfcp_erp_action *erp_action)
*/ */
if (adapter->erp_total_count == adapter->erp_low_mem_count) { if (adapter->erp_total_count == adapter->erp_low_mem_count) {
debug_text_event(adapter->erp_dbf, 3, "a_st_lowmem"); debug_text_event(adapter->erp_dbf, 3, "a_st_lowmem");
ZFCP_LOG_NORMAL ZFCP_LOG_NORMAL("error: no mempool elements available, "
("error: Out of memory. No mempool elements " "restarting I/O on adapter %s "
"available. Restarting IO on the adapter %s " "to free mempool\n",
"to free mempool.\n", zfcp_get_busid_by_adapter(adapter));
zfcp_get_busid_by_adapter(adapter));
zfcp_erp_adapter_reopen_internal(adapter, 0); zfcp_erp_adapter_reopen_internal(adapter, 0);
} else { } else {
debug_text_event(adapter->erp_dbf, 2, "a_st_memw"); debug_text_event(adapter->erp_dbf, 2, "a_st_memw");
...@@ -1618,9 +1551,8 @@ zfcp_erp_strategy_do_action(struct zfcp_erp_action *erp_action) ...@@ -1618,9 +1551,8 @@ zfcp_erp_strategy_do_action(struct zfcp_erp_action *erp_action)
debug_text_exception(adapter->erp_dbf, 1, "a_stda_bug"); debug_text_exception(adapter->erp_dbf, 1, "a_stda_bug");
debug_event(adapter->erp_dbf, 1, &erp_action->action, debug_event(adapter->erp_dbf, 1, &erp_action->action,
sizeof (int)); sizeof (int));
ZFCP_LOG_NORMAL("bug: Unknown error recovery procedure " ZFCP_LOG_NORMAL("bug: unknown erp action requested on "
"action requested on the adapter %s " "adapter %s (action=%d)\n",
"(debug info %d)\n",
zfcp_get_busid_by_adapter(erp_action->adapter), zfcp_get_busid_by_adapter(erp_action->adapter),
erp_action->action); erp_action->action);
} }
...@@ -1664,8 +1596,8 @@ zfcp_erp_adapter_failed(struct zfcp_adapter *adapter) ...@@ -1664,8 +1596,8 @@ zfcp_erp_adapter_failed(struct zfcp_adapter *adapter)
{ {
zfcp_erp_modify_adapter_status(adapter, zfcp_erp_modify_adapter_status(adapter,
ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET);
ZFCP_LOG_NORMAL("Adapter recovery failed on the " ZFCP_LOG_NORMAL("adapter erp failed on adapter %s\n",
"adapter %s.\n", zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
debug_text_event(adapter->erp_dbf, 2, "a_afail"); debug_text_event(adapter->erp_dbf, 2, "a_afail");
} }
...@@ -1681,9 +1613,7 @@ zfcp_erp_port_failed(struct zfcp_port *port) ...@@ -1681,9 +1613,7 @@ zfcp_erp_port_failed(struct zfcp_port *port)
zfcp_erp_modify_port_status(port, zfcp_erp_modify_port_status(port,
ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET);
ZFCP_LOG_NORMAL("Port recovery failed on the " ZFCP_LOG_NORMAL("port erp failed on port 0x%016Lx on adapter %s\n",
"port with WWPN 0x%Lx at the "
"adapter %s.\n",
port->wwpn, zfcp_get_busid_by_port(port)); port->wwpn, zfcp_get_busid_by_port(port));
debug_text_event(port->adapter->erp_dbf, 2, "p_pfail"); debug_text_event(port->adapter->erp_dbf, 2, "p_pfail");
debug_event(port->adapter->erp_dbf, 2, &port->wwpn, sizeof (wwn_t)); debug_event(port->adapter->erp_dbf, 2, &port->wwpn, sizeof (wwn_t));
...@@ -1701,10 +1631,8 @@ zfcp_erp_unit_failed(struct zfcp_unit *unit) ...@@ -1701,10 +1631,8 @@ zfcp_erp_unit_failed(struct zfcp_unit *unit)
zfcp_erp_modify_unit_status(unit, zfcp_erp_modify_unit_status(unit,
ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET);
ZFCP_LOG_NORMAL("Unit recovery failed on the unit with FCP LUN 0x%Lx " ZFCP_LOG_NORMAL("unit erp failed on unit 0x%016Lx on port 0x%016Lx "
"connected to the port with WWPN 0x%Lx at the " " on adapter %s\n", unit->fcp_lun,
"adapter %s.\n",
unit->fcp_lun,
unit->port->wwpn, zfcp_get_busid_by_unit(unit)); unit->port->wwpn, zfcp_get_busid_by_unit(unit));
debug_text_event(unit->port->adapter->erp_dbf, 2, "u_ufail"); debug_text_event(unit->port->adapter->erp_dbf, 2, "u_ufail");
debug_event(unit->port->adapter->erp_dbf, 2, debug_event(unit->port->adapter->erp_dbf, 2,
...@@ -1863,13 +1791,10 @@ zfcp_erp_schedule_work(struct zfcp_unit *unit) ...@@ -1863,13 +1791,10 @@ zfcp_erp_schedule_work(struct zfcp_unit *unit)
return 0; return 0;
if ((p = kmalloc(sizeof(*p), GFP_KERNEL)) == NULL) { if ((p = kmalloc(sizeof(*p), GFP_KERNEL)) == NULL) {
ZFCP_LOG_NORMAL("error: Out of resources. Could not register " ZFCP_LOG_NORMAL("error: registration at SCSI stack failed for "
"the FCP-LUN 0x%Lx connected to " "unit 0x%016Lx on port 0x%016Lx on "
"the port with WWPN 0x%Lx connected to " "adapter %s\n", unit->fcp_lun, unit->port->wwpn,
"the adapter %s with the SCSI stack.\n", zfcp_get_busid_by_unit(unit));
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_unit(unit));
atomic_set(&unit->scsi_add_work, 0); atomic_set(&unit->scsi_add_work, 0);
return -ENOMEM; return -ENOMEM;
} }
...@@ -2279,7 +2204,7 @@ zfcp_erp_adapter_strategy(struct zfcp_erp_action *erp_action) ...@@ -2279,7 +2204,7 @@ zfcp_erp_adapter_strategy(struct zfcp_erp_action *erp_action)
if (retval == ZFCP_ERP_FAILED) { if (retval == ZFCP_ERP_FAILED) {
ZFCP_LOG_INFO("Waiting to allow the adapter %s " ZFCP_LOG_INFO("Waiting to allow the adapter %s "
"to recover itself\n.", "to recover itself\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
/* /*
* SUGGESTION: substitute by * SUGGESTION: substitute by
...@@ -2395,25 +2320,23 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action) ...@@ -2395,25 +2320,23 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action)
int retval_cleanup = 0; int retval_cleanup = 0;
if (atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)) { if (atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)) {
ZFCP_LOG_NORMAL ZFCP_LOG_NORMAL("bug: second attempt to set up QDIO on "
("bug: QDIO (data transfer mechanism) start-up on " "adapter %s\n",
"adapter %s attempted twice. Second attempt ignored.\n", zfcp_get_busid_by_adapter(adapter));
zfcp_get_busid_by_adapter(adapter));
goto failed_sanity; goto failed_sanity;
} }
if (qdio_establish(&adapter->qdio_init_data) != 0) { if (qdio_establish(&adapter->qdio_init_data) != 0) {
ZFCP_LOG_INFO ZFCP_LOG_INFO("error: establishment of QDIO queues failed "
("error: Could not establish queues for QDIO (data " "on adapter %s\n.",
"transfer mechanism) operation on adapter %s\n.", zfcp_get_busid_by_adapter(adapter));
zfcp_get_busid_by_adapter(adapter));
goto failed_qdio_establish; goto failed_qdio_establish;
} }
ZFCP_LOG_DEBUG("queues established\n"); ZFCP_LOG_DEBUG("queues established\n");
if (qdio_activate(adapter->ccw_device, 0) != 0) { if (qdio_activate(adapter->ccw_device, 0) != 0) {
ZFCP_LOG_INFO("error: Could not activate queues for QDIO (data " ZFCP_LOG_INFO("error: activation of QDIO queues failed "
"transfer mechanism) operation on adapter %s\n.", "on adapter %s\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
goto failed_qdio_activate; goto failed_qdio_activate;
} }
...@@ -2429,8 +2352,8 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action) ...@@ -2429,8 +2352,8 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action)
sbale->addr = 0; sbale->addr = 0;
} }
ZFCP_LOG_TRACE("Calling do QDIO busid=%s, flags=0x%x, queue_no=%i, " ZFCP_LOG_TRACE("calling do_QDIO on adapter %s (flags=0x%x, "
"index_in_queue=%i, count=%i\n", "queue_no=%i, index_in_queue=%i, count=%i)\n",
zfcp_get_busid_by_adapter(adapter), zfcp_get_busid_by_adapter(adapter),
QDIO_FLAG_SYNC_INPUT, 0, 0, QDIO_MAX_BUFFERS_PER_Q); QDIO_FLAG_SYNC_INPUT, 0, 0, QDIO_MAX_BUFFERS_PER_Q);
...@@ -2439,17 +2362,14 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action) ...@@ -2439,17 +2362,14 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action)
0, 0, QDIO_MAX_BUFFERS_PER_Q, NULL); 0, 0, QDIO_MAX_BUFFERS_PER_Q, NULL);
if (retval) { if (retval) {
ZFCP_LOG_NORMAL ZFCP_LOG_NORMAL("bug: setup of QDIO failed (retval=%d)\n",
("bug: QDIO (data transfer mechanism) inobund transfer " retval);
"structures could not be set-up (debug info %d)\n",
retval);
goto failed_do_qdio; goto failed_do_qdio;
} else { } else {
adapter->response_queue.free_index = 0; adapter->response_queue.free_index = 0;
atomic_set(&adapter->response_queue.free_count, 0); atomic_set(&adapter->response_queue.free_count, 0);
ZFCP_LOG_DEBUG ZFCP_LOG_DEBUG("%i buffers successfully enqueued to "
("%i buffers successfully enqueued to response queue\n", "response queue\n", QDIO_MAX_BUFFERS_PER_Q);
QDIO_MAX_BUFFERS_PER_Q);
} }
/* set index of first avalable SBALS / number of available SBALS */ /* set index of first avalable SBALS / number of available SBALS */
adapter->request_queue.free_index = 0; adapter->request_queue.free_index = 0;
...@@ -2474,9 +2394,8 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action) ...@@ -2474,9 +2394,8 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action)
retval_cleanup = qdio_shutdown(adapter->ccw_device, retval_cleanup = qdio_shutdown(adapter->ccw_device,
QDIO_FLAG_CLEANUP_USING_CLEAR); QDIO_FLAG_CLEANUP_USING_CLEAR);
if (retval_cleanup) { if (retval_cleanup) {
ZFCP_LOG_NORMAL ZFCP_LOG_NORMAL("bug: shutdown of QDIO queues failed "
("bug: Could not clean QDIO (data transfer mechanism) " "(retval=%d)\n", retval_cleanup);
"queues. (debug info %i).\n", retval_cleanup);
} }
else else
debug_text_event(adapter->req_dbf, 1, "q_clean"); debug_text_event(adapter->req_dbf, 1, "q_clean");
...@@ -2508,9 +2427,8 @@ zfcp_erp_adapter_strategy_close_qdio(struct zfcp_erp_action *erp_action) ...@@ -2508,9 +2427,8 @@ zfcp_erp_adapter_strategy_close_qdio(struct zfcp_erp_action *erp_action)
struct zfcp_adapter *adapter = erp_action->adapter; struct zfcp_adapter *adapter = erp_action->adapter;
if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)) { if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)) {
ZFCP_LOG_DEBUG("Termination of QDIO (data transfer operation) " ZFCP_LOG_DEBUG("error: attempt to shut down inactive QDIO "
"attempted for an inactive qdio on the " "queues on adapter %s\n",
"adapter %s....ignored.\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
goto out; goto out;
...@@ -2547,10 +2465,9 @@ zfcp_erp_adapter_strategy_close_qdio(struct zfcp_erp_action *erp_action) ...@@ -2547,10 +2465,9 @@ zfcp_erp_adapter_strategy_close_qdio(struct zfcp_erp_action *erp_action)
* FIXME(design): * FIXME(design):
* What went wrong? What to do best? Proper retval? * What went wrong? What to do best? Proper retval?
*/ */
ZFCP_LOG_NORMAL ZFCP_LOG_NORMAL("bug: shutdown of QDIO queues failed on "
("error: Clean-up of QDIO (data transfer mechanism) " "adapter %s\n",
"structures failed for adapter %s.\n", zfcp_get_busid_by_adapter(adapter));
zfcp_get_busid_by_adapter(adapter));
} else { } else {
ZFCP_LOG_DEBUG("queues cleaned up\n"); ZFCP_LOG_DEBUG("queues cleaned up\n");
debug_text_event(adapter->req_dbf, 1, "q_clean"); debug_text_event(adapter->req_dbf, 1, "q_clean");
...@@ -2631,10 +2548,9 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) ...@@ -2631,10 +2548,9 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
if (zfcp_fsf_exchange_config_data(erp_action)) { if (zfcp_fsf_exchange_config_data(erp_action)) {
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
debug_text_event(adapter->erp_dbf, 5, "a_fstx_xf"); debug_text_event(adapter->erp_dbf, 5, "a_fstx_xf");
ZFCP_LOG_INFO("error: Out of resources. Could not " ZFCP_LOG_INFO("error: initiation of exchange of "
"start exchange of configuration data " "configuration data failed for "
"between the adapter %s " "adapter %s\n",
"and the device driver.\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
break; break;
} }
...@@ -2656,17 +2572,15 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) ...@@ -2656,17 +2572,15 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
*/ */
down_interruptible(&adapter->erp_ready_sem); down_interruptible(&adapter->erp_ready_sem);
if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) {
ZFCP_LOG_INFO ZFCP_LOG_INFO("error: exchange of configuration data "
("error: Exchange of configuration data between " "for adapter %s timed out\n",
"the adapter with %s and the device " zfcp_get_busid_by_adapter(adapter));
"driver timed out\n",
zfcp_get_busid_by_adapter(adapter));
break; break;
} }
if (atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, if (atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
&adapter->status)) { &adapter->status)) {
ZFCP_LOG_DEBUG("Host connection still initialising... " ZFCP_LOG_DEBUG("host connection still initialising... "
"waiting and retrying....\n"); "waiting and retrying...\n");
/* sleep a little bit before retry */ /* sleep a little bit before retry */
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(ZFCP_EXCHANGE_CONFIG_DATA_SLEEP); schedule_timeout(ZFCP_EXCHANGE_CONFIG_DATA_SLEEP);
...@@ -2677,8 +2591,8 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) ...@@ -2677,8 +2591,8 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK,
&adapter->status)) { &adapter->status)) {
ZFCP_LOG_INFO("error: Exchange of configuration data between " ZFCP_LOG_INFO("error: exchange of configuration data for "
"the adapter %s and the device driver failed.\n", "adapter %s failed\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} }
...@@ -2706,10 +2620,8 @@ zfcp_erp_adapter_strategy_open_fsf_statusread(struct zfcp_erp_action ...@@ -2706,10 +2620,8 @@ zfcp_erp_adapter_strategy_open_fsf_statusread(struct zfcp_erp_action
for (i = 0; i < ZFCP_STATUS_READS_RECOM; i++) { for (i = 0; i < ZFCP_STATUS_READS_RECOM; i++) {
temp_ret = zfcp_fsf_status_read(adapter, ZFCP_WAIT_FOR_SBAL); temp_ret = zfcp_fsf_status_read(adapter, ZFCP_WAIT_FOR_SBAL);
if (temp_ret < 0) { if (temp_ret < 0) {
ZFCP_LOG_INFO("error: Out of resources. Could not " ZFCP_LOG_INFO("error: set-up of unsolicited status "
"set-up the infrastructure for " "notification failed on adapter %s\n",
"unsolicited status presentation "
"for the adapter %s.\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
i--; i--;
...@@ -2781,9 +2693,8 @@ zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action) ...@@ -2781,9 +2693,8 @@ zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action)
if (atomic_test_mask((ZFCP_STATUS_PORT_PHYS_OPEN | if (atomic_test_mask((ZFCP_STATUS_PORT_PHYS_OPEN |
ZFCP_STATUS_COMMON_OPEN), ZFCP_STATUS_COMMON_OPEN),
&port->status)) { &port->status)) {
ZFCP_LOG_DEBUG("Port wwpn=0x%Lx is open -> trying " ZFCP_LOG_DEBUG("port 0x%016Lx is open -> trying "
" close physical\n", "close physical\n", port->wwpn);
port->wwpn);
retval = retval =
zfcp_erp_port_forced_strategy_close(erp_action); zfcp_erp_port_forced_strategy_close(erp_action);
} else } else
...@@ -2793,9 +2704,8 @@ zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action) ...@@ -2793,9 +2704,8 @@ zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action)
case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: case ZFCP_ERP_STEP_PHYS_PORT_CLOSING:
if (atomic_test_mask(ZFCP_STATUS_PORT_PHYS_OPEN, if (atomic_test_mask(ZFCP_STATUS_PORT_PHYS_OPEN,
&port->status)) { &port->status)) {
ZFCP_LOG_DEBUG ZFCP_LOG_DEBUG("close physical failed for port "
("failed to close physical port wwpn=0x%Lx\n", "0x%016Lx\n", port->wwpn);
port->wwpn);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} else } else
retval = ZFCP_ERP_SUCCEEDED; retval = ZFCP_ERP_SUCCEEDED;
...@@ -2835,9 +2745,8 @@ zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action) ...@@ -2835,9 +2745,8 @@ zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action)
case ZFCP_ERP_STEP_UNINITIALIZED: case ZFCP_ERP_STEP_UNINITIALIZED:
zfcp_erp_port_strategy_clearstati(port); zfcp_erp_port_strategy_clearstati(port);
if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &port->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &port->status)) {
ZFCP_LOG_DEBUG ZFCP_LOG_DEBUG("port 0x%016Lx is open -> trying "
("port wwpn=0x%Lx is open -> trying close\n", "close\n", port->wwpn);
port->wwpn);
retval = zfcp_erp_port_strategy_close(erp_action); retval = zfcp_erp_port_strategy_close(erp_action);
goto out; goto out;
} /* else it's already closed, open it */ } /* else it's already closed, open it */
...@@ -2845,7 +2754,7 @@ zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action) ...@@ -2845,7 +2754,7 @@ zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action)
case ZFCP_ERP_STEP_PORT_CLOSING: case ZFCP_ERP_STEP_PORT_CLOSING:
if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &port->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &port->status)) {
ZFCP_LOG_DEBUG("failed to close port wwpn=0x%Lx\n", ZFCP_LOG_DEBUG("close failed for port 0x%016Lx\n",
port->wwpn); port->wwpn);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
goto out; goto out;
...@@ -2911,19 +2820,17 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) ...@@ -2911,19 +2820,17 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action)
if (!(adapter->nameserver_port)) { if (!(adapter->nameserver_port)) {
retval = zfcp_nameserver_enqueue(adapter); retval = zfcp_nameserver_enqueue(adapter);
if (retval != 0) { if (retval != 0) {
ZFCP_LOG_NORMAL ZFCP_LOG_NORMAL("error: nameserver port "
("error: nameserver port not available " "unavailable for adapter %s\n",
"(adapter with busid %s)\n", zfcp_get_busid_by_adapter(adapter));
zfcp_get_busid_by_adapter(adapter));
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
break; break;
} }
} }
if (!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, if (!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED,
&adapter->nameserver_port->status)) { &adapter->nameserver_port->status)) {
ZFCP_LOG_DEBUG ZFCP_LOG_DEBUG("nameserver port is not open -> open "
("nameserver port is not open -> open " "nameserver port\n");
"nameserver port\n");
/* nameserver port may live again */ /* nameserver port may live again */
atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING, atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING,
&adapter->nameserver_port->status); &adapter->nameserver_port->status);
...@@ -2936,12 +2843,11 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) ...@@ -2936,12 +2843,11 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action)
case ZFCP_ERP_STEP_NAMESERVER_OPEN: case ZFCP_ERP_STEP_NAMESERVER_OPEN:
if (!atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, if (!atomic_test_mask(ZFCP_STATUS_COMMON_OPEN,
&adapter->nameserver_port->status)) { &adapter->nameserver_port->status)) {
ZFCP_LOG_DEBUG("failed to open nameserver port\n"); ZFCP_LOG_DEBUG("open failed for nameserver port\n");
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} else { } else {
ZFCP_LOG_DEBUG("nameserver port is open -> " ZFCP_LOG_DEBUG("nameserver port is open -> "
"ask nameserver for current D_ID of " "nameserver look-up for port 0x%016Lx\n",
"port with WWPN 0x%Lx\n",
port->wwpn); port->wwpn);
retval = zfcp_erp_port_strategy_open_common_lookup retval = zfcp_erp_port_strategy_open_common_lookup
(erp_action); (erp_action);
...@@ -2952,21 +2858,20 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) ...@@ -2952,21 +2858,20 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action)
if (!atomic_test_mask(ZFCP_STATUS_PORT_DID_DID, &port->status)) { if (!atomic_test_mask(ZFCP_STATUS_PORT_DID_DID, &port->status)) {
if (atomic_test_mask if (atomic_test_mask
(ZFCP_STATUS_PORT_INVALID_WWPN, &port->status)) { (ZFCP_STATUS_PORT_INVALID_WWPN, &port->status)) {
ZFCP_LOG_DEBUG ZFCP_LOG_DEBUG("nameserver look-up failed "
("failed to look up the D_ID of the port wwpn=0x%Lx " "for port 0x%016Lx "
"(misconfigured WWPN?)\n", port->wwpn); "(misconfigured WWPN?)\n",
port->wwpn);
zfcp_erp_port_failed(port); zfcp_erp_port_failed(port);
retval = ZFCP_ERP_EXIT; retval = ZFCP_ERP_EXIT;
} else { } else {
ZFCP_LOG_DEBUG ZFCP_LOG_DEBUG("nameserver look-up failed for "
("failed to look up the D_ID of the port wwpn=0x%Lx\n", "port 0x%016Lx\n", port->wwpn);
port->wwpn);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} }
} else { } else {
ZFCP_LOG_DEBUG ZFCP_LOG_DEBUG("port 0x%016Lx has d_id=0x%08x -> "
("port wwpn=0x%Lx has D_ID=0x%6.6x -> trying open\n", "trying open\n", port->wwpn, port->d_id);
port->wwpn, (unsigned int) port->d_id);
retval = zfcp_erp_port_strategy_open_port(erp_action); retval = zfcp_erp_port_strategy_open_port(erp_action);
} }
break; break;
...@@ -2976,17 +2881,17 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) ...@@ -2976,17 +2881,17 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action)
if (atomic_test_mask((ZFCP_STATUS_COMMON_OPEN | if (atomic_test_mask((ZFCP_STATUS_COMMON_OPEN |
ZFCP_STATUS_PORT_DID_DID), ZFCP_STATUS_PORT_DID_DID),
&port->status)) { &port->status)) {
ZFCP_LOG_DEBUG("port wwpn=0x%Lx is open\n", port->wwpn); ZFCP_LOG_DEBUG("port 0x%016Lx is open\n", port->wwpn);
retval = ZFCP_ERP_SUCCEEDED; retval = ZFCP_ERP_SUCCEEDED;
} else { } else {
ZFCP_LOG_DEBUG("failed to open port wwpn=0x%Lx\n", ZFCP_LOG_DEBUG("open failed for port 0x%016Lx\n",
port->wwpn); port->wwpn);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} }
break; break;
default: default:
ZFCP_LOG_NORMAL("bug: unkown erp step 0x%x\n", ZFCP_LOG_NORMAL("bug: unknown erp step 0x%08x\n",
erp_action->step); erp_action->step);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} }
...@@ -3012,9 +2917,8 @@ zfcp_erp_port_strategy_open_nameserver(struct zfcp_erp_action *erp_action) ...@@ -3012,9 +2917,8 @@ zfcp_erp_port_strategy_open_nameserver(struct zfcp_erp_action *erp_action)
case ZFCP_ERP_STEP_UNINITIALIZED: case ZFCP_ERP_STEP_UNINITIALIZED:
case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: case ZFCP_ERP_STEP_PHYS_PORT_CLOSING:
case ZFCP_ERP_STEP_PORT_CLOSING: case ZFCP_ERP_STEP_PORT_CLOSING:
ZFCP_LOG_DEBUG ZFCP_LOG_DEBUG("port 0x%016Lx has d_id=0x%08x -> trying open\n",
("port wwpn=0x%Lx has D_ID=0x%6.6x -> trying open\n", port->wwpn, port->d_id);
port->wwpn, (unsigned int) port->d_id);
retval = zfcp_erp_port_strategy_open_port(erp_action); retval = zfcp_erp_port_strategy_open_port(erp_action);
break; break;
...@@ -3023,7 +2927,7 @@ zfcp_erp_port_strategy_open_nameserver(struct zfcp_erp_action *erp_action) ...@@ -3023,7 +2927,7 @@ zfcp_erp_port_strategy_open_nameserver(struct zfcp_erp_action *erp_action)
ZFCP_LOG_DEBUG("nameserver port is open\n"); ZFCP_LOG_DEBUG("nameserver port is open\n");
retval = ZFCP_ERP_SUCCEEDED; retval = ZFCP_ERP_SUCCEEDED;
} else { } else {
ZFCP_LOG_DEBUG("failed to open nameserver port\n"); ZFCP_LOG_DEBUG("open failed for nameserver port\n");
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} }
/* this is needed anyway (dont care for retval of wakeup) */ /* this is needed anyway (dont care for retval of wakeup) */
...@@ -3032,7 +2936,7 @@ zfcp_erp_port_strategy_open_nameserver(struct zfcp_erp_action *erp_action) ...@@ -3032,7 +2936,7 @@ zfcp_erp_port_strategy_open_nameserver(struct zfcp_erp_action *erp_action)
break; break;
default: default:
ZFCP_LOG_NORMAL("bug: unkown erp step 0x%x\n", ZFCP_LOG_NORMAL("bug: unknown erp step 0x%08x\n",
erp_action->step); erp_action->step);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} }
...@@ -3278,25 +3182,23 @@ zfcp_erp_unit_strategy(struct zfcp_erp_action *erp_action) ...@@ -3278,25 +3182,23 @@ zfcp_erp_unit_strategy(struct zfcp_erp_action *erp_action)
case ZFCP_ERP_STEP_UNINITIALIZED: case ZFCP_ERP_STEP_UNINITIALIZED:
zfcp_erp_unit_strategy_clearstati(unit); zfcp_erp_unit_strategy_clearstati(unit);
if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status)) {
ZFCP_LOG_DEBUG ZFCP_LOG_DEBUG("unit 0x%016Lx is open -> "
("unit fcp_lun=0x%Lx is open -> trying close\n", "trying close\n", unit->fcp_lun);
unit->fcp_lun);
retval = zfcp_erp_unit_strategy_close(erp_action); retval = zfcp_erp_unit_strategy_close(erp_action);
break; break;
} }
/* else it's already closed, fall through */ /* else it's already closed, fall through */
case ZFCP_ERP_STEP_UNIT_CLOSING: case ZFCP_ERP_STEP_UNIT_CLOSING:
if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status)) {
ZFCP_LOG_DEBUG("failed to close unit fcp_lun=0x%Lx\n", ZFCP_LOG_DEBUG("close failed for unit 0x%016Lx\n",
unit->fcp_lun); unit->fcp_lun);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} else { } else {
if (erp_action->status & ZFCP_STATUS_ERP_CLOSE_ONLY) if (erp_action->status & ZFCP_STATUS_ERP_CLOSE_ONLY)
retval = ZFCP_ERP_EXIT; retval = ZFCP_ERP_EXIT;
else { else {
ZFCP_LOG_DEBUG("unit fcp_lun=0x%Lx is not " ZFCP_LOG_DEBUG("unit 0x%016Lx is not open -> "
"open -> trying open\n", "trying open\n", unit->fcp_lun);
unit->fcp_lun);
retval = retval =
zfcp_erp_unit_strategy_open(erp_action); zfcp_erp_unit_strategy_open(erp_action);
} }
...@@ -3305,11 +3207,11 @@ zfcp_erp_unit_strategy(struct zfcp_erp_action *erp_action) ...@@ -3305,11 +3207,11 @@ zfcp_erp_unit_strategy(struct zfcp_erp_action *erp_action)
case ZFCP_ERP_STEP_UNIT_OPENING: case ZFCP_ERP_STEP_UNIT_OPENING:
if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status)) { if (atomic_test_mask(ZFCP_STATUS_COMMON_OPEN, &unit->status)) {
ZFCP_LOG_DEBUG("unit fcp_lun=0x%Lx is open\n", ZFCP_LOG_DEBUG("unit 0x%016Lx is open\n",
unit->fcp_lun); unit->fcp_lun);
retval = ZFCP_ERP_SUCCEEDED; retval = ZFCP_ERP_SUCCEEDED;
} else { } else {
ZFCP_LOG_DEBUG("failed to open unit fcp_lun=0x%Lx\n", ZFCP_LOG_DEBUG("open failed for unit 0x%016Lx\n",
unit->fcp_lun); unit->fcp_lun);
retval = ZFCP_ERP_FAILED; retval = ZFCP_ERP_FAILED;
} }
...@@ -3546,9 +3448,8 @@ zfcp_erp_action_enqueue(int action, ...@@ -3546,9 +3448,8 @@ zfcp_erp_action_enqueue(int action,
default: default:
debug_text_exception(adapter->erp_dbf, 1, "a_actenq_bug"); debug_text_exception(adapter->erp_dbf, 1, "a_actenq_bug");
debug_event(adapter->erp_dbf, 1, &action, sizeof (int)); debug_event(adapter->erp_dbf, 1, &action, sizeof (int));
ZFCP_LOG_NORMAL("bug: Unknown error recovery procedure " ZFCP_LOG_NORMAL("bug: unknown erp action requested "
"action requested on the adapter %s " "on adapter %s (action=%d)\n",
"(debug info %d)\n",
zfcp_get_busid_by_adapter(adapter), action); zfcp_get_busid_by_adapter(adapter), action);
goto out; goto out;
} }
...@@ -3558,8 +3459,8 @@ zfcp_erp_action_enqueue(int action, ...@@ -3558,8 +3459,8 @@ zfcp_erp_action_enqueue(int action,
debug_text_event(adapter->erp_dbf, 4, "a_actenq_str"); debug_text_event(adapter->erp_dbf, 4, "a_actenq_str");
debug_event(adapter->erp_dbf, 4, &stronger_action, debug_event(adapter->erp_dbf, 4, &stronger_action,
sizeof (int)); sizeof (int));
ZFCP_LOG_DEBUG("shortcut: need erp action %i before " ZFCP_LOG_DEBUG("stronger erp action %d needed before "
"erp action %i (adapter busid=%s)\n", "erp action %d on adapter %s\n",
stronger_action, action, stronger_action, action,
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
action = stronger_action; action = stronger_action;
......
...@@ -156,7 +156,6 @@ extern int zfcp_erp_unit_reopen(struct zfcp_unit *, int); ...@@ -156,7 +156,6 @@ extern int zfcp_erp_unit_reopen(struct zfcp_unit *, int);
extern int zfcp_erp_unit_shutdown(struct zfcp_unit *, int); extern int zfcp_erp_unit_shutdown(struct zfcp_unit *, int);
extern void zfcp_erp_unit_failed(struct zfcp_unit *); extern void zfcp_erp_unit_failed(struct zfcp_unit *);
extern void zfcp_erp_scsi_low_mem_buffer_timeout_handler(unsigned long);
extern int zfcp_erp_thread_setup(struct zfcp_adapter *); extern int zfcp_erp_thread_setup(struct zfcp_adapter *);
extern int zfcp_erp_thread_kill(struct zfcp_adapter *); extern int zfcp_erp_thread_kill(struct zfcp_adapter *);
extern int zfcp_erp_wait(struct zfcp_adapter *); extern int zfcp_erp_wait(struct zfcp_adapter *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment