Commit 57f8dc81 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] s390: zfcp log messages part 2

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

zfcp host adapter log message cleanup part 2:
 - Shorten log output.
 - Increase log level for some messages.
 - Always print leading zeroes for wwpn and fcp-lun.
parent 12c845ae
This diff is collapsed.
...@@ -196,23 +196,16 @@ ...@@ -196,23 +196,16 @@
/* channel features */ /* channel features */
#define FSF_FEATURE_QTCB_SUPPRESSION 0x00000001 #define FSF_FEATURE_QTCB_SUPPRESSION 0x00000001
#define FSF_FEATURE_CFDC 0x00000002 #define FSF_FEATURE_CFDC 0x00000002
#define FSF_FEATURE_LOST_SAN_NOTIFICATION 0x00000008
#define FSF_FEATURE_HBAAPI_MANAGEMENT 0x00000010 #define FSF_FEATURE_HBAAPI_MANAGEMENT 0x00000010
#define FSF_FEATURE_ELS_CT_CHAINED_SBALS 0x00000020 #define FSF_FEATURE_ELS_CT_CHAINED_SBALS 0x00000020
/* option */ /* option */
#define FSF_OPEN_LUN_SUPPRESS_BOXING 0x00000001 #define FSF_OPEN_LUN_SUPPRESS_BOXING 0x00000001
#define FSF_OPEN_LUN_UNSOLICITED_SENSE_DATA 0x00000002
/* adapter types */ /* adapter types */
#define FSF_ADAPTER_TYPE_FICON 0x00000001 #define FSF_ADAPTER_TYPE_FICON 0x00000001
#define FSF_ADAPTER_TYPE_FICON_EXPRESS 0x00000002 #define FSF_ADAPTER_TYPE_FICON_EXPRESS 0x00000002
/* flags */
#define FSF_CFDC_OPEN_LUN_ALLOWED 0x01
#define FSF_CFDC_EXCLUSIVE_ACCESS 0x02
#define FSF_CFDC_OUTBOUND_TRANSFER_ALLOWED 0x10
/* port types */ /* port types */
#define FSF_HBA_PORTTYPE_UNKNOWN 0x00000001 #define FSF_HBA_PORTTYPE_UNKNOWN 0x00000001
#define FSF_HBA_PORTTYPE_NOTPRESENT 0x00000003 #define FSF_HBA_PORTTYPE_NOTPRESENT 0x00000003
...@@ -328,18 +321,7 @@ union fsf_status_qual { ...@@ -328,18 +321,7 @@ union fsf_status_qual {
u8 byte[FSF_STATUS_QUALIFIER_SIZE]; u8 byte[FSF_STATUS_QUALIFIER_SIZE];
u16 halfword[FSF_STATUS_QUALIFIER_SIZE / sizeof (u16)]; u16 halfword[FSF_STATUS_QUALIFIER_SIZE / sizeof (u16)];
u32 word[FSF_STATUS_QUALIFIER_SIZE / sizeof (u32)]; u32 word[FSF_STATUS_QUALIFIER_SIZE / sizeof (u32)];
struct { struct fsf_queue_designator fsf_queue_designator;
u32 this_cmd;
u32 aborted_cmd;
} port_handle;
struct {
u32 this_cmd;
u32 aborted_cmd;
} lun_handle;
struct {
u64 found;
u64 expected;
} fcp_lun;
} __attribute__ ((packed)); } __attribute__ ((packed));
struct fsf_qtcb_header { struct fsf_qtcb_header {
...@@ -399,8 +381,7 @@ struct fsf_qtcb_bottom_support { ...@@ -399,8 +381,7 @@ struct fsf_qtcb_bottom_support {
u32 service_class; u32 service_class;
u8 res3[3]; u8 res3[3];
u8 timeout; u8 timeout;
u32 lun_access; u8 res4[184];
u8 res4[180];
u32 els1_length; u32 els1_length;
u32 els2_length; u32 els2_length;
u32 req_buf_length; u32 req_buf_length;
......
...@@ -76,16 +76,15 @@ zfcp_qdio_buffers_enqueue(struct qdio_buffer **cur_buf, int count) ...@@ -76,16 +76,15 @@ zfcp_qdio_buffers_enqueue(struct qdio_buffer **cur_buf, int count)
struct qdio_buffer *first_in_page = NULL; struct qdio_buffer *first_in_page = NULL;
qdio_buffers_per_page = PAGE_SIZE / sizeof (struct qdio_buffer); qdio_buffers_per_page = PAGE_SIZE / sizeof (struct qdio_buffer);
ZFCP_LOG_TRACE("Buffers per page %d.\n", qdio_buffers_per_page); ZFCP_LOG_TRACE("buffers_per_page=%d\n", qdio_buffers_per_page);
for (buf_pos = 0; buf_pos < count; buf_pos++) { for (buf_pos = 0; buf_pos < count; buf_pos++) {
if (page_pos == 0) { if (page_pos == 0) {
cur_buf[buf_pos] = (struct qdio_buffer *) cur_buf[buf_pos] = (struct qdio_buffer *)
get_zeroed_page(GFP_KERNEL); get_zeroed_page(GFP_KERNEL);
if (cur_buf[buf_pos] == NULL) { if (cur_buf[buf_pos] == NULL) {
ZFCP_LOG_INFO("error: Could not allocate " ZFCP_LOG_INFO("error: allocation of "
"memory for qdio transfer " "QDIO buffer failed \n");
"structures.\n");
goto out; goto out;
} }
first_in_page = cur_buf[buf_pos]; first_in_page = cur_buf[buf_pos];
...@@ -115,7 +114,7 @@ zfcp_qdio_buffers_dequeue(struct qdio_buffer **cur_buf, int count) ...@@ -115,7 +114,7 @@ zfcp_qdio_buffers_dequeue(struct qdio_buffer **cur_buf, int count)
int qdio_buffers_per_page; int qdio_buffers_per_page;
qdio_buffers_per_page = PAGE_SIZE / sizeof (struct qdio_buffer); qdio_buffers_per_page = PAGE_SIZE / sizeof (struct qdio_buffer);
ZFCP_LOG_TRACE("Buffers per page %d.\n", qdio_buffers_per_page); ZFCP_LOG_TRACE("buffers_per_page=%d\n", qdio_buffers_per_page);
for (buf_pos = 0; buf_pos < count; buf_pos += qdio_buffers_per_page) for (buf_pos = 0; buf_pos < count; buf_pos += qdio_buffers_per_page)
free_page((unsigned long) cur_buf[buf_pos]); free_page((unsigned long) cur_buf[buf_pos]);
...@@ -133,9 +132,8 @@ zfcp_qdio_allocate_queues(struct zfcp_adapter *adapter) ...@@ -133,9 +132,8 @@ zfcp_qdio_allocate_queues(struct zfcp_adapter *adapter)
zfcp_qdio_buffers_enqueue(&(adapter->request_queue.buffer[0]), zfcp_qdio_buffers_enqueue(&(adapter->request_queue.buffer[0]),
QDIO_MAX_BUFFERS_PER_Q); QDIO_MAX_BUFFERS_PER_Q);
if (buffer_count < QDIO_MAX_BUFFERS_PER_Q) { if (buffer_count < QDIO_MAX_BUFFERS_PER_Q) {
ZFCP_LOG_DEBUG("error: Out of memory allocating " ZFCP_LOG_DEBUG("only %d QDIO buffers allocated for request "
"request queue, only %d buffers got. " "queue\n", buffer_count);
"Binning them.\n", buffer_count);
zfcp_qdio_buffers_dequeue(&(adapter->request_queue.buffer[0]), zfcp_qdio_buffers_dequeue(&(adapter->request_queue.buffer[0]),
buffer_count); buffer_count);
retval = -ENOMEM; retval = -ENOMEM;
...@@ -146,12 +144,11 @@ zfcp_qdio_allocate_queues(struct zfcp_adapter *adapter) ...@@ -146,12 +144,11 @@ zfcp_qdio_allocate_queues(struct zfcp_adapter *adapter)
zfcp_qdio_buffers_enqueue(&(adapter->response_queue.buffer[0]), zfcp_qdio_buffers_enqueue(&(adapter->response_queue.buffer[0]),
QDIO_MAX_BUFFERS_PER_Q); QDIO_MAX_BUFFERS_PER_Q);
if (buffer_count < QDIO_MAX_BUFFERS_PER_Q) { if (buffer_count < QDIO_MAX_BUFFERS_PER_Q) {
ZFCP_LOG_DEBUG("error: Out of memory allocating " ZFCP_LOG_DEBUG("only %d QDIO buffers allocated for response "
"response queue, only %d buffers got. " "queue", buffer_count);
"Binning them.\n", buffer_count);
zfcp_qdio_buffers_dequeue(&(adapter->response_queue.buffer[0]), zfcp_qdio_buffers_dequeue(&(adapter->response_queue.buffer[0]),
buffer_count); buffer_count);
ZFCP_LOG_TRACE("Deallocating request_queue Buffers.\n"); ZFCP_LOG_TRACE("freeing request_queue buffers\n");
zfcp_qdio_buffers_dequeue(&(adapter->request_queue.buffer[0]), zfcp_qdio_buffers_dequeue(&(adapter->request_queue.buffer[0]),
QDIO_MAX_BUFFERS_PER_Q); QDIO_MAX_BUFFERS_PER_Q);
retval = -ENOMEM; retval = -ENOMEM;
...@@ -165,11 +162,11 @@ zfcp_qdio_allocate_queues(struct zfcp_adapter *adapter) ...@@ -165,11 +162,11 @@ zfcp_qdio_allocate_queues(struct zfcp_adapter *adapter)
void void
zfcp_qdio_free_queues(struct zfcp_adapter *adapter) zfcp_qdio_free_queues(struct zfcp_adapter *adapter)
{ {
ZFCP_LOG_TRACE("Deallocating request_queue Buffers.\n"); ZFCP_LOG_TRACE("freeing request_queue buffers\n");
zfcp_qdio_buffers_dequeue(&(adapter->request_queue.buffer[0]), zfcp_qdio_buffers_dequeue(&(adapter->request_queue.buffer[0]),
QDIO_MAX_BUFFERS_PER_Q); QDIO_MAX_BUFFERS_PER_Q);
ZFCP_LOG_TRACE("Deallocating response_queue Buffers.\n"); ZFCP_LOG_TRACE("freeing response_queue buffers\n");
zfcp_qdio_buffers_dequeue(&(adapter->response_queue.buffer[0]), zfcp_qdio_buffers_dequeue(&(adapter->response_queue.buffer[0]),
QDIO_MAX_BUFFERS_PER_Q); QDIO_MAX_BUFFERS_PER_Q);
} }
...@@ -237,8 +234,8 @@ zfcp_qdio_handler_error_check(struct zfcp_adapter *adapter, ...@@ -237,8 +234,8 @@ zfcp_qdio_handler_error_check(struct zfcp_adapter *adapter,
ZFCP_LOG_FLAGS(1, "QDIO_STATUS_LOOK_FOR_ERROR \n"); ZFCP_LOG_FLAGS(1, "QDIO_STATUS_LOOK_FOR_ERROR \n");
ZFCP_LOG_INFO("A qdio problem occured. The status, qdio_error " ZFCP_LOG_INFO("QDIO problem occurred (status=0x%x, "
"and siga_error are 0x%x, 0x%x and 0x%x\n", "qdio_error=0x%x, siga_error=0x%x)\n",
status, qdio_error, siga_error); status, qdio_error, siga_error);
if (status & QDIO_STATUS_ACTIVATE_CHECK_CONDITION) { if (status & QDIO_STATUS_ACTIVATE_CHECK_CONDITION) {
...@@ -273,8 +270,8 @@ zfcp_qdio_handler_error_check(struct zfcp_adapter *adapter, ...@@ -273,8 +270,8 @@ zfcp_qdio_handler_error_check(struct zfcp_adapter *adapter,
ZFCP_LOG_FLAGS(1, "SLSB_P_OUTPUT_ERROR\n"); ZFCP_LOG_FLAGS(1, "SLSB_P_OUTPUT_ERROR\n");
break; break;
default: default:
ZFCP_LOG_NORMAL("bug: Unknown qdio error reported " ZFCP_LOG_NORMAL("bug: unknown QDIO error 0x%x\n",
"(debug info 0x%x)\n", qdio_error); qdio_error);
break; break;
} }
/* Restarting IO on the failed adapter from scratch */ /* Restarting IO on the failed adapter from scratch */
...@@ -317,7 +314,7 @@ zfcp_qdio_request_handler(struct ccw_device *ccw_device, ...@@ -317,7 +314,7 @@ zfcp_qdio_request_handler(struct ccw_device *ccw_device,
adapter = (struct zfcp_adapter *) int_parm; adapter = (struct zfcp_adapter *) int_parm;
queue = &adapter->request_queue; queue = &adapter->request_queue;
ZFCP_LOG_DEBUG("busid=%s, first=%d, count=%d\n", ZFCP_LOG_DEBUG("adapter %s, first=%d, elements_processed=%d\n",
zfcp_get_busid_by_adapter(adapter), zfcp_get_busid_by_adapter(adapter),
first_element, elements_processed); first_element, elements_processed);
...@@ -336,7 +333,7 @@ zfcp_qdio_request_handler(struct ccw_device *ccw_device, ...@@ -336,7 +333,7 @@ zfcp_qdio_request_handler(struct ccw_device *ccw_device,
atomic_add(elements_processed, &queue->free_count); atomic_add(elements_processed, &queue->free_count);
ZFCP_LOG_DEBUG("free_count=%d\n", atomic_read(&queue->free_count)); ZFCP_LOG_DEBUG("free_count=%d\n", atomic_read(&queue->free_count));
wake_up(&adapter->request_wq); wake_up(&adapter->request_wq);
ZFCP_LOG_DEBUG("Elements_processed = %d, free count=%d\n", ZFCP_LOG_DEBUG("elements_processed=%d, free count=%d\n",
elements_processed, atomic_read(&queue->free_count)); elements_processed, atomic_read(&queue->free_count));
out: out:
return; return;
...@@ -383,7 +380,7 @@ zfcp_qdio_response_handler(struct ccw_device *ccw_device, ...@@ -383,7 +380,7 @@ zfcp_qdio_response_handler(struct ccw_device *ccw_device,
*/ */
buffere = &(queue->buffer[first_element]->element[0]); buffere = &(queue->buffer[first_element]->element[0]);
ZFCP_LOG_DEBUG("first BUFFERE flags=0x%x \n", buffere->flags); ZFCP_LOG_DEBUG("first BUFFERE flags=0x%x\n", buffere->flags);
/* /*
* go through all SBALs from input queue currently * go through all SBALs from input queue currently
* returned by QDIO layer * returned by QDIO layer
...@@ -406,19 +403,20 @@ zfcp_qdio_response_handler(struct ccw_device *ccw_device, ...@@ -406,19 +403,20 @@ zfcp_qdio_response_handler(struct ccw_device *ccw_device,
(void *) buffere->addr); (void *) buffere->addr);
if (retval) { if (retval) {
ZFCP_LOG_NORMAL ZFCP_LOG_NORMAL("bug: unexpected inbound "
("bug: Inbound packet seems not to " "packet on adapter %s "
"have been sent at all. It will be " "(reqid=0x%lx, "
"ignored. (debug info 0x%lx, 0x%lx, " "first_element=%d, "
"%d, %d, %s)\n", "elements_processed=%d)\n",
(unsigned long) buffere->addr, zfcp_get_busid_by_adapter(adapter),
(unsigned long) &(buffere->addr), (unsigned long) buffere->addr,
first_element, elements_processed, first_element,
zfcp_get_busid_by_adapter(adapter)); elements_processed);
ZFCP_LOG_NORMAL("Dump of inbound BUFFER %d " ZFCP_LOG_NORMAL("hex dump of inbound buffer "
"BUFFERE %d at address 0x%lx\n", "at address %p "
buffer_index, buffere_index, "(buffer_index=%d, "
(unsigned long) buffer); "buffere_index=%d)\n", buffer,
buffer_index, buffere_index);
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL, ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL,
(char *) buffer, SBAL_SIZE); (char *) buffer, SBAL_SIZE);
} }
...@@ -445,8 +443,9 @@ zfcp_qdio_response_handler(struct ccw_device *ccw_device, ...@@ -445,8 +443,9 @@ zfcp_qdio_response_handler(struct ccw_device *ccw_device,
count = atomic_read(&queue->free_count) + elements_processed; count = atomic_read(&queue->free_count) + elements_processed;
start = queue->free_index; start = queue->free_index;
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, buffers=0x%lx\n", "queue_no=%i, index_in_queue=%i, count=%i, "
"buffers=0x%lx\n",
zfcp_get_busid_by_adapter(adapter), zfcp_get_busid_by_adapter(adapter),
QDIO_FLAG_SYNC_INPUT | QDIO_FLAG_UNDER_INTERRUPT, QDIO_FLAG_SYNC_INPUT | QDIO_FLAG_UNDER_INTERRUPT,
0, start, count, (unsigned long) &queue->buffer[start]); 0, start, count, (unsigned long) &queue->buffer[start]);
...@@ -457,15 +456,16 @@ zfcp_qdio_response_handler(struct ccw_device *ccw_device, ...@@ -457,15 +456,16 @@ zfcp_qdio_response_handler(struct ccw_device *ccw_device,
if (unlikely(retval)) { if (unlikely(retval)) {
atomic_set(&queue->free_count, count); atomic_set(&queue->free_count, count);
ZFCP_LOG_DEBUG("Inbound data regions could not be cleared " ZFCP_LOG_DEBUG("clearing of inbound data regions failed, "
"Transfer queues may be down. " "queues may be down "
"(info %d, %d, %d)\n", count, start, retval); "(count=%d, start=%d, retval=%d)\n",
count, start, retval);
} else { } else {
queue->free_index += count; queue->free_index += count;
queue->free_index %= QDIO_MAX_BUFFERS_PER_Q; queue->free_index %= QDIO_MAX_BUFFERS_PER_Q;
atomic_set(&queue->free_count, 0); atomic_set(&queue->free_count, 0);
ZFCP_LOG_TRACE("%i buffers successfully enqueued to response " ZFCP_LOG_TRACE("%i buffers enqueued to response "
"queue starting at position %i\n", count, start); "queue at position %i\n", count, start);
} }
out: out:
return; return;
...@@ -491,8 +491,7 @@ zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, void *sbale_addr) ...@@ -491,8 +491,7 @@ zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, void *sbale_addr)
/* invalid (per convention used in this driver) */ /* invalid (per convention used in this driver) */
if (unlikely(!sbale_addr)) { if (unlikely(!sbale_addr)) {
ZFCP_LOG_NORMAL ZFCP_LOG_NORMAL("bug: invalid reqid\n");
("bug: Inbound data faulty, contains null-pointer!\n");
retval = -EINVAL; retval = -EINVAL;
goto out; goto out;
} }
...@@ -501,11 +500,9 @@ zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, void *sbale_addr) ...@@ -501,11 +500,9 @@ zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, void *sbale_addr)
fsf_req = (struct zfcp_fsf_req *) sbale_addr; fsf_req = (struct zfcp_fsf_req *) sbale_addr;
if (unlikely(adapter != fsf_req->adapter)) { if (unlikely(adapter != fsf_req->adapter)) {
ZFCP_LOG_NORMAL("bug: An inbound FSF acknowledgement was not " ZFCP_LOG_NORMAL("bug: invalid reqid (fsf_req=%p, "
"correct (debug info 0x%lx, 0x%lx, 0%lx) \n", "fsf_req->adapter=%p, adapter=%p)\n",
(unsigned long) fsf_req, fsf_req, fsf_req->adapter, adapter);
(unsigned long) fsf_req->adapter,
(unsigned long) adapter);
retval = -EINVAL; retval = -EINVAL;
goto out; goto out;
} }
...@@ -515,10 +512,9 @@ zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, void *sbale_addr) ...@@ -515,10 +512,9 @@ zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, void *sbale_addr)
&fsf_req->qtcb->prefix.req_seq_no, sizeof (u32)); &fsf_req->qtcb->prefix.req_seq_no, sizeof (u32));
} }
ZFCP_LOG_TRACE("fsf_req at 0x%lx, QTCB at 0x%lx\n", ZFCP_LOG_TRACE("fsf_req at %p, QTCB at %p\n", fsf_req, fsf_req->qtcb);
(unsigned long) fsf_req, (unsigned long) fsf_req->qtcb);
if (likely(fsf_req->qtcb)) { if (likely(fsf_req->qtcb)) {
ZFCP_LOG_TRACE("HEX DUMP OF 1ST BUFFERE PAYLOAD (QTCB):\n"); ZFCP_LOG_TRACE("hex dump of QTCB:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE, (char *) fsf_req->qtcb, ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE, (char *) fsf_req->qtcb,
sizeof(struct fsf_qtcb)); sizeof(struct fsf_qtcb));
} }
...@@ -889,8 +885,8 @@ zfcp_qdio_zero_sbals(struct qdio_buffer *buf[], int first, int clean_count) ...@@ -889,8 +885,8 @@ zfcp_qdio_zero_sbals(struct qdio_buffer *buf[], int first, int clean_count)
for (cur_pos = first; cur_pos < (first + clean_count); cur_pos++) { for (cur_pos = first; cur_pos < (first + clean_count); cur_pos++) {
index = cur_pos % QDIO_MAX_BUFFERS_PER_Q; index = cur_pos % QDIO_MAX_BUFFERS_PER_Q;
memset(buf[index], 0, sizeof (struct qdio_buffer)); memset(buf[index], 0, sizeof (struct qdio_buffer));
ZFCP_LOG_TRACE("zeroing BUFFER %d at address 0x%lx\n", ZFCP_LOG_TRACE("zeroing BUFFER %d at address %p\n",
index, (unsigned long) buf[index]); index, buf[index]);
} }
} }
......
...@@ -212,8 +212,8 @@ zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) ...@@ -212,8 +212,8 @@ zfcp_scsi_slave_destroy(struct scsi_device *sdpnt)
unit->device = NULL; unit->device = NULL;
zfcp_unit_put(unit); zfcp_unit_put(unit);
} else { } else {
ZFCP_LOG_INFO("no unit associated with SCSI device at " ZFCP_LOG_NORMAL("bug: no unit associated with SCSI device at "
"address 0x%lx\n", (unsigned long) sdpnt); "address %p\n", sdpnt);
} }
} }
...@@ -273,11 +273,9 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit, ...@@ -273,11 +273,9 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit,
if (unlikely( if (unlikely(
atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &unit->status) || atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &unit->status) ||
!atomic_test_mask(ZFCP_STATUS_COMMON_RUNNING, &unit->status))) { !atomic_test_mask(ZFCP_STATUS_COMMON_RUNNING, &unit->status))) {
ZFCP_LOG_DEBUG("Stopping SCSI IO on the unit with " ZFCP_LOG_DEBUG("stopping SCSI I/O on unit 0x%016Lx on port "
"FCP LUN 0x%Lx connected to the port " "0x%016Lx on adapter %s\n",
"with WWPN 0x%Lx at the adapter %s.\n", unit->fcp_lun, unit->port->wwpn,
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
zfcp_scsi_command_fail(scpnt, DID_ERROR); zfcp_scsi_command_fail(scpnt, DID_ERROR);
goto out; goto out;
...@@ -285,8 +283,8 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit, ...@@ -285,8 +283,8 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit,
if (unlikely( if (unlikely(
!atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status))) { !atomic_test_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status))) {
ZFCP_LOG_DEBUG("adapter %s not ready or unit with LUN 0x%Lx " ZFCP_LOG_DEBUG("adapter %s not ready or unit 0x%016Lx "
"on the port with WWPN 0x%Lx in recovery.\n", "on port 0x%016Lx in recovery\n",
zfcp_get_busid_by_unit(unit), zfcp_get_busid_by_unit(unit),
unit->fcp_lun, unit->port->wwpn); unit->fcp_lun, unit->port->wwpn);
retval = SCSI_MLQUEUE_DEVICE_BUSY; retval = SCSI_MLQUEUE_DEVICE_BUSY;
...@@ -297,7 +295,7 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit, ...@@ -297,7 +295,7 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit,
ZFCP_REQ_AUTO_CLEANUP); ZFCP_REQ_AUTO_CLEANUP);
if (unlikely(tmp < 0)) { if (unlikely(tmp < 0)) {
ZFCP_LOG_DEBUG("error: Could not send a Send FCP Command\n"); ZFCP_LOG_DEBUG("error: initiation of Send FCP Cmnd failed\n");
retval = SCSI_MLQUEUE_HOST_BUSY; retval = SCSI_MLQUEUE_HOST_BUSY;
} else { } else {
debug_text_event(adapter->req_dbf, 3, "q_scpnt"); debug_text_event(adapter->req_dbf, 3, "q_scpnt");
...@@ -443,11 +441,8 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) ...@@ -443,11 +441,8 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
scpnt->cmnd, scpnt->cmnd,
min(scpnt->cmd_len, (unsigned char) ZFCP_ABORT_DBF_LENGTH)); min(scpnt->cmd_len, (unsigned char) ZFCP_ABORT_DBF_LENGTH));
/*TRACE*/ ZFCP_LOG_INFO("aborting scsi_cmnd=%p on adapter %s\n",
ZFCP_LOG_INFO scpnt, zfcp_get_busid_by_adapter(adapter));
("Aborting for adapter=0x%lx, busid=%s, scsi_cmnd=0x%lx\n",
(unsigned long) adapter, zfcp_get_busid_by_adapter(adapter),
(unsigned long) scpnt);
spin_unlock_irq(scsi_host->host_lock); spin_unlock_irq(scsi_host->host_lock);
...@@ -469,7 +464,7 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) ...@@ -469,7 +464,7 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
*/ */
req_data = (union zfcp_req_data *) scpnt->host_scribble; req_data = (union zfcp_req_data *) scpnt->host_scribble;
/* DEBUG */ /* DEBUG */
ZFCP_LOG_DEBUG("req_data=0x%lx\n", (unsigned long) req_data); ZFCP_LOG_DEBUG("req_data=%p\n", req_data);
if (!req_data) { if (!req_data) {
ZFCP_LOG_DEBUG("late command completion overtook abort\n"); ZFCP_LOG_DEBUG("late command completion overtook abort\n");
/* /*
...@@ -489,11 +484,10 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) ...@@ -489,11 +484,10 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
dbf_timeout = dbf_timeout =
(jiffies - req_data->send_fcp_command_task.start_jiffies) / HZ; (jiffies - req_data->send_fcp_command_task.start_jiffies) / HZ;
/* DEBUG */ ZFCP_LOG_DEBUG("old_fsf_req=%p\n", old_fsf_req);
ZFCP_LOG_DEBUG("old_fsf_req=0x%lx\n", (unsigned long) old_fsf_req);
if (!old_fsf_req) { if (!old_fsf_req) {
write_unlock_irqrestore(&adapter->abort_lock, flags); write_unlock_irqrestore(&adapter->abort_lock, flags);
ZFCP_LOG_NORMAL("bug: No old fsf request found.\n"); ZFCP_LOG_NORMAL("bug: no old fsf request found\n");
ZFCP_LOG_NORMAL("req_data:\n"); ZFCP_LOG_NORMAL("req_data:\n");
ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL, ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL,
(char *) req_data, sizeof (union zfcp_req_data)); (char *) req_data, sizeof (union zfcp_req_data));
...@@ -517,8 +511,7 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) ...@@ -517,8 +511,7 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
* Since this lock will not be held, fsf_req may complete * Since this lock will not be held, fsf_req may complete
* late and may be released meanwhile. * late and may be released meanwhile.
*/ */
ZFCP_LOG_DEBUG("unit=0x%lx, unit_fcp_lun=0x%Lx\n", ZFCP_LOG_DEBUG("unit 0x%016Lx (%p)\n", unit->fcp_lun, unit);
(unsigned long) unit, unit->fcp_lun);
/* /*
* The 'Abort FCP Command' routine may block (call schedule) * The 'Abort FCP Command' routine may block (call schedule)
...@@ -533,18 +526,18 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) ...@@ -533,18 +526,18 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
new_fsf_req = zfcp_fsf_abort_fcp_command((unsigned long) old_fsf_req, new_fsf_req = zfcp_fsf_abort_fcp_command((unsigned long) old_fsf_req,
adapter, adapter,
unit, ZFCP_WAIT_FOR_SBAL); unit, ZFCP_WAIT_FOR_SBAL);
ZFCP_LOG_DEBUG("new_fsf_req=0x%lx\n", (unsigned long) new_fsf_req); ZFCP_LOG_DEBUG("new_fsf_req=%p\n", new_fsf_req);
if (!new_fsf_req) { if (!new_fsf_req) {
retval = FAILED; retval = FAILED;
ZFCP_LOG_DEBUG("warning: Could not abort SCSI command " ZFCP_LOG_NORMAL("error: initiation of Abort FCP Cmnd "
"at 0x%lx\n", (unsigned long) scpnt); "failed\n");
strncpy(dbf_result, "##nores", ZFCP_ABORT_DBF_LENGTH); strncpy(dbf_result, "##nores", ZFCP_ABORT_DBF_LENGTH);
goto out; goto out;
} }
/* wait for completion of abort */ /* wait for completion of abort */
ZFCP_LOG_DEBUG("Waiting for cleanup....\n"); ZFCP_LOG_DEBUG("waiting for cleanup...\n");
#ifdef 1 #if 1
/* /*
* FIXME: * FIXME:
* copying zfcp_fsf_req_wait_and_cleanup code is not really nice * copying zfcp_fsf_req_wait_and_cleanup code is not really nice
...@@ -615,11 +608,11 @@ zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt) ...@@ -615,11 +608,11 @@ zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt)
spin_unlock_irq(scsi_host->host_lock); spin_unlock_irq(scsi_host->host_lock);
if (!unit) { if (!unit) {
ZFCP_LOG_NORMAL("bug: Tried to reset a non existant unit.\n"); ZFCP_LOG_NORMAL("bug: Tried reset for nonexistent unit\n");
retval = SUCCESS; retval = SUCCESS;
goto out; goto out;
} }
ZFCP_LOG_NORMAL("Resetting Device fcp_lun=0x%Lx\n", unit->fcp_lun); ZFCP_LOG_NORMAL("resetting unit 0x%016Lx\n", unit->fcp_lun);
/* /*
* If we do not know whether the unit supports 'logical unit reset' * If we do not know whether the unit supports 'logical unit reset'
...@@ -633,18 +626,15 @@ zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt) ...@@ -633,18 +626,15 @@ zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt)
retval = retval =
zfcp_task_management_function(unit, LOGICAL_UNIT_RESET); zfcp_task_management_function(unit, LOGICAL_UNIT_RESET);
if (retval) { if (retval) {
ZFCP_LOG_DEBUG ZFCP_LOG_DEBUG("unit reset failed (unit=%p)\n", unit);
("logical unit reset failed (unit=0x%lx)\n",
(unsigned long) unit);
if (retval == -ENOTSUPP) if (retval == -ENOTSUPP)
atomic_set_mask atomic_set_mask
(ZFCP_STATUS_UNIT_NOTSUPPUNITRESET, (ZFCP_STATUS_UNIT_NOTSUPPUNITRESET,
&unit->status); &unit->status);
/* fall through and try 'target reset' next */ /* fall through and try 'target reset' next */
} else { } else {
ZFCP_LOG_DEBUG ZFCP_LOG_DEBUG("unit reset succeeded (unit=%p)\n",
("logical unit reset succeeded (unit=0x%lx)\n", unit);
(unsigned long) unit);
/* avoid 'target reset' */ /* avoid 'target reset' */
retval = SUCCESS; retval = SUCCESS;
goto out; goto out;
...@@ -652,12 +642,10 @@ zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt) ...@@ -652,12 +642,10 @@ zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt)
} }
retval = zfcp_task_management_function(unit, TARGET_RESET); retval = zfcp_task_management_function(unit, TARGET_RESET);
if (retval) { if (retval) {
ZFCP_LOG_DEBUG("target reset failed (unit=0x%lx)\n", ZFCP_LOG_DEBUG("target reset failed (unit=%p)\n", unit);
(unsigned long) unit);
retval = FAILED; retval = FAILED;
} else { } else {
ZFCP_LOG_DEBUG("target reset succeeded (unit=0x%lx)\n", ZFCP_LOG_DEBUG("target reset succeeded (unit=%p)\n", unit);
(unsigned long) unit);
retval = SUCCESS; retval = SUCCESS;
} }
out: out:
...@@ -677,13 +665,9 @@ zfcp_task_management_function(struct zfcp_unit *unit, u8 tm_flags) ...@@ -677,13 +665,9 @@ zfcp_task_management_function(struct zfcp_unit *unit, u8 tm_flags)
fsf_req = zfcp_fsf_send_fcp_command_task_management fsf_req = zfcp_fsf_send_fcp_command_task_management
(adapter, unit, tm_flags, ZFCP_WAIT_FOR_SBAL); (adapter, unit, tm_flags, ZFCP_WAIT_FOR_SBAL);
if (!fsf_req) { if (!fsf_req) {
ZFCP_LOG_INFO("error: Out of resources. Could not create a " ZFCP_LOG_INFO("error: creation of task management request "
"task management (abort, reset, etc) request " "failed for unit 0x%016Lx on port 0x%016Lx on "
"for the unit with FCP-LUN 0x%Lx connected to " "adapter %s\n", unit->fcp_lun, unit->port->wwpn,
"the port with WWPN 0x%Lx connected to "
"the adapter %s.\n",
unit->fcp_lun,
unit->port->wwpn,
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
retval = -ENOMEM; retval = -ENOMEM;
goto out; goto out;
...@@ -722,10 +706,8 @@ zfcp_scsi_eh_bus_reset_handler(struct scsi_cmnd *scpnt) ...@@ -722,10 +706,8 @@ zfcp_scsi_eh_bus_reset_handler(struct scsi_cmnd *scpnt)
spin_unlock_irq(scsi_host->host_lock); spin_unlock_irq(scsi_host->host_lock);
unit = (struct zfcp_unit *) scpnt->device->hostdata; unit = (struct zfcp_unit *) scpnt->device->hostdata;
/*DEBUG*/ ZFCP_LOG_NORMAL("bus reset because of problems with "
ZFCP_LOG_NORMAL("Resetting because of problems with " "unit 0x%016Lx\n", unit->fcp_lun);
"unit=0x%lx, unit_fcp_lun=0x%Lx\n",
(unsigned long) unit, unit->fcp_lun);
zfcp_erp_adapter_reopen(unit->port->adapter, 0); zfcp_erp_adapter_reopen(unit->port->adapter, 0);
zfcp_erp_wait(unit->port->adapter); zfcp_erp_wait(unit->port->adapter);
retval = SUCCESS; retval = SUCCESS;
...@@ -751,10 +733,8 @@ zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt) ...@@ -751,10 +733,8 @@ zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt)
spin_unlock_irq(scsi_host->host_lock); spin_unlock_irq(scsi_host->host_lock);
unit = (struct zfcp_unit *) scpnt->device->hostdata; unit = (struct zfcp_unit *) scpnt->device->hostdata;
/*DEBUG*/ ZFCP_LOG_NORMAL("host reset because of problems with "
ZFCP_LOG_NORMAL("Resetting because of problems with " "unit 0x%016Lx\n", unit->fcp_lun);
"unit=0x%lx, unit_fcp_lun=0x%Lx\n",
(unsigned long) unit, unit->fcp_lun);
zfcp_erp_adapter_reopen(unit->port->adapter, 0); zfcp_erp_adapter_reopen(unit->port->adapter, 0);
zfcp_erp_wait(unit->port->adapter); zfcp_erp_wait(unit->port->adapter);
retval = SUCCESS; retval = SUCCESS;
...@@ -780,15 +760,13 @@ zfcp_adapter_scsi_register(struct zfcp_adapter *adapter) ...@@ -780,15 +760,13 @@ zfcp_adapter_scsi_register(struct zfcp_adapter *adapter)
adapter->scsi_host = scsi_host_alloc(&zfcp_data.scsi_host_template, adapter->scsi_host = scsi_host_alloc(&zfcp_data.scsi_host_template,
sizeof (struct zfcp_adapter *)); sizeof (struct zfcp_adapter *));
if (!adapter->scsi_host) { if (!adapter->scsi_host) {
ZFCP_LOG_NORMAL("error: Not enough free memory. " ZFCP_LOG_NORMAL("error: registration with SCSI stack failed "
"Could not register adapter %s " "for adapter %s ",
"with the SCSI-stack.\n",
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
retval = -EIO; retval = -EIO;
goto out; goto out;
} }
ZFCP_LOG_DEBUG("host registered, scsi_host at 0x%lx\n", ZFCP_LOG_DEBUG("host registered, scsi_host=%p\n", adapter->scsi_host);
(unsigned long) adapter->scsi_host);
/* tell the SCSI stack some characteristics of this adapter */ /* tell the SCSI stack some characteristics of this adapter */
adapter->scsi_host->max_id = 1; adapter->scsi_host->max_id = 1;
......
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