From 74b2e047ecda7a82c3327a0d0bb45ee2ccf301ca Mon Sep 17 00:00:00 2001 From: Christof Schmitt Date: Mon, 3 Mar 2008 12:19:28 +0100 Subject: [SCSI] zfcp: convert zfcp to use target reset and device reset handler [based on proposal from Mike Christie , this patch adds some simplifications to the handler functions] With the new target reset handler callback in the SCSI midlayer, the device reset handler in zfcp can be split in two parts. Now, zfcp does not have to track anymore whether the device supports LUN resets, so remove this flag and let the SCSI midlayer decide what to do. The device reset handler simply issues a LUN reset and the target reset handler a target reset. Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_def.h | 1 - drivers/s390/scsi/zfcp_scsi.c | 64 ++++++++++++++----------------------------- 2 files changed, 20 insertions(+), 45 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 9e9f6c1e4e5..662c70f537e 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -634,7 +634,6 @@ do { \ ZFCP_STATUS_PORT_NO_SCSI_ID) /* logical unit status */ -#define ZFCP_STATUS_UNIT_NOTSUPPUNITRESET 0x00000001 #define ZFCP_STATUS_UNIT_TEMPORARY 0x00000002 #define ZFCP_STATUS_UNIT_SHARED 0x00000004 #define ZFCP_STATUS_UNIT_READONLY 0x00000008 diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index b9daf5c0586..ff97a61ad96 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -31,6 +31,7 @@ static int zfcp_scsi_queuecommand(struct scsi_cmnd *, void (*done) (struct scsi_cmnd *)); static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *); static int zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *); +static int zfcp_scsi_eh_target_reset_handler(struct scsi_cmnd *); static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *); static int zfcp_task_management_function(struct zfcp_unit *, u8, struct scsi_cmnd *); @@ -51,6 +52,7 @@ struct zfcp_data zfcp_data = { .queuecommand = zfcp_scsi_queuecommand, .eh_abort_handler = zfcp_scsi_eh_abort_handler, .eh_device_reset_handler = zfcp_scsi_eh_device_reset_handler, + .eh_target_reset_handler = zfcp_scsi_eh_target_reset_handler, .eh_host_reset_handler = zfcp_scsi_eh_host_reset_handler, .can_queue = 4096, .this_id = -1, @@ -442,58 +444,32 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) return retval; } -static int -zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt) +static int zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt) { int retval; - struct zfcp_unit *unit = (struct zfcp_unit *) scpnt->device->hostdata; + struct zfcp_unit *unit = scpnt->device->hostdata; if (!unit) { - ZFCP_LOG_NORMAL("bug: Tried reset for nonexistent unit\n"); - retval = SUCCESS; - goto out; + WARN_ON(1); + return SUCCESS; } - ZFCP_LOG_NORMAL("resetting unit 0x%016Lx on port 0x%016Lx, adapter %s\n", - unit->fcp_lun, unit->port->wwpn, - zfcp_get_busid_by_adapter(unit->port->adapter)); + retval = zfcp_task_management_function(unit, + FCP_LOGICAL_UNIT_RESET, + scpnt); + return retval ? FAILED : SUCCESS; +} - /* - * If we do not know whether the unit supports 'logical unit reset' - * then try 'logical unit reset' and proceed with 'target reset' - * if 'logical unit reset' fails. - * If the unit is known not to support 'logical unit reset' then - * skip 'logical unit reset' and try 'target reset' immediately. - */ - if (!atomic_test_mask(ZFCP_STATUS_UNIT_NOTSUPPUNITRESET, - &unit->status)) { - retval = zfcp_task_management_function(unit, - FCP_LOGICAL_UNIT_RESET, - scpnt); - if (retval) { - ZFCP_LOG_DEBUG("unit reset failed (unit=%p)\n", unit); - if (retval == -ENOTSUPP) - atomic_set_mask - (ZFCP_STATUS_UNIT_NOTSUPPUNITRESET, - &unit->status); - /* fall through and try 'target reset' next */ - } else { - ZFCP_LOG_DEBUG("unit reset succeeded (unit=%p)\n", - unit); - /* avoid 'target reset' */ - retval = SUCCESS; - goto out; - } +static int zfcp_scsi_eh_target_reset_handler(struct scsi_cmnd *scpnt) +{ + int retval; + struct zfcp_unit *unit = scpnt->device->hostdata; + + if (!unit) { + WARN_ON(1); + return SUCCESS; } retval = zfcp_task_management_function(unit, FCP_TARGET_RESET, scpnt); - if (retval) { - ZFCP_LOG_DEBUG("target reset failed (unit=%p)\n", unit); - retval = FAILED; - } else { - ZFCP_LOG_DEBUG("target reset succeeded (unit=%p)\n", unit); - retval = SUCCESS; - } - out: - return retval; + return retval ? FAILED : SUCCESS; } static int -- cgit v1.2.3 From 5c815d1501a9ce84578cb3ec64c9d31ef91e3de2 Mon Sep 17 00:00:00 2001 From: Christof Schmitt Date: Mon, 10 Mar 2008 16:18:54 +0100 Subject: [SCSI] zfcp: Fix handling for boxed port after physical close When a FSF physical close returns the status boxed, this means that another system already closed the port. For our system this is the same status as in the good path, we have to send the normal close. So, set the status for the boxed response to the same as for the good status. Signed-off-by: Christof Schmitt Signed-off-by: Martin Peschke Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_fsf.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 0dff05840ee..2ed3c7b4888 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -2968,6 +2968,13 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) zfcp_erp_port_boxed(port); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; + + /* can't use generic zfcp_erp_modify_port_status because + * ZFCP_STATUS_COMMON_OPEN must not be reset for the port */ + atomic_clear_mask(ZFCP_STATUS_PORT_PHYS_OPEN, &port->status); + list_for_each_entry(unit, &port->unit_list_head, list) + atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, + &unit->status); break; case FSF_ADAPTER_STATUS_AVAILABLE: -- cgit v1.2.3 From c15450e33d198334291d50b5a95337c6b90cdab0 Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Thu, 27 Mar 2008 14:21:55 +0100 Subject: [SCSI] zfcp: Introduce a helper function that dumps hex data to a zfcp trace. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 701046c9bb3..0faadb0cda2 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -31,6 +31,24 @@ MODULE_PARM_DESC(dbfsize, #define ZFCP_LOG_AREA ZFCP_LOG_AREA_OTHER +static void zfcp_dbf_hexdump(debug_info_t *dbf, void *to, int to_len, + int level, char *from, int from_len) +{ + int offset; + struct zfcp_dbf_dump *dump = to; + int room = to_len - sizeof(*dump); + + for (offset = 0; offset < from_len; offset += dump->size) { + memset(to, 0, to_len); + strncpy(dump->tag, "dump", ZFCP_DBF_TAG_SIZE); + dump->total_size = from_len; + dump->offset = offset; + dump->size = min(from_len - offset, room); + memcpy(dump->data, from + offset, dump->size); + debug_event(dbf, level, dump, dump->size); + } +} + static int zfcp_dbf_stck(char *out_buf, const char *label, unsigned long long stck) { -- cgit v1.2.3 From 0f65e951ee0c4a7506c6c0489b59a6fb1d2f0e75 Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Thu, 27 Mar 2008 14:21:56 +0100 Subject: [SCSI] zfcp: Clean up _zfcp_san_dbf_event_common_els Clean up _zfcp_san_dbf_event_common_els using zfcp_dbf_hexdump() helper. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.c | 39 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 0faadb0cda2..5019d7b738b 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -562,38 +562,19 @@ _zfcp_san_dbf_event_common_els(const char *tag, int level, { struct zfcp_adapter *adapter = fsf_req->adapter; struct zfcp_san_dbf_record *rec = &adapter->san_dbf_buf; - struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec; unsigned long flags; - int offset = 0; spin_lock_irqsave(&adapter->san_dbf_lock, flags); - do { - memset(rec, 0, sizeof(struct zfcp_san_dbf_record)); - if (offset == 0) { - strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE); - rec->fsf_reqid = (unsigned long)fsf_req; - rec->fsf_seqno = fsf_req->seq_no; - rec->s_id = s_id; - rec->d_id = d_id; - rec->type.els.ls_code = ls_code; - buflen = min(buflen, ZFCP_DBF_ELS_MAX_PAYLOAD); - rec->type.els.payload_size = buflen; - memcpy(rec->type.els.payload, - buffer, min(buflen, ZFCP_DBF_ELS_PAYLOAD)); - offset += min(buflen, ZFCP_DBF_ELS_PAYLOAD); - } else { - strncpy(dump->tag, "dump", ZFCP_DBF_TAG_SIZE); - dump->total_size = buflen; - dump->offset = offset; - dump->size = min(buflen - offset, - (int)sizeof(struct zfcp_san_dbf_record) - - (int)sizeof(struct zfcp_dbf_dump)); - memcpy(dump->data, buffer + offset, dump->size); - offset += dump->size; - } - debug_event(adapter->san_dbf, level, - rec, sizeof(struct zfcp_san_dbf_record)); - } while (offset < buflen); + memset(rec, 0, sizeof(struct zfcp_san_dbf_record)); + strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE); + rec->fsf_reqid = (unsigned long)fsf_req; + rec->fsf_seqno = fsf_req->seq_no; + rec->s_id = s_id; + rec->d_id = d_id; + rec->type.els.ls_code = ls_code; + debug_event(adapter->san_dbf, level, rec, sizeof(*rec)); + zfcp_dbf_hexdump(adapter->san_dbf, rec, sizeof(*rec), level, + buffer, min(buflen, ZFCP_DBF_ELS_MAX_PAYLOAD)); spin_unlock_irqrestore(&adapter->san_dbf_lock, flags); } -- cgit v1.2.3 From 07c70d26b556b342e7ad285963974808efba3104 Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Thu, 27 Mar 2008 14:21:57 +0100 Subject: [SCSI] zfcp: Remove qtcb dump to kernel log Is not appropriate to printk() tons of hardware trace data. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_fsf.c | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 2ed3c7b4888..264f5f1bdde 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -284,37 +284,6 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) goto skip_protstatus; } - /* log additional information provided by FSF (if any) */ - if (likely(qtcb->header.log_length)) { - /* do not trust them ;-) */ - if (unlikely(qtcb->header.log_start > - sizeof(struct fsf_qtcb))) { - ZFCP_LOG_NORMAL - ("bug: ULP (FSF logging) log data starts " - "beyond end of packet header. Ignored. " - "(start=%i, size=%li)\n", - qtcb->header.log_start, - sizeof(struct fsf_qtcb)); - goto forget_log; - } - if (unlikely((size_t) (qtcb->header.log_start + - qtcb->header.log_length) > - sizeof(struct fsf_qtcb))) { - ZFCP_LOG_NORMAL("bug: ULP (FSF logging) log data ends " - "beyond end of packet header. Ignored. " - "(start=%i, length=%i, size=%li)\n", - qtcb->header.log_start, - qtcb->header.log_length, - sizeof(struct fsf_qtcb)); - goto forget_log; - } - ZFCP_LOG_TRACE("ULP log data: \n"); - ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_TRACE, - (char *) qtcb + qtcb->header.log_start, - qtcb->header.log_length); - } - forget_log: - /* evaluate FSF Protocol Status */ switch (qtcb->prefix.prot_status) { -- cgit v1.2.3 From b75db73159ccffaf60a67896fdfed3856b1f65e3 Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Thu, 27 Mar 2008 14:21:58 +0100 Subject: [SCSI] zfcp: Add qtcb dump to hba debug trace This patch adds per request hardware debugging data to the trace record which is written per request. It's a replacement for some sad kernel message based debugging code. Considering the amount of trace data, printk() is not suitable for this stuff. Writing binary traces is more efficient. In addition we got all information in one place. The QTCB trace data is only dumped for requests other than SCSI requests. Otherwise we would flood the trace ring buffer. We are mostly interested in non-SCSI, recovery related requests here anyway. This patch also works around a known hardware bug. It truncates QTCB traces so that we do not save unused areas of the hardware trace. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 5019d7b738b..658053c7470 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -179,6 +179,9 @@ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req) (fsf_req->fsf_command == FSF_QTCB_OPEN_LUN)) { strncpy(rec->tag2, "open", ZFCP_DBF_TAG_SIZE); level = 4; + } else if (qtcb->header.log_length) { + strncpy(rec->tag2, "qtcb", ZFCP_DBF_TAG_SIZE); + level = 5; } else { strncpy(rec->tag2, "norm", ZFCP_DBF_TAG_SIZE); level = 6; @@ -250,6 +253,17 @@ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req) debug_event(adapter->hba_dbf, level, rec, sizeof(struct zfcp_hba_dbf_record)); + + /* have fcp channel microcode fixed to use as little as possible */ + if (fsf_req->fsf_command != FSF_QTCB_FCP_CMND) { + /* adjust length skipping trailing zeros */ + char *buf = (char *)qtcb + qtcb->header.log_start; + int len = qtcb->header.log_length; + for (; len && !buf[len - 1]; len--); + zfcp_dbf_hexdump(adapter->hba_dbf, rec, sizeof(*rec), level, + buf, len); + } + spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags); } -- cgit v1.2.3 From 10223c60daf226ee2248b772892abc83cd875aa7 Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Thu, 27 Mar 2008 14:21:59 +0100 Subject: [SCSI] zfcp: Introduce printf helper functions for debug trace. Introducing helper functions that allow for code simpfifications. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 658053c7470..45334378399 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -95,6 +95,22 @@ zfcp_dbf_view(char *out_buf, const char *label, const char *format, ...) return len; } +static void zfcp_dbf_outs(char **buf, const char *s1, const char *s2) +{ + *buf += sprintf(*buf, "%-24s%s\n", s1, s2); +} + +static void zfcp_dbf_out(char **buf, const char *s, const char *format, ...) +{ + va_list arg; + + *buf += sprintf(*buf, "%-24s", s); + va_start(arg, format); + *buf += vsprintf(*buf, format, arg); + va_end(arg); + *buf += sprintf(*buf, "\n"); +} + static int zfcp_dbf_view_dump(char *out_buf, const char *label, char *buffer, int buflen, int offset, int total_size) -- cgit v1.2.3 From d79a83dbffe2e49e73f2903c350937faf2e0c2f1 Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Thu, 27 Mar 2008 14:22:00 +0100 Subject: [SCSI] zfcp: Register new recovery trace. This patch registers the new recovery trace with the s390 debug feature. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_aux.c | 1 + drivers/s390/scsi/zfcp_dbf.c | 42 ++++++++++++++++++++++++++++++++++++++++++ drivers/s390/scsi/zfcp_def.h | 10 ++++++++++ 3 files changed, 53 insertions(+) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 874b55ed00a..f3eff7ebcb6 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -1034,6 +1034,7 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device) spin_lock_init(&adapter->hba_dbf_lock); spin_lock_init(&adapter->san_dbf_lock); spin_lock_init(&adapter->scsi_dbf_lock); + spin_lock_init(&adapter->rec_dbf_lock); retval = zfcp_adapter_debug_register(adapter); if (retval) diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 45334378399..e7712eb13ee 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -520,6 +520,36 @@ static struct debug_view zfcp_hba_dbf_view = { NULL }; +static const char *zfcp_rec_dbf_tags[] = { +}; + +static const char *zfcp_rec_dbf_ids[] = { +}; + +static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, + char *buf, const char *_rec) +{ + struct zfcp_rec_dbf_record *r = (struct zfcp_rec_dbf_record *)_rec; + char *p = buf; + + zfcp_dbf_outs(&p, "tag", zfcp_rec_dbf_tags[r->id]); + zfcp_dbf_outs(&p, "hint", zfcp_rec_dbf_ids[r->id2]); + zfcp_dbf_out(&p, "id", "%d", r->id2); + switch (r->id) { + } + sprintf(p, "\n"); + return (p - buf) + 1; +} + +static struct debug_view zfcp_rec_dbf_view = { + "structured", + NULL, + &zfcp_dbf_view_header, + &zfcp_rec_dbf_view_format, + NULL, + NULL +}; + static void _zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req, u32 s_id, u32 d_id, void *buffer, int buflen) @@ -934,6 +964,16 @@ int zfcp_adapter_debug_register(struct zfcp_adapter *adapter) debug_register_view(adapter->erp_dbf, &debug_hex_ascii_view); debug_set_level(adapter->erp_dbf, 3); + /* debug feature area which records recovery activity */ + sprintf(dbf_name, "zfcp_%s_rec", zfcp_get_busid_by_adapter(adapter)); + adapter->rec_dbf = debug_register(dbf_name, dbfsize, 1, + sizeof(struct zfcp_rec_dbf_record)); + if (!adapter->rec_dbf) + goto failed; + debug_register_view(adapter->rec_dbf, &debug_hex_ascii_view); + debug_register_view(adapter->rec_dbf, &zfcp_rec_dbf_view); + debug_set_level(adapter->rec_dbf, 3); + /* debug feature area which records HBA (FSF and QDIO) conditions */ sprintf(dbf_name, "zfcp_%s_hba", zfcp_get_busid_by_adapter(adapter)); adapter->hba_dbf = debug_register(dbf_name, dbfsize, 1, @@ -981,10 +1021,12 @@ void zfcp_adapter_debug_unregister(struct zfcp_adapter *adapter) debug_unregister(adapter->scsi_dbf); debug_unregister(adapter->san_dbf); debug_unregister(adapter->hba_dbf); + debug_unregister(adapter->rec_dbf); debug_unregister(adapter->erp_dbf); adapter->scsi_dbf = NULL; adapter->san_dbf = NULL; adapter->hba_dbf = NULL; + adapter->rec_dbf = NULL; adapter->erp_dbf = NULL; } diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 662c70f537e..f29bee52848 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -279,6 +279,13 @@ struct zfcp_erp_dbf_record { u8 dummy[16]; } __attribute__ ((packed)); +struct zfcp_rec_dbf_record { + u8 id; + u8 id2; + union { + } u; +} __attribute__ ((packed)); + struct zfcp_hba_dbf_record_response { u32 fsf_command; u64 fsf_reqid; @@ -917,14 +924,17 @@ struct zfcp_adapter { for memory */ struct zfcp_port *nameserver_port; /* adapter's nameserver */ debug_info_t *erp_dbf; + debug_info_t *rec_dbf; debug_info_t *hba_dbf; debug_info_t *san_dbf; /* debug feature areas */ debug_info_t *scsi_dbf; spinlock_t erp_dbf_lock; + spinlock_t rec_dbf_lock; spinlock_t hba_dbf_lock; spinlock_t san_dbf_lock; spinlock_t scsi_dbf_lock; struct zfcp_erp_dbf_record erp_dbf_buf; + struct zfcp_rec_dbf_record rec_dbf_buf; struct zfcp_hba_dbf_record hba_dbf_buf; struct zfcp_san_dbf_record san_dbf_buf; struct zfcp_scsi_dbf_record scsi_dbf_buf; -- cgit v1.2.3 From 348447e85749120ad600a5c8e23b6bb7058b931d Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Thu, 27 Mar 2008 14:22:01 +0100 Subject: [SCSI] zfcp: Add trace records for recovery thread and its queues This patch writes trace records which provide information about the operation of the zfcp error recovery thread and the queues it works on. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.c | 51 ++++++++++++++++++++++++++++++++++++++++++++ drivers/s390/scsi/zfcp_def.h | 12 +++++++++++ drivers/s390/scsi/zfcp_erp.c | 9 ++++++++ drivers/s390/scsi/zfcp_ext.h | 3 +++ 4 files changed, 75 insertions(+) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index e7712eb13ee..5a4b1e9a8b5 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -521,9 +521,19 @@ static struct debug_view zfcp_hba_dbf_view = { }; static const char *zfcp_rec_dbf_tags[] = { + [ZFCP_REC_DBF_ID_THREAD] = "thread", }; static const char *zfcp_rec_dbf_ids[] = { + [1] = "new", + [2] = "ready", + [3] = "kill", + [4] = "down sleep", + [5] = "down wakeup", + [6] = "down sleep ecd", + [7] = "down wakeup ecd", + [8] = "down sleep epd", + [9] = "down wakeup epd", }; static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, @@ -536,6 +546,12 @@ static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, zfcp_dbf_outs(&p, "hint", zfcp_rec_dbf_ids[r->id2]); zfcp_dbf_out(&p, "id", "%d", r->id2); switch (r->id) { + case ZFCP_REC_DBF_ID_THREAD: + zfcp_dbf_out(&p, "sema", "%d", r->u.thread.sema); + zfcp_dbf_out(&p, "total", "%d", r->u.thread.total); + zfcp_dbf_out(&p, "ready", "%d", r->u.thread.ready); + zfcp_dbf_out(&p, "running", "%d", r->u.thread.running); + break; } sprintf(p, "\n"); return (p - buf) + 1; @@ -550,6 +566,41 @@ static struct debug_view zfcp_rec_dbf_view = { NULL }; +/** + * zfcp_rec_dbf_event_thread - trace event related to recovery thread operation + * @id2: identifier for event + * @adapter: adapter + * @lock: non-zero value indicates that erp_lock has not yet been acquired + */ +void zfcp_rec_dbf_event_thread(u8 id2, struct zfcp_adapter *adapter, int lock) +{ + struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf; + unsigned long flags = 0; + struct list_head *entry; + unsigned ready = 0, running = 0, total; + + if (lock) + read_lock_irqsave(&adapter->erp_lock, flags); + list_for_each(entry, &adapter->erp_ready_head) + ready++; + list_for_each(entry, &adapter->erp_running_head) + running++; + total = adapter->erp_total_count; + if (lock) + read_unlock_irqrestore(&adapter->erp_lock, flags); + + spin_lock_irqsave(&adapter->rec_dbf_lock, flags); + memset(r, 0, sizeof(*r)); + r->id = ZFCP_REC_DBF_ID_THREAD; + r->id2 = id2; + r->u.thread.sema = atomic_read(&adapter->erp_ready_sem.count); + r->u.thread.total = total; + r->u.thread.ready = ready; + r->u.thread.running = running; + debug_event(adapter->rec_dbf, 5, r, sizeof(*r)); + spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); +} + static void _zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req, u32 s_id, u32 d_id, void *buffer, int buflen) diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index f29bee52848..332c83eba6c 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -279,13 +279,25 @@ struct zfcp_erp_dbf_record { u8 dummy[16]; } __attribute__ ((packed)); +struct zfcp_rec_dbf_record_thread { + u32 sema; + u32 total; + u32 ready; + u32 running; +} __attribute__ ((packed)); + struct zfcp_rec_dbf_record { u8 id; u8 id2; union { + struct zfcp_rec_dbf_record_thread thread; } u; } __attribute__ ((packed)); +enum { + ZFCP_REC_DBF_ID_THREAD, +}; + struct zfcp_hba_dbf_record_response { u32 fsf_command; u64 fsf_reqid; diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 2dc8110ebf7..f9383f06816 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -788,6 +788,7 @@ zfcp_erp_action_ready(struct zfcp_erp_action *erp_action) zfcp_erp_action_to_ready(erp_action); up(&adapter->erp_ready_sem); + zfcp_rec_dbf_event_thread(2, adapter, 0); } /* @@ -1027,6 +1028,7 @@ zfcp_erp_thread_kill(struct zfcp_adapter *adapter) atomic_set_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL, &adapter->status); up(&adapter->erp_ready_sem); + zfcp_rec_dbf_event_thread(2, adapter, 1); wait_event(adapter->erp_thread_wqh, !atomic_test_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, @@ -1084,7 +1086,9 @@ zfcp_erp_thread(void *data) * no action in 'ready' queue to be processed and * thread is not to be killed */ + zfcp_rec_dbf_event_thread(4, adapter, 1); down_interruptible(&adapter->erp_ready_sem); + zfcp_rec_dbf_event_thread(5, adapter, 1); debug_text_event(adapter->erp_dbf, 5, "a_th_woken"); } @@ -2150,7 +2154,9 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) * _must_ be the one belonging to the 'exchange config * data' request. */ + zfcp_rec_dbf_event_thread(6, adapter, 1); down(&adapter->erp_ready_sem); + zfcp_rec_dbf_event_thread(7, adapter, 1); if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { ZFCP_LOG_INFO("error: exchange of configuration data " "for adapter %s timed out\n", @@ -2207,7 +2213,9 @@ zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action) debug_text_event(adapter->erp_dbf, 6, "a_xport_ok"); ret = ZFCP_ERP_SUCCEEDED; + zfcp_rec_dbf_event_thread(8, adapter, 1); down(&adapter->erp_ready_sem); + zfcp_rec_dbf_event_thread(9, adapter, 1); if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { ZFCP_LOG_INFO("error: exchange port data timed out (adapter " "%s)\n", zfcp_get_busid_by_adapter(adapter)); @@ -3091,6 +3099,7 @@ zfcp_erp_action_enqueue(int action, /* finally put it into 'ready' queue and kick erp thread */ list_add_tail(&erp_action->list, &adapter->erp_ready_head); up(&adapter->erp_ready_sem); + zfcp_rec_dbf_event_thread(1, adapter, 0); retval = 0; out: return retval; diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index 06b1079b7f3..f64951ba98c 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h @@ -164,6 +164,9 @@ extern void zfcp_erp_port_access_changed(struct zfcp_port *); extern void zfcp_erp_unit_access_changed(struct zfcp_unit *); /******************************** AUX ****************************************/ +extern void zfcp_rec_dbf_event_thread(u8 id, struct zfcp_adapter *adapter, + int lock); + extern void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *); extern void zfcp_hba_dbf_event_fsf_unsol(const char *, struct zfcp_adapter *, struct fsf_status_read_buffer *); -- cgit v1.2.3 From 698ec01635819c5ae60090bb4efcbeffc41642fb Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Thu, 27 Mar 2008 14:22:02 +0100 Subject: [SCSI] zfcp: Add traces for state changes. This patch writes a trace record which provides information about state changes for adapters, ports and units, e.g. target failure, targets becoming online, targets being temporarily blocked due to pending recovery, targets which have been recovered successfully etc. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_ccw.c | 6 +- drivers/s390/scsi/zfcp_dbf.c | 126 +++++++++++++++++++++++++++ drivers/s390/scsi/zfcp_def.h | 11 +++ drivers/s390/scsi/zfcp_erp.c | 153 ++++++++++++++++++++------------- drivers/s390/scsi/zfcp_ext.h | 24 +++--- drivers/s390/scsi/zfcp_fsf.c | 70 +++++++-------- drivers/s390/scsi/zfcp_scsi.c | 2 +- drivers/s390/scsi/zfcp_sysfs_adapter.c | 4 +- drivers/s390/scsi/zfcp_sysfs_port.c | 3 +- drivers/s390/scsi/zfcp_sysfs_unit.c | 3 +- 10 files changed, 288 insertions(+), 114 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index edc5015e920..dd40b1c350b 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c @@ -170,8 +170,8 @@ zfcp_ccw_set_online(struct ccw_device *ccw_device) BUG_ON(!zfcp_reqlist_isempty(adapter)); adapter->req_no = 0; - zfcp_erp_modify_adapter_status(adapter, ZFCP_STATUS_COMMON_RUNNING, - ZFCP_SET); + zfcp_erp_modify_adapter_status(adapter, 10, 0, + ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED); zfcp_erp_wait(adapter); goto out; @@ -236,7 +236,7 @@ zfcp_ccw_notify(struct ccw_device *ccw_device, int event) ZFCP_LOG_NORMAL("adapter %s: operational again\n", zfcp_get_busid_by_adapter(adapter)); debug_text_event(adapter->erp_dbf,1,"dev_oper"); - zfcp_erp_modify_adapter_status(adapter, + zfcp_erp_modify_adapter_status(adapter, 11, 0, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); zfcp_erp_adapter_reopen(adapter, diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 5a4b1e9a8b5..2fcfe9bec55 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -522,6 +522,7 @@ static struct debug_view zfcp_hba_dbf_view = { static const char *zfcp_rec_dbf_tags[] = { [ZFCP_REC_DBF_ID_THREAD] = "thread", + [ZFCP_REC_DBF_ID_TARGET] = "target", }; static const char *zfcp_rec_dbf_ids[] = { @@ -534,6 +535,58 @@ static const char *zfcp_rec_dbf_ids[] = { [7] = "down wakeup ecd", [8] = "down sleep epd", [9] = "down wakeup epd", + [10] = "online", + [11] = "operational", + [12] = "scsi slave destroy", + [13] = "propagate failed adapter", + [14] = "propagate failed port", + [15] = "block adapter", + [16] = "unblock adapter", + [17] = "block port", + [18] = "unblock port", + [19] = "block unit", + [20] = "unblock unit", + [21] = "unit recovery failed", + [22] = "port recovery failed", + [23] = "adapter recovery failed", + [24] = "qdio queues down", + [25] = "p2p failed", + [26] = "nameserver lookup failed", + [27] = "nameserver port failed", + [28] = "link up", + [29] = "link down", + [30] = "link up status read", + [31] = "open port failed", + [32] = "open port failed", + [33] = "close port", + [34] = "open unit failed", + [35] = "exclusive open unit failed", + [36] = "shared open unit failed", + [37] = "link down", + [38] = "link down status read no link", + [39] = "link down status read fdisc login", + [40] = "link down status read firmware update", + [41] = "link down status read unknown reason", + [42] = "link down ecd incomplete", + [43] = "link down epd incomplete", + [44] = "sysfs adapter recovery", + [45] = "sysfs port recovery", + [46] = "sysfs unit recovery", + [47] = "port boxed abort", + [48] = "unit boxed abort", + [49] = "port boxed ct", + [50] = "port boxed close physical", + [51] = "port boxed open unit", + [52] = "port boxed close unit", + [53] = "port boxed fcp", + [54] = "unit boxed fcp", + [55] = "port access denied ct", + [56] = "port access denied els", + [57] = "port access denied open port", + [58] = "port access denied close physical", + [59] = "unit access denied open unit", + [60] = "shared unit access denied open unit", + [61] = "unit access denied fcp", }; static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, @@ -552,6 +605,14 @@ static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, zfcp_dbf_out(&p, "ready", "%d", r->u.thread.ready); zfcp_dbf_out(&p, "running", "%d", r->u.thread.running); break; + case ZFCP_REC_DBF_ID_TARGET: + zfcp_dbf_out(&p, "reference", "0x%016Lx", r->u.target.ref); + zfcp_dbf_out(&p, "status", "0x%08x", r->u.target.status); + zfcp_dbf_out(&p, "erp_count", "%d", r->u.target.erp_count); + zfcp_dbf_out(&p, "d_id", "0x%06x", r->u.target.d_id); + zfcp_dbf_out(&p, "wwpn", "0x%016Lx", r->u.target.wwpn); + zfcp_dbf_out(&p, "fcp_lun", "0x%016Lx", r->u.target.fcp_lun); + break; } sprintf(p, "\n"); return (p - buf) + 1; @@ -601,6 +662,71 @@ void zfcp_rec_dbf_event_thread(u8 id2, struct zfcp_adapter *adapter, int lock) spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); } +static void zfcp_rec_dbf_event_target(u8 id2, u64 ref, + struct zfcp_adapter *adapter, + atomic_t *status, atomic_t *erp_count, + u64 wwpn, u32 d_id, u64 fcp_lun) +{ + struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf; + unsigned long flags; + + spin_lock_irqsave(&adapter->rec_dbf_lock, flags); + memset(r, 0, sizeof(*r)); + r->id = ZFCP_REC_DBF_ID_TARGET; + r->id2 = id2; + r->u.target.ref = ref; + r->u.target.status = atomic_read(status); + r->u.target.wwpn = wwpn; + r->u.target.d_id = d_id; + r->u.target.fcp_lun = fcp_lun; + r->u.target.erp_count = atomic_read(erp_count); + debug_event(adapter->rec_dbf, 3, r, sizeof(*r)); + spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); +} + +/** + * zfcp_rec_dbf_event_adapter - trace event for adapter state change + * @id: identifier for trigger of state change + * @ref: additional reference (e.g. request) + * @adapter: adapter + */ +void zfcp_rec_dbf_event_adapter(u8 id, u64 ref, struct zfcp_adapter *adapter) +{ + zfcp_rec_dbf_event_target(id, ref, adapter, &adapter->status, + &adapter->erp_counter, 0, 0, 0); +} + +/** + * zfcp_rec_dbf_event_port - trace event for port state change + * @id: identifier for trigger of state change + * @ref: additional reference (e.g. request) + * @port: port + */ +void zfcp_rec_dbf_event_port(u8 id, u64 ref, struct zfcp_port *port) +{ + struct zfcp_adapter *adapter = port->adapter; + + zfcp_rec_dbf_event_target(id, ref, adapter, &port->status, + &port->erp_counter, port->wwpn, port->d_id, + 0); +} + +/** + * zfcp_rec_dbf_event_unit - trace event for unit state change + * @id: identifier for trigger of state change + * @ref: additional reference (e.g. request) + * @unit: unit + */ +void zfcp_rec_dbf_event_unit(u8 id, u64 ref, struct zfcp_unit *unit) +{ + struct zfcp_port *port = unit->port; + struct zfcp_adapter *adapter = port->adapter; + + zfcp_rec_dbf_event_target(id, ref, adapter, &unit->status, + &unit->erp_counter, port->wwpn, port->d_id, + unit->fcp_lun); +} + static void _zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req, u32 s_id, u32 d_id, void *buffer, int buflen) diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 332c83eba6c..659ec739706 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -286,16 +286,27 @@ struct zfcp_rec_dbf_record_thread { u32 running; } __attribute__ ((packed)); +struct zfcp_rec_dbf_record_target { + u64 ref; + u32 status; + u32 d_id; + u64 wwpn; + u64 fcp_lun; + u32 erp_count; +} __attribute__ ((packed)); + struct zfcp_rec_dbf_record { u8 id; u8 id2; union { struct zfcp_rec_dbf_record_thread thread; + struct zfcp_rec_dbf_record_target target; } u; } __attribute__ ((packed)); enum { ZFCP_REC_DBF_ID_THREAD, + ZFCP_REC_DBF_ID_TARGET, }; struct zfcp_hba_dbf_record_response { diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index f9383f06816..bee03443efd 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -163,7 +163,7 @@ static void zfcp_close_fsf(struct zfcp_adapter *adapter) /* reset FSF request sequence number */ adapter->fsf_req_seq_no = 0; /* all ports and units are closed */ - zfcp_erp_modify_adapter_status(adapter, + zfcp_erp_modify_adapter_status(adapter, 24, 0, ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); } @@ -216,7 +216,7 @@ zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter, int clear_mask) zfcp_get_busid_by_adapter(adapter)); debug_text_event(adapter->erp_dbf, 5, "a_ro_f"); /* ensure propagation of failed status to new devices */ - zfcp_erp_adapter_failed(adapter); + zfcp_erp_adapter_failed(adapter, 13, 0); retval = -EIO; goto out; } @@ -572,7 +572,7 @@ zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask) debug_text_event(adapter->erp_dbf, 5, "p_ro_f"); debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); /* ensure propagation of failed status to new devices */ - zfcp_erp_port_failed(port); + zfcp_erp_port_failed(port, 14, 0); retval = -EIO; goto out; } @@ -688,18 +688,44 @@ zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear_mask) static void zfcp_erp_adapter_block(struct zfcp_adapter *adapter, int clear_mask) { debug_text_event(adapter->erp_dbf, 6, "a_bl"); - zfcp_erp_modify_adapter_status(adapter, + zfcp_erp_modify_adapter_status(adapter, 15, 0, ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, ZFCP_CLEAR); } +/* FIXME: isn't really atomic */ +/* + * returns the mask which has not been set so far, i.e. + * 0 if no bit has been changed, !0 if some bit has been changed + */ +static int atomic_test_and_set_mask(unsigned long mask, atomic_t *v) +{ + int changed_bits = (atomic_read(v) /*XOR*/^ mask) & mask; + atomic_set_mask(mask, v); + return changed_bits; +} + +/* FIXME: isn't really atomic */ +/* + * returns the mask which has not been cleared so far, i.e. + * 0 if no bit has been changed, !0 if some bit has been changed + */ +static int atomic_test_and_clear_mask(unsigned long mask, atomic_t *v) +{ + int changed_bits = atomic_read(v) & mask; + atomic_clear_mask(mask, v); + return changed_bits; +} + /** * zfcp_erp_adapter_unblock - mark adapter as unblocked, allow scsi requests */ static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter) { debug_text_event(adapter->erp_dbf, 6, "a_ubl"); - atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status); + if (atomic_test_and_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, + &adapter->status)) + zfcp_rec_dbf_event_adapter(16, 0, adapter); } /* @@ -718,7 +744,7 @@ zfcp_erp_port_block(struct zfcp_port *port, int clear_mask) debug_text_event(adapter->erp_dbf, 6, "p_bl"); debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t)); - zfcp_erp_modify_port_status(port, + zfcp_erp_modify_port_status(port, 17, 0, ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, ZFCP_CLEAR); } @@ -737,7 +763,9 @@ zfcp_erp_port_unblock(struct zfcp_port *port) debug_text_event(adapter->erp_dbf, 6, "p_ubl"); debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t)); - atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status); + if (atomic_test_and_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, + &port->status)) + zfcp_rec_dbf_event_port(18, 0, port); } /* @@ -756,7 +784,7 @@ zfcp_erp_unit_block(struct zfcp_unit *unit, int clear_mask) debug_text_event(adapter->erp_dbf, 6, "u_bl"); debug_event(adapter->erp_dbf, 6, &unit->fcp_lun, sizeof (fcp_lun_t)); - zfcp_erp_modify_unit_status(unit, + zfcp_erp_modify_unit_status(unit, 19, 0, ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, ZFCP_CLEAR); } @@ -775,7 +803,9 @@ zfcp_erp_unit_unblock(struct zfcp_unit *unit) debug_text_event(adapter->erp_dbf, 6, "u_ubl"); debug_event(adapter->erp_dbf, 6, &unit->fcp_lun, sizeof (fcp_lun_t)); - atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status); + if (atomic_test_and_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, + &unit->status)) + zfcp_rec_dbf_event_unit(20, 0, unit); } static void @@ -1357,9 +1387,9 @@ zfcp_erp_strategy_memwait(struct zfcp_erp_action *erp_action) * */ void -zfcp_erp_adapter_failed(struct zfcp_adapter *adapter) +zfcp_erp_adapter_failed(struct zfcp_adapter *adapter, u8 id, u64 ref) { - zfcp_erp_modify_adapter_status(adapter, + zfcp_erp_modify_adapter_status(adapter, id, ref, ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); ZFCP_LOG_NORMAL("adapter erp failed on adapter %s\n", zfcp_get_busid_by_adapter(adapter)); @@ -1373,9 +1403,9 @@ zfcp_erp_adapter_failed(struct zfcp_adapter *adapter) * */ void -zfcp_erp_port_failed(struct zfcp_port *port) +zfcp_erp_port_failed(struct zfcp_port *port, u8 id, u64 ref) { - zfcp_erp_modify_port_status(port, + zfcp_erp_modify_port_status(port, id, ref, ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); if (atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status)) @@ -1397,9 +1427,9 @@ zfcp_erp_port_failed(struct zfcp_port *port) * */ void -zfcp_erp_unit_failed(struct zfcp_unit *unit) +zfcp_erp_unit_failed(struct zfcp_unit *unit, u8 id, u64 ref) { - zfcp_erp_modify_unit_status(unit, + zfcp_erp_modify_unit_status(unit, id, ref, ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); ZFCP_LOG_NORMAL("unit erp failed on unit 0x%016Lx on port 0x%016Lx " @@ -1522,7 +1552,7 @@ zfcp_erp_strategy_check_unit(struct zfcp_unit *unit, int result) case ZFCP_ERP_FAILED : atomic_inc(&unit->erp_counter); if (atomic_read(&unit->erp_counter) > ZFCP_MAX_ERPS) - zfcp_erp_unit_failed(unit); + zfcp_erp_unit_failed(unit, 21, 0); break; case ZFCP_ERP_EXIT : /* nothing */ @@ -1551,7 +1581,7 @@ zfcp_erp_strategy_check_port(struct zfcp_port *port, int result) case ZFCP_ERP_FAILED : atomic_inc(&port->erp_counter); if (atomic_read(&port->erp_counter) > ZFCP_MAX_ERPS) - zfcp_erp_port_failed(port); + zfcp_erp_port_failed(port, 22, 0); break; case ZFCP_ERP_EXIT : /* nothing */ @@ -1579,7 +1609,7 @@ zfcp_erp_strategy_check_adapter(struct zfcp_adapter *adapter, int result) case ZFCP_ERP_FAILED : atomic_inc(&adapter->erp_counter); if (atomic_read(&adapter->erp_counter) > ZFCP_MAX_ERPS) - zfcp_erp_adapter_failed(adapter); + zfcp_erp_adapter_failed(adapter, 23, 0); break; case ZFCP_ERP_EXIT : /* nothing */ @@ -1737,29 +1767,30 @@ zfcp_erp_wait(struct zfcp_adapter *adapter) return retval; } -void -zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, - u32 mask, int set_or_clear) +void zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, u8 id, + u64 ref, u32 mask, int set_or_clear) { struct zfcp_port *port; - u32 common_mask = mask & ZFCP_COMMON_FLAGS; + u32 changed, common_mask = mask & ZFCP_COMMON_FLAGS; if (set_or_clear == ZFCP_SET) { - atomic_set_mask(mask, &adapter->status); + changed = atomic_test_and_set_mask(mask, &adapter->status); debug_text_event(adapter->erp_dbf, 3, "a_mod_as_s"); } else { - atomic_clear_mask(mask, &adapter->status); + changed = atomic_test_and_clear_mask(mask, &adapter->status); if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) atomic_set(&adapter->erp_counter, 0); debug_text_event(adapter->erp_dbf, 3, "a_mod_as_c"); } + if (changed) + zfcp_rec_dbf_event_adapter(id, ref, adapter); debug_event(adapter->erp_dbf, 3, &mask, sizeof (u32)); /* Deal with all underlying devices, only pass common_mask */ if (common_mask) list_for_each_entry(port, &adapter->port_list_head, list) - zfcp_erp_modify_port_status(port, common_mask, - set_or_clear); + zfcp_erp_modify_port_status(port, id, ref, common_mask, + set_or_clear); } /* @@ -1768,29 +1799,31 @@ zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, * purpose: sets the port and all underlying devices to ERP_FAILED * */ -void -zfcp_erp_modify_port_status(struct zfcp_port *port, u32 mask, int set_or_clear) +void zfcp_erp_modify_port_status(struct zfcp_port *port, u8 id, u64 ref, + u32 mask, int set_or_clear) { struct zfcp_unit *unit; - u32 common_mask = mask & ZFCP_COMMON_FLAGS; + u32 changed, common_mask = mask & ZFCP_COMMON_FLAGS; if (set_or_clear == ZFCP_SET) { - atomic_set_mask(mask, &port->status); + changed = atomic_test_and_set_mask(mask, &port->status); debug_text_event(port->adapter->erp_dbf, 3, "p_mod_ps_s"); } else { - atomic_clear_mask(mask, &port->status); + changed = atomic_test_and_clear_mask(mask, &port->status); if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) atomic_set(&port->erp_counter, 0); debug_text_event(port->adapter->erp_dbf, 3, "p_mod_ps_c"); } + if (changed) + zfcp_rec_dbf_event_port(id, ref, port); debug_event(port->adapter->erp_dbf, 3, &port->wwpn, sizeof (wwn_t)); debug_event(port->adapter->erp_dbf, 3, &mask, sizeof (u32)); /* Modify status of all underlying devices, only pass common mask */ if (common_mask) list_for_each_entry(unit, &port->unit_list_head, list) - zfcp_erp_modify_unit_status(unit, common_mask, - set_or_clear); + zfcp_erp_modify_unit_status(unit, id, ref, common_mask, + set_or_clear); } /* @@ -1799,19 +1832,23 @@ zfcp_erp_modify_port_status(struct zfcp_port *port, u32 mask, int set_or_clear) * purpose: sets the unit to ERP_FAILED * */ -void -zfcp_erp_modify_unit_status(struct zfcp_unit *unit, u32 mask, int set_or_clear) +void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, u8 id, u64 ref, + u32 mask, int set_or_clear) { + u32 changed; + if (set_or_clear == ZFCP_SET) { - atomic_set_mask(mask, &unit->status); + changed = atomic_test_and_set_mask(mask, &unit->status); debug_text_event(unit->port->adapter->erp_dbf, 3, "u_mod_us_s"); } else { - atomic_clear_mask(mask, &unit->status); + changed = atomic_test_and_clear_mask(mask, &unit->status); if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) { atomic_set(&unit->erp_counter, 0); } debug_text_event(unit->port->adapter->erp_dbf, 3, "u_mod_us_c"); } + if (changed) + zfcp_rec_dbf_event_unit(id, ref, unit); debug_event(unit->port->adapter->erp_dbf, 3, &unit->fcp_lun, sizeof (fcp_lun_t)); debug_event(unit->port->adapter->erp_dbf, 3, &mask, sizeof (u32)); @@ -2403,7 +2440,7 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) port->wwpn, zfcp_get_busid_by_adapter(adapter), adapter->peer_wwpn); - zfcp_erp_port_failed(port); + zfcp_erp_port_failed(port, 25, 0); retval = ZFCP_ERP_FAILED; break; } @@ -2461,7 +2498,7 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) "for port 0x%016Lx " "(misconfigured WWPN?)\n", port->wwpn); - zfcp_erp_port_failed(port); + zfcp_erp_port_failed(port, 26, 0); retval = ZFCP_ERP_EXIT; } else { ZFCP_LOG_DEBUG("nameserver look-up failed for " @@ -2567,7 +2604,7 @@ zfcp_erp_port_strategy_open_nameserver_wakeup(struct zfcp_erp_action if (atomic_test_mask( ZFCP_STATUS_COMMON_ERP_FAILED, &adapter->nameserver_port->status)) - zfcp_erp_port_failed(erp_action->port); + zfcp_erp_port_failed(erp_action->port, 27, 0); zfcp_erp_action_ready(erp_action); } } @@ -3274,8 +3311,7 @@ static void zfcp_erp_action_to_ready(struct zfcp_erp_action *erp_action) list_move(&erp_action->list, &erp_action->adapter->erp_ready_head); } -void -zfcp_erp_port_boxed(struct zfcp_port *port) +void zfcp_erp_port_boxed(struct zfcp_port *port, u8 id, u64 ref) { struct zfcp_adapter *adapter = port->adapter; unsigned long flags; @@ -3283,28 +3319,24 @@ zfcp_erp_port_boxed(struct zfcp_port *port) debug_text_event(adapter->erp_dbf, 3, "p_access_boxed"); debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); read_lock_irqsave(&zfcp_data.config_lock, flags); - zfcp_erp_modify_port_status(port, - ZFCP_STATUS_COMMON_ACCESS_BOXED, - ZFCP_SET); + zfcp_erp_modify_port_status(port, id, ref, + ZFCP_STATUS_COMMON_ACCESS_BOXED, ZFCP_SET); read_unlock_irqrestore(&zfcp_data.config_lock, flags); zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED); } -void -zfcp_erp_unit_boxed(struct zfcp_unit *unit) +void zfcp_erp_unit_boxed(struct zfcp_unit *unit, u8 id, u64 ref) { struct zfcp_adapter *adapter = unit->port->adapter; debug_text_event(adapter->erp_dbf, 3, "u_access_boxed"); debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); - zfcp_erp_modify_unit_status(unit, - ZFCP_STATUS_COMMON_ACCESS_BOXED, - ZFCP_SET); + zfcp_erp_modify_unit_status(unit, id, ref, + ZFCP_STATUS_COMMON_ACCESS_BOXED, ZFCP_SET); zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED); } -void -zfcp_erp_port_access_denied(struct zfcp_port *port) +void zfcp_erp_port_access_denied(struct zfcp_port *port, u8 id, u64 ref) { struct zfcp_adapter *adapter = port->adapter; unsigned long flags; @@ -3312,24 +3344,21 @@ zfcp_erp_port_access_denied(struct zfcp_port *port) debug_text_event(adapter->erp_dbf, 3, "p_access_denied"); debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); read_lock_irqsave(&zfcp_data.config_lock, flags); - zfcp_erp_modify_port_status(port, - ZFCP_STATUS_COMMON_ERP_FAILED | - ZFCP_STATUS_COMMON_ACCESS_DENIED, - ZFCP_SET); + zfcp_erp_modify_port_status(port, id, ref, + ZFCP_STATUS_COMMON_ERP_FAILED | + ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); read_unlock_irqrestore(&zfcp_data.config_lock, flags); } -void -zfcp_erp_unit_access_denied(struct zfcp_unit *unit) +void zfcp_erp_unit_access_denied(struct zfcp_unit *unit, u8 id, u64 ref) { struct zfcp_adapter *adapter = unit->port->adapter; debug_text_event(adapter->erp_dbf, 3, "u_access_denied"); debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); - zfcp_erp_modify_unit_status(unit, - ZFCP_STATUS_COMMON_ERP_FAILED | - ZFCP_STATUS_COMMON_ACCESS_DENIED, - ZFCP_SET); + zfcp_erp_modify_unit_status(unit, id, ref, + ZFCP_STATUS_COMMON_ERP_FAILED | + ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); } void diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index f64951ba98c..20ad6fde2e2 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h @@ -131,22 +131,23 @@ extern int zfcp_scsi_command_sync(struct zfcp_unit *, struct scsi_cmnd *, int); extern struct fc_function_template zfcp_transport_functions; /******************************** ERP ****************************************/ -extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, u32, int); +extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, u8, u64, u32, + int); extern int zfcp_erp_adapter_reopen(struct zfcp_adapter *, int); extern int zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int); -extern void zfcp_erp_adapter_failed(struct zfcp_adapter *); +extern void zfcp_erp_adapter_failed(struct zfcp_adapter *, u8, u64); -extern void zfcp_erp_modify_port_status(struct zfcp_port *, u32, int); +extern void zfcp_erp_modify_port_status(struct zfcp_port *, u8, u64, u32, int); extern int zfcp_erp_port_reopen(struct zfcp_port *, int); extern int zfcp_erp_port_shutdown(struct zfcp_port *, int); extern int zfcp_erp_port_forced_reopen(struct zfcp_port *, int); -extern void zfcp_erp_port_failed(struct zfcp_port *); +extern void zfcp_erp_port_failed(struct zfcp_port *, u8, u64); extern int zfcp_erp_port_reopen_all(struct zfcp_adapter *, int); -extern void zfcp_erp_modify_unit_status(struct zfcp_unit *, u32, int); +extern void zfcp_erp_modify_unit_status(struct zfcp_unit *, u8, u64, u32, int); extern int zfcp_erp_unit_reopen(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 *, u8, u64); extern int zfcp_erp_thread_setup(struct zfcp_adapter *); extern int zfcp_erp_thread_kill(struct zfcp_adapter *); @@ -155,10 +156,10 @@ extern void zfcp_erp_async_handler(struct zfcp_erp_action *, unsigned long); extern int zfcp_test_link(struct zfcp_port *); -extern void zfcp_erp_port_boxed(struct zfcp_port *); -extern void zfcp_erp_unit_boxed(struct zfcp_unit *); -extern void zfcp_erp_port_access_denied(struct zfcp_port *); -extern void zfcp_erp_unit_access_denied(struct zfcp_unit *); +extern void zfcp_erp_port_boxed(struct zfcp_port *, u8 id, u64 ref); +extern void zfcp_erp_unit_boxed(struct zfcp_unit *, u8 id, u64 ref); +extern void zfcp_erp_port_access_denied(struct zfcp_port *, u8 id, u64 ref); +extern void zfcp_erp_unit_access_denied(struct zfcp_unit *, u8 id, u64 ref); extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *); extern void zfcp_erp_port_access_changed(struct zfcp_port *); extern void zfcp_erp_unit_access_changed(struct zfcp_unit *); @@ -166,6 +167,9 @@ extern void zfcp_erp_unit_access_changed(struct zfcp_unit *); /******************************** AUX ****************************************/ extern void zfcp_rec_dbf_event_thread(u8 id, struct zfcp_adapter *adapter, int lock); +extern void zfcp_rec_dbf_event_adapter(u8 id, u64 ref, struct zfcp_adapter *); +extern void zfcp_rec_dbf_event_port(u8 id, u64 ref, struct zfcp_port *port); +extern void zfcp_rec_dbf_event_unit(u8 id, u64 ref, struct zfcp_unit *unit); extern void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *); extern void zfcp_hba_dbf_event_fsf_unsol(const char *, struct zfcp_adapter *, diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 264f5f1bdde..2b7ddb78767 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -46,7 +46,7 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *); static int zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *); static int zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *); static int zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *); -static void zfcp_fsf_link_down_info_eval(struct zfcp_adapter *, +static void zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *, u8, struct fsf_link_down_info *); static int zfcp_fsf_req_dispatch(struct zfcp_fsf_req *); @@ -342,7 +342,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) break; case FSF_PROT_LINK_DOWN: - zfcp_fsf_link_down_info_eval(adapter, + zfcp_fsf_link_down_info_eval(fsf_req, 37, &prot_status_qual->link_down_info); zfcp_erp_adapter_reopen(adapter, 0); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -354,8 +354,8 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) "Re-starting operations on this adapter.\n", zfcp_get_busid_by_adapter(adapter)); /* All ports should be marked as ready to run again */ - zfcp_erp_modify_adapter_status(adapter, - ZFCP_STATUS_COMMON_RUNNING, + zfcp_erp_modify_adapter_status(adapter, 28, + 0, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED @@ -506,9 +506,11 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req) * zfcp_fsf_link_down_info_eval - evaluate link down information block */ static void -zfcp_fsf_link_down_info_eval(struct zfcp_adapter *adapter, +zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *fsf_req, u8 id, struct fsf_link_down_info *link_down) { + struct zfcp_adapter *adapter = fsf_req->adapter; + if (atomic_test_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status)) return; @@ -599,7 +601,7 @@ zfcp_fsf_link_down_info_eval(struct zfcp_adapter *adapter, link_down->vendor_specific_code); out: - zfcp_erp_adapter_failed(adapter); + zfcp_erp_adapter_failed(adapter, id, (u64)fsf_req); } /* @@ -897,7 +899,7 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) case FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK: ZFCP_LOG_INFO("Physical link to adapter %s is down\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_fsf_link_down_info_eval(adapter, + zfcp_fsf_link_down_info_eval(fsf_req, 38, (struct fsf_link_down_info *) &status_buffer->payload); break; @@ -905,7 +907,7 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_INFO("Local link to adapter %s is down " "due to failed FDISC login\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_fsf_link_down_info_eval(adapter, + zfcp_fsf_link_down_info_eval(fsf_req, 39, (struct fsf_link_down_info *) &status_buffer->payload); break; @@ -913,13 +915,13 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_INFO("Local link to adapter %s is down " "due to firmware update on adapter\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_fsf_link_down_info_eval(adapter, NULL); + zfcp_fsf_link_down_info_eval(fsf_req, 40, NULL); break; default: ZFCP_LOG_INFO("Local link to adapter %s is down " "due to unknown reason\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_fsf_link_down_info_eval(adapter, NULL); + zfcp_fsf_link_down_info_eval(fsf_req, 41, NULL); }; break; @@ -928,7 +930,7 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) "Restarting operations on this adapter\n", zfcp_get_busid_by_adapter(adapter)); /* All ports should be marked as ready to run again */ - zfcp_erp_modify_adapter_status(adapter, + zfcp_erp_modify_adapter_status(adapter, 30, 0, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); zfcp_erp_adapter_reopen(adapter, @@ -1215,7 +1217,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) zfcp_get_busid_by_unit(unit)); debug_text_event(new_fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); - zfcp_erp_port_boxed(unit->port); + zfcp_erp_port_boxed(unit->port, 47, (u64)new_fsf_req); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -1227,7 +1229,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) unit->fcp_lun, unit->port->wwpn, zfcp_get_busid_by_unit(unit)); debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); - zfcp_erp_unit_boxed(unit); + zfcp_erp_unit_boxed(unit, 48, (u64)new_fsf_req); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -1519,7 +1521,7 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) } } debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); - zfcp_erp_port_access_denied(port); + zfcp_erp_port_access_denied(port, 55, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -1554,7 +1556,7 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) "(adapter %s, port d_id=0x%06x)\n", zfcp_get_busid_by_port(port), port->d_id); debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); - zfcp_erp_port_boxed(port); + zfcp_erp_port_boxed(port, 49, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -1880,7 +1882,7 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) } debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); if (port != NULL) - zfcp_erp_port_access_denied(port); + zfcp_erp_port_access_denied(port, 56, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2210,7 +2212,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) atomic_set_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, &adapter->status); - zfcp_fsf_link_down_info_eval(adapter, + zfcp_fsf_link_down_info_eval(fsf_req, 42, &qtcb->header.fsf_status_qual.link_down_info); break; default: @@ -2393,7 +2395,7 @@ zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req) case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: zfcp_fsf_exchange_port_evaluate(fsf_req, 0); atomic_set_mask(ZFCP_STATUS_ADAPTER_XPORT_OK, &adapter->status); - zfcp_fsf_link_down_info_eval(adapter, + zfcp_fsf_link_down_info_eval(fsf_req, 43, &qtcb->header.fsf_status_qual.link_down_info); break; default: @@ -2523,7 +2525,7 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) } } debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_access"); - zfcp_erp_port_access_denied(port); + zfcp_erp_port_access_denied(port, 57, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2534,7 +2536,7 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) port->wwpn, zfcp_get_busid_by_port(port)); debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_max_ports"); - zfcp_erp_port_failed(port); + zfcp_erp_port_failed(port, 31, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2560,7 +2562,7 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_port(port)); debug_text_exception(fsf_req->adapter->erp_dbf, 0, "fsf_sq_no_retry"); - zfcp_erp_port_failed(port); + zfcp_erp_port_failed(port, 32, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; default: @@ -2773,7 +2775,7 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_TRACE("remote port 0x016%Lx on adapter %s closed, " "port handle 0x%x\n", port->wwpn, zfcp_get_busid_by_port(port), port->handle); - zfcp_erp_modify_port_status(port, + zfcp_erp_modify_port_status(port, 33, (u64)fsf_req, ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); retval = 0; @@ -2923,7 +2925,7 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) } } debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_access"); - zfcp_erp_port_access_denied(port); + zfcp_erp_port_access_denied(port, 58, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2934,7 +2936,7 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) port->wwpn, zfcp_get_busid_by_port(port)); debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_pboxed"); - zfcp_erp_port_boxed(port); + zfcp_erp_port_boxed(port, 50, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; @@ -3159,7 +3161,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) } } debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); - zfcp_erp_unit_access_denied(unit); + zfcp_erp_unit_access_denied(unit, 59, (u64)fsf_req); atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status); atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -3170,7 +3172,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) "needs to be reopened\n", unit->port->wwpn, zfcp_get_busid_by_unit(unit)); debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); - zfcp_erp_port_boxed(unit->port); + zfcp_erp_port_boxed(unit->port, 51, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -3212,7 +3214,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) sizeof (union fsf_status_qual)); debug_text_event(adapter->erp_dbf, 2, "fsf_s_l_sh_vio"); - zfcp_erp_unit_access_denied(unit); + zfcp_erp_unit_access_denied(unit, 60, (u64)fsf_req); atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status); atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -3228,7 +3230,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_unit(unit)); debug_text_event(adapter->erp_dbf, 1, "fsf_s_max_units"); - zfcp_erp_unit_failed(unit); + zfcp_erp_unit_failed(unit, 34, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3307,13 +3309,13 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) if (exclusive && !readwrite) { ZFCP_LOG_NORMAL("exclusive access of read-only " "unit not supported\n"); - zfcp_erp_unit_failed(unit); + zfcp_erp_unit_failed(unit, 35, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; zfcp_erp_unit_shutdown(unit, 0); } else if (!exclusive && readwrite) { ZFCP_LOG_NORMAL("shared access of read-write " "unit not supported\n"); - zfcp_erp_unit_failed(unit); + zfcp_erp_unit_failed(unit, 36, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; zfcp_erp_unit_shutdown(unit, 0); } @@ -3471,7 +3473,7 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) unit->port->wwpn, zfcp_get_busid_by_unit(unit)); debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); - zfcp_erp_port_boxed(unit->port); + zfcp_erp_port_boxed(unit->port, 52, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -3928,7 +3930,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) } } debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_access"); - zfcp_erp_unit_access_denied(unit); + zfcp_erp_unit_access_denied(unit, 61, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3967,7 +3969,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) "needs to be reopened\n", unit->port->wwpn, zfcp_get_busid_by_unit(unit)); debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); - zfcp_erp_port_boxed(unit->port); + zfcp_erp_port_boxed(unit->port, 53, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -3978,7 +3980,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_unit(unit), unit->port->wwpn, unit->fcp_lun); debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); - zfcp_erp_unit_boxed(unit); + zfcp_erp_unit_boxed(unit, 54, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index ff97a61ad96..1198f0b27e3 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -185,7 +185,7 @@ static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status); sdpnt->hostdata = NULL; unit->device = NULL; - zfcp_erp_unit_failed(unit); + zfcp_erp_unit_failed(unit, 12, 0); zfcp_unit_put(unit); } else ZFCP_LOG_NORMAL("bug: no unit associated with SCSI device at " diff --git a/drivers/s390/scsi/zfcp_sysfs_adapter.c b/drivers/s390/scsi/zfcp_sysfs_adapter.c index 705c6d4428f..ec340530c82 100644 --- a/drivers/s390/scsi/zfcp_sysfs_adapter.c +++ b/drivers/s390/scsi/zfcp_sysfs_adapter.c @@ -191,8 +191,8 @@ zfcp_sysfs_adapter_failed_store(struct device *dev, struct device_attribute *att goto out; } - zfcp_erp_modify_adapter_status(adapter, ZFCP_STATUS_COMMON_RUNNING, - ZFCP_SET); + zfcp_erp_modify_adapter_status(adapter, 44, 0, + ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED); zfcp_erp_wait(adapter); out: diff --git a/drivers/s390/scsi/zfcp_sysfs_port.c b/drivers/s390/scsi/zfcp_sysfs_port.c index 1320c059143..9cc2bc5be72 100644 --- a/drivers/s390/scsi/zfcp_sysfs_port.c +++ b/drivers/s390/scsi/zfcp_sysfs_port.c @@ -193,7 +193,8 @@ zfcp_sysfs_port_failed_store(struct device *dev, struct device_attribute *attr, goto out; } - zfcp_erp_modify_port_status(port, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); + zfcp_erp_modify_port_status(port, 45, 0, + ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED); zfcp_erp_wait(port->adapter); out: diff --git a/drivers/s390/scsi/zfcp_sysfs_unit.c b/drivers/s390/scsi/zfcp_sysfs_unit.c index 63f75ee95c3..52a5f6a25ff 100644 --- a/drivers/s390/scsi/zfcp_sysfs_unit.c +++ b/drivers/s390/scsi/zfcp_sysfs_unit.c @@ -94,7 +94,8 @@ zfcp_sysfs_unit_failed_store(struct device *dev, struct device_attribute *attr, goto out; } - zfcp_erp_modify_unit_status(unit, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); + zfcp_erp_modify_unit_status(unit, 46, 0, + ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED); zfcp_erp_wait(unit->port->adapter); out: -- cgit v1.2.3 From 9467a9b3efdd9041202f71cc270bda827a7ec777 Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Thu, 27 Mar 2008 14:22:03 +0100 Subject: [SCSI] zfcp: Trace all triggers of error recovery activity This patch allows any recovery event to be traced back to an exact cause, e.g. a particular request identified by an id (address). Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_aux.c | 31 ++--- drivers/s390/scsi/zfcp_ccw.c | 12 +- drivers/s390/scsi/zfcp_dbf.c | 134 +++++++++++++++++++++ drivers/s390/scsi/zfcp_def.h | 14 +++ drivers/s390/scsi/zfcp_erp.c | 213 +++++++++++++++++---------------- drivers/s390/scsi/zfcp_ext.h | 25 ++-- drivers/s390/scsi/zfcp_fsf.c | 103 +++++++++------- drivers/s390/scsi/zfcp_qdio.c | 4 +- drivers/s390/scsi/zfcp_scsi.c | 2 +- drivers/s390/scsi/zfcp_sysfs_adapter.c | 6 +- drivers/s390/scsi/zfcp_sysfs_port.c | 6 +- drivers/s390/scsi/zfcp_sysfs_unit.c | 2 +- 12 files changed, 362 insertions(+), 190 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index f3eff7ebcb6..d2a744200c9 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -1326,10 +1326,10 @@ zfcp_nameserver_enqueue(struct zfcp_adapter *adapter) #define ZFCP_LOG_AREA ZFCP_LOG_AREA_FC -static void -zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter, - struct fsf_status_read_buffer *status_buffer) +static void zfcp_fsf_incoming_els_rscn(struct zfcp_fsf_req *fsf_req) { + struct fsf_status_read_buffer *status_buffer = (void*)fsf_req->data; + struct zfcp_adapter *adapter = fsf_req->adapter; struct fcp_rscn_head *fcp_rscn_head; struct fcp_rscn_element *fcp_rscn_element; struct zfcp_port *port; @@ -1376,7 +1376,8 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter, ZFCP_LOG_INFO("incoming RSCN, trying to open " "port 0x%016Lx\n", port->wwpn); zfcp_erp_port_reopen(port, - ZFCP_STATUS_COMMON_ERP_FAILED); + ZFCP_STATUS_COMMON_ERP_FAILED, + 82, (u64)fsf_req); continue; } @@ -1407,10 +1408,10 @@ zfcp_fsf_incoming_els_rscn(struct zfcp_adapter *adapter, } } -static void -zfcp_fsf_incoming_els_plogi(struct zfcp_adapter *adapter, - struct fsf_status_read_buffer *status_buffer) +static void zfcp_fsf_incoming_els_plogi(struct zfcp_fsf_req *fsf_req) { + struct fsf_status_read_buffer *status_buffer = (void*)fsf_req->data; + struct zfcp_adapter *adapter = fsf_req->adapter; struct fsf_plogi *els_plogi; struct zfcp_port *port; unsigned long flags; @@ -1429,14 +1430,14 @@ zfcp_fsf_incoming_els_plogi(struct zfcp_adapter *adapter, status_buffer->d_id, zfcp_get_busid_by_adapter(adapter)); } else { - zfcp_erp_port_forced_reopen(port, 0); + zfcp_erp_port_forced_reopen(port, 0, 83, (u64)fsf_req); } } -static void -zfcp_fsf_incoming_els_logo(struct zfcp_adapter *adapter, - struct fsf_status_read_buffer *status_buffer) +static void zfcp_fsf_incoming_els_logo(struct zfcp_fsf_req *fsf_req) { + struct fsf_status_read_buffer *status_buffer = (void*)fsf_req->data; + struct zfcp_adapter *adapter = fsf_req->adapter; struct fcp_logo *els_logo = (struct fcp_logo *) status_buffer->payload; struct zfcp_port *port; unsigned long flags; @@ -1454,7 +1455,7 @@ zfcp_fsf_incoming_els_logo(struct zfcp_adapter *adapter, status_buffer->d_id, zfcp_get_busid_by_adapter(adapter)); } else { - zfcp_erp_port_forced_reopen(port, 0); + zfcp_erp_port_forced_reopen(port, 0, 84, (u64)fsf_req); } } @@ -1481,12 +1482,12 @@ zfcp_fsf_incoming_els(struct zfcp_fsf_req *fsf_req) zfcp_san_dbf_event_incoming_els(fsf_req); if (els_type == LS_PLOGI) - zfcp_fsf_incoming_els_plogi(adapter, status_buffer); + zfcp_fsf_incoming_els_plogi(fsf_req); else if (els_type == LS_LOGO) - zfcp_fsf_incoming_els_logo(adapter, status_buffer); + zfcp_fsf_incoming_els_logo(fsf_req); else if ((els_type & 0xffff0000) == LS_RSCN) /* we are only concerned with the command, not the length */ - zfcp_fsf_incoming_els_rscn(adapter, status_buffer); + zfcp_fsf_incoming_els_rscn(fsf_req); else zfcp_fsf_incoming_els_unknown(adapter, status_buffer); } diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index dd40b1c350b..8edd90583cd 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c @@ -172,7 +172,7 @@ zfcp_ccw_set_online(struct ccw_device *ccw_device) zfcp_erp_modify_adapter_status(adapter, 10, 0, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); - zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED); + zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 85, 0); zfcp_erp_wait(adapter); goto out; @@ -197,7 +197,7 @@ zfcp_ccw_set_offline(struct ccw_device *ccw_device) down(&zfcp_data.config_sema); adapter = dev_get_drvdata(&ccw_device->dev); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 86, 0); zfcp_erp_wait(adapter); zfcp_erp_thread_kill(adapter); up(&zfcp_data.config_sema); @@ -224,13 +224,13 @@ zfcp_ccw_notify(struct ccw_device *ccw_device, int event) ZFCP_LOG_NORMAL("adapter %s: device gone\n", zfcp_get_busid_by_adapter(adapter)); debug_text_event(adapter->erp_dbf,1,"dev_gone"); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 87, 0); break; case CIO_NO_PATH: ZFCP_LOG_NORMAL("adapter %s: no path\n", zfcp_get_busid_by_adapter(adapter)); debug_text_event(adapter->erp_dbf,1,"no_path"); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 88, 0); break; case CIO_OPER: ZFCP_LOG_NORMAL("adapter %s: operational again\n", @@ -240,7 +240,7 @@ zfcp_ccw_notify(struct ccw_device *ccw_device, int event) ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); zfcp_erp_adapter_reopen(adapter, - ZFCP_STATUS_COMMON_ERP_FAILED); + ZFCP_STATUS_COMMON_ERP_FAILED, 89, 0); break; } zfcp_erp_wait(adapter); @@ -272,7 +272,7 @@ zfcp_ccw_shutdown(struct ccw_device *cdev) down(&zfcp_data.config_sema); adapter = dev_get_drvdata(&cdev->dev); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 90, 0); zfcp_erp_wait(adapter); up(&zfcp_data.config_sema); } diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 2fcfe9bec55..f207b0bd0ca 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -523,6 +523,7 @@ static struct debug_view zfcp_hba_dbf_view = { static const char *zfcp_rec_dbf_tags[] = { [ZFCP_REC_DBF_ID_THREAD] = "thread", [ZFCP_REC_DBF_ID_TARGET] = "target", + [ZFCP_REC_DBF_ID_TRIGGER] = "trigger", }; static const char *zfcp_rec_dbf_ids[] = { @@ -587,6 +588,89 @@ static const char *zfcp_rec_dbf_ids[] = { [59] = "unit access denied open unit", [60] = "shared unit access denied open unit", [61] = "unit access denied fcp", + [62] = "request timeout", + [63] = "adisc link test reject or timeout", + [64] = "adisc link test d_id changed", + [65] = "adisc link test failed", + [66] = "recovery out of memory", + [67] = "adapter recovery repeated after state change", + [68] = "port recovery repeated after state change", + [69] = "unit recovery repeated after state change", + [70] = "port recovery follow-up after successful adapter recovery", + [71] = "adapter recovery escalation after failed adapter recovery", + [72] = "port recovery follow-up after successful physical port " + "recovery", + [73] = "adapter recovery escalation after failed physical port " + "recovery", + [74] = "unit recovery follow-up after successful port recovery", + [75] = "physical port recovery escalation after failed port " + "recovery", + [76] = "port recovery escalation after failed unit recovery", + [77] = "recovery opening nameserver port", + [78] = "duplicate request id", + [79] = "link down", + [80] = "exclusive read-only unit access unsupported", + [81] = "shared read-write unit access unsupported", + [82] = "incoming rscn", + [83] = "incoming plogi", + [84] = "incoming logo", + [85] = "online", + [86] = "offline", + [87] = "ccw device gone", + [88] = "ccw device no path", + [89] = "ccw device operational", + [90] = "ccw device shutdown", + [91] = "sysfs port addition", + [92] = "sysfs port removal", + [93] = "sysfs adapter recovery", + [94] = "sysfs unit addition", + [95] = "sysfs unit removal", + [96] = "sysfs port recovery", + [97] = "sysfs unit recovery", + [98] = "sequence number mismatch", + [99] = "link up", + [100] = "error state", + [101] = "status read physical port closed", + [102] = "link up status read", + [103] = "too many failed status read buffers", + [104] = "port handle not valid abort", + [105] = "lun handle not valid abort", + [106] = "port handle not valid ct", + [107] = "port handle not valid close port", + [108] = "port handle not valid close physical port", + [109] = "port handle not valid open unit", + [110] = "port handle not valid close unit", + [111] = "lun handle not valid close unit", + [112] = "port handle not valid fcp", + [113] = "lun handle not valid fcp", + [114] = "handle mismatch fcp", + [115] = "lun not valid fcp", + [116] = "qdio send failed", + [117] = "version mismatch", + [118] = "incompatible qtcb type", + [119] = "unknown protocol status", + [120] = "unknown fsf command", + [121] = "no recommendation for status qualifier", + [122] = "status read physical port closed in error", + [123] = "fc service class not supported ct", + [124] = "fc service class not supported els", + [125] = "need newer zfcp", + [126] = "need newer microcode", + [127] = "arbitrated loop not supported", + [128] = "unknown topology", + [129] = "qtcb size mismatch", + [130] = "unknown fsf status ecd", + [131] = "fcp request too big", + [132] = "fc service class not supported fcp", + [133] = "data direction not valid fcp", + [134] = "command length not valid fcp", + [135] = "status read act update", + [136] = "status read cfdc update", + [137] = "hbaapi port open", + [138] = "hbaapi unit open", + [139] = "hbaapi unit shutdown", + [140] = "qdio error", + [141] = "scsi host reset", }; static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, @@ -613,6 +697,17 @@ static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, zfcp_dbf_out(&p, "wwpn", "0x%016Lx", r->u.target.wwpn); zfcp_dbf_out(&p, "fcp_lun", "0x%016Lx", r->u.target.fcp_lun); break; + case ZFCP_REC_DBF_ID_TRIGGER: + zfcp_dbf_out(&p, "reference", "0x%016Lx", r->u.trigger.ref); + zfcp_dbf_out(&p, "erp_action", "0x%016Lx", r->u.trigger.action); + zfcp_dbf_out(&p, "requested", "%d", r->u.trigger.want); + zfcp_dbf_out(&p, "executed", "%d", r->u.trigger.need); + zfcp_dbf_out(&p, "wwpn", "0x%016Lx", r->u.trigger.wwpn); + zfcp_dbf_out(&p, "fcp_lun", "0x%016Lx", r->u.trigger.fcp_lun); + zfcp_dbf_out(&p, "adapter_status", "0x%08x", r->u.trigger.as); + zfcp_dbf_out(&p, "port_status", "0x%08x", r->u.trigger.ps); + zfcp_dbf_out(&p, "unit_status", "0x%08x", r->u.trigger.us); + break; } sprintf(p, "\n"); return (p - buf) + 1; @@ -727,6 +822,45 @@ void zfcp_rec_dbf_event_unit(u8 id, u64 ref, struct zfcp_unit *unit) unit->fcp_lun); } +/** + * zfcp_rec_dbf_event_trigger - trace event for triggered error recovery + * @id2: identifier for error recovery trigger + * @ref: additional reference (e.g. request) + * @want: originally requested error recovery action + * @need: error recovery action actually initiated + * @action: address of error recovery action struct + * @adapter: adapter + * @port: port + * @unit: unit + */ +void zfcp_rec_dbf_event_trigger(u8 id2, u64 ref, u8 want, u8 need, u64 action, + struct zfcp_adapter *adapter, + struct zfcp_port *port, struct zfcp_unit *unit) +{ + struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf; + unsigned long flags; + + spin_lock_irqsave(&adapter->rec_dbf_lock, flags); + memset(r, 0, sizeof(*r)); + r->id = ZFCP_REC_DBF_ID_TRIGGER; + r->id2 = id2; + r->u.trigger.ref = ref; + r->u.trigger.want = want; + r->u.trigger.need = need; + r->u.trigger.action = action; + r->u.trigger.as = atomic_read(&adapter->status); + if (port) { + r->u.trigger.ps = atomic_read(&port->status); + r->u.trigger.wwpn = port->wwpn; + } + if (unit) { + r->u.trigger.us = atomic_read(&unit->status); + r->u.trigger.fcp_lun = unit->fcp_lun; + } + debug_event(adapter->rec_dbf, action ? 1 : 4, r, sizeof(*r)); + spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); +} + static void _zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req, u32 s_id, u32 d_id, void *buffer, int buflen) diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 659ec739706..aad75cfa1c6 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -295,18 +295,32 @@ struct zfcp_rec_dbf_record_target { u32 erp_count; } __attribute__ ((packed)); +struct zfcp_rec_dbf_record_trigger { + u8 want; + u8 need; + u32 as; + u32 ps; + u32 us; + u64 ref; + u64 action; + u64 wwpn; + u64 fcp_lun; +} __attribute__ ((packed)); + struct zfcp_rec_dbf_record { u8 id; u8 id2; union { struct zfcp_rec_dbf_record_thread thread; struct zfcp_rec_dbf_record_target target; + struct zfcp_rec_dbf_record_trigger trigger; } u; } __attribute__ ((packed)); enum { ZFCP_REC_DBF_ID_THREAD, ZFCP_REC_DBF_ID_TARGET, + ZFCP_REC_DBF_ID_TRIGGER, }; struct zfcp_hba_dbf_record_response { diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index bee03443efd..55e034b10de 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -26,13 +26,16 @@ static int zfcp_erp_adisc(struct zfcp_port *); static void zfcp_erp_adisc_handler(unsigned long); -static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *, int); -static int zfcp_erp_port_forced_reopen_internal(struct zfcp_port *, int); -static int zfcp_erp_port_reopen_internal(struct zfcp_port *, int); -static int zfcp_erp_unit_reopen_internal(struct zfcp_unit *, int); +static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *, int, u8, + u64); +static int zfcp_erp_port_forced_reopen_internal(struct zfcp_port *, int, u8, + u64); +static int zfcp_erp_port_reopen_internal(struct zfcp_port *, int, u8, u64); +static int zfcp_erp_unit_reopen_internal(struct zfcp_unit *, int, u8, u64); -static int zfcp_erp_port_reopen_all_internal(struct zfcp_adapter *, int); -static int zfcp_erp_unit_reopen_all_internal(struct zfcp_port *, int); +static int zfcp_erp_port_reopen_all_internal(struct zfcp_adapter *, int, u8, + u64); +static int zfcp_erp_unit_reopen_all_internal(struct zfcp_port *, int, u8, u64); static void zfcp_erp_adapter_block(struct zfcp_adapter *, int); static void zfcp_erp_adapter_unblock(struct zfcp_adapter *); @@ -97,7 +100,8 @@ static void zfcp_erp_action_dismiss_unit(struct zfcp_unit *); static void zfcp_erp_action_dismiss(struct zfcp_erp_action *); static int zfcp_erp_action_enqueue(int, struct zfcp_adapter *, - struct zfcp_port *, struct zfcp_unit *); + struct zfcp_port *, struct zfcp_unit *, + u8 id, u64 ref); static int zfcp_erp_action_dequeue(struct zfcp_erp_action *); static void zfcp_erp_action_cleanup(int, struct zfcp_adapter *, struct zfcp_port *, struct zfcp_unit *, @@ -179,7 +183,7 @@ static void zfcp_close_fsf(struct zfcp_adapter *adapter) static void zfcp_fsf_request_timeout_handler(unsigned long data) { struct zfcp_adapter *adapter = (struct zfcp_adapter *) data; - zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED); + zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 62, 0); } void zfcp_fsf_start_timer(struct zfcp_fsf_req *fsf_req, unsigned long timeout) @@ -200,8 +204,8 @@ void zfcp_fsf_start_timer(struct zfcp_fsf_req *fsf_req, unsigned long timeout) * returns: 0 - initiated action successfully * <0 - failed to initiate action */ -static int -zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter, int clear_mask) +static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter, + int clear_mask, u8 id, u64 ref) { int retval; @@ -221,7 +225,7 @@ zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter, int clear_mask) goto out; } retval = zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER, - adapter, NULL, NULL); + adapter, NULL, NULL, id, ref); out: return retval; @@ -236,56 +240,56 @@ zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter, int clear_mask) * returns: 0 - initiated action successfully * <0 - failed to initiate action */ -int -zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, int clear_mask) +int zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, int clear_mask, + u8 id, u64 ref) { int retval; unsigned long flags; read_lock_irqsave(&zfcp_data.config_lock, flags); write_lock(&adapter->erp_lock); - retval = zfcp_erp_adapter_reopen_internal(adapter, clear_mask); + retval = zfcp_erp_adapter_reopen_internal(adapter, clear_mask, id, ref); write_unlock(&adapter->erp_lock); read_unlock_irqrestore(&zfcp_data.config_lock, flags); return retval; } -int -zfcp_erp_adapter_shutdown(struct zfcp_adapter *adapter, int clear_mask) +int zfcp_erp_adapter_shutdown(struct zfcp_adapter *adapter, int clear_mask, + u8 id, u64 ref) { int retval; retval = zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_RUNNING | ZFCP_STATUS_COMMON_ERP_FAILED | - clear_mask); + clear_mask, id, ref); return retval; } -int -zfcp_erp_port_shutdown(struct zfcp_port *port, int clear_mask) +int zfcp_erp_port_shutdown(struct zfcp_port *port, int clear_mask, u8 id, + u64 ref) { int retval; retval = zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_RUNNING | ZFCP_STATUS_COMMON_ERP_FAILED | - clear_mask); + clear_mask, id, ref); return retval; } -int -zfcp_erp_unit_shutdown(struct zfcp_unit *unit, int clear_mask) +int zfcp_erp_unit_shutdown(struct zfcp_unit *unit, int clear_mask, u8 id, + u64 ref) { int retval; retval = zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_RUNNING | ZFCP_STATUS_COMMON_ERP_FAILED | - clear_mask); + clear_mask, id, ref); return retval; } @@ -400,7 +404,7 @@ zfcp_erp_adisc_handler(unsigned long data) "(adapter %s, port d_id=0x%06x)\n", zfcp_get_busid_by_adapter(adapter), d_id); debug_text_event(adapter->erp_dbf, 3, "forcreop"); - if (zfcp_erp_port_forced_reopen(port, 0)) + if (zfcp_erp_port_forced_reopen(port, 0, 63, 0)) ZFCP_LOG_NORMAL("failed reopen of port " "(adapter %s, wwpn=0x%016Lx)\n", zfcp_get_busid_by_port(port), @@ -427,7 +431,7 @@ zfcp_erp_adisc_handler(unsigned long data) "adisc_resp_wwpn=0x%016Lx)\n", zfcp_get_busid_by_port(port), port->wwpn, (wwn_t) adisc->wwpn); - if (zfcp_erp_port_reopen(port, 0)) + if (zfcp_erp_port_reopen(port, 0, 64, 0)) ZFCP_LOG_NORMAL("failed reopen of port " "(adapter %s, wwpn=0x%016Lx)\n", zfcp_get_busid_by_port(port), @@ -461,7 +465,7 @@ zfcp_test_link(struct zfcp_port *port) ZFCP_LOG_NORMAL("reopen needed for port 0x%016Lx " "on adapter %s\n ", port->wwpn, zfcp_get_busid_by_port(port)); - retval = zfcp_erp_port_forced_reopen(port, 0); + retval = zfcp_erp_port_forced_reopen(port, 0, 65, 0); if (retval != 0) { ZFCP_LOG_NORMAL("reopen of remote port 0x%016Lx " "on adapter %s failed\n", port->wwpn, @@ -484,8 +488,8 @@ zfcp_test_link(struct zfcp_port *port) * returns: 0 - initiated action successfully * <0 - failed to initiate action */ -static int -zfcp_erp_port_forced_reopen_internal(struct zfcp_port *port, int clear_mask) +static int zfcp_erp_port_forced_reopen_internal(struct zfcp_port *port, + int clear_mask, u8 id, u64 ref) { int retval; struct zfcp_adapter *adapter = port->adapter; @@ -509,7 +513,7 @@ zfcp_erp_port_forced_reopen_internal(struct zfcp_port *port, int clear_mask) } retval = zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_PORT_FORCED, - port->adapter, port, NULL); + port->adapter, port, NULL, id, ref); out: return retval; @@ -524,8 +528,8 @@ zfcp_erp_port_forced_reopen_internal(struct zfcp_port *port, int clear_mask) * returns: 0 - initiated action successfully * <0 - failed to initiate action */ -int -zfcp_erp_port_forced_reopen(struct zfcp_port *port, int clear_mask) +int zfcp_erp_port_forced_reopen(struct zfcp_port *port, int clear_mask, u8 id, + u64 ref) { int retval; unsigned long flags; @@ -534,7 +538,8 @@ zfcp_erp_port_forced_reopen(struct zfcp_port *port, int clear_mask) adapter = port->adapter; read_lock_irqsave(&zfcp_data.config_lock, flags); write_lock(&adapter->erp_lock); - retval = zfcp_erp_port_forced_reopen_internal(port, clear_mask); + retval = zfcp_erp_port_forced_reopen_internal(port, clear_mask, id, + ref); write_unlock(&adapter->erp_lock); read_unlock_irqrestore(&zfcp_data.config_lock, flags); @@ -551,8 +556,8 @@ zfcp_erp_port_forced_reopen(struct zfcp_port *port, int clear_mask) * returns: 0 - initiated action successfully * <0 - failed to initiate action */ -static int -zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask) +static int zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask, + u8 id, u64 ref) { int retval; struct zfcp_adapter *adapter = port->adapter; @@ -578,7 +583,7 @@ zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask) } retval = zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_PORT, - port->adapter, port, NULL); + port->adapter, port, NULL, id, ref); out: return retval; @@ -594,8 +599,7 @@ zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask) * correct locking. An error recovery task is initiated to do the reopen. * To wait for the completion of the reopen zfcp_erp_wait should be used. */ -int -zfcp_erp_port_reopen(struct zfcp_port *port, int clear_mask) +int zfcp_erp_port_reopen(struct zfcp_port *port, int clear_mask, u8 id, u64 ref) { int retval; unsigned long flags; @@ -603,7 +607,7 @@ zfcp_erp_port_reopen(struct zfcp_port *port, int clear_mask) read_lock_irqsave(&zfcp_data.config_lock, flags); write_lock(&adapter->erp_lock); - retval = zfcp_erp_port_reopen_internal(port, clear_mask); + retval = zfcp_erp_port_reopen_internal(port, clear_mask, id, ref); write_unlock(&adapter->erp_lock); read_unlock_irqrestore(&zfcp_data.config_lock, flags); @@ -620,8 +624,8 @@ zfcp_erp_port_reopen(struct zfcp_port *port, int clear_mask) * returns: 0 - initiated action successfully * <0 - failed to initiate action */ -static int -zfcp_erp_unit_reopen_internal(struct zfcp_unit *unit, int clear_mask) +static int zfcp_erp_unit_reopen_internal(struct zfcp_unit *unit, int clear_mask, + u8 id, u64 ref) { int retval; struct zfcp_adapter *adapter = unit->port->adapter; @@ -647,7 +651,7 @@ zfcp_erp_unit_reopen_internal(struct zfcp_unit *unit, int clear_mask) } retval = zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_UNIT, - unit->port->adapter, unit->port, unit); + adapter, unit->port, unit, id, ref); out: return retval; } @@ -662,8 +666,7 @@ zfcp_erp_unit_reopen_internal(struct zfcp_unit *unit, int clear_mask) * locking. An error recovery task is initiated to do the reopen. * To wait for the completion of the reopen zfcp_erp_wait should be used. */ -int -zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear_mask) +int zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear_mask, u8 id, u64 ref) { int retval; unsigned long flags; @@ -675,7 +678,7 @@ zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear_mask) read_lock_irqsave(&zfcp_data.config_lock, flags); write_lock(&adapter->erp_lock); - retval = zfcp_erp_unit_reopen_internal(unit, clear_mask); + retval = zfcp_erp_unit_reopen_internal(unit, clear_mask, id, ref); write_unlock(&adapter->erp_lock); read_unlock_irqrestore(&zfcp_data.config_lock, flags); @@ -1215,7 +1218,7 @@ zfcp_erp_strategy(struct zfcp_erp_action *erp_action) "restarting I/O on adapter %s " "to free mempool\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_reopen_internal(adapter, 0); + zfcp_erp_adapter_reopen_internal(adapter, 0, 66, 0); } else { debug_text_event(adapter->erp_dbf, 2, "a_st_memw"); retval = zfcp_erp_strategy_memwait(erp_action); @@ -1499,7 +1502,9 @@ zfcp_erp_strategy_statechange(int action, case ZFCP_ERP_ACTION_REOPEN_ADAPTER: if (zfcp_erp_strategy_statechange_detected(&adapter->status, status)) { - zfcp_erp_adapter_reopen_internal(adapter, ZFCP_STATUS_COMMON_ERP_FAILED); + zfcp_erp_adapter_reopen_internal(adapter, + ZFCP_STATUS_COMMON_ERP_FAILED, + 67, 0); retval = ZFCP_ERP_EXIT; } break; @@ -1508,7 +1513,9 @@ zfcp_erp_strategy_statechange(int action, case ZFCP_ERP_ACTION_REOPEN_PORT: if (zfcp_erp_strategy_statechange_detected(&port->status, status)) { - zfcp_erp_port_reopen_internal(port, ZFCP_STATUS_COMMON_ERP_FAILED); + zfcp_erp_port_reopen_internal(port, + ZFCP_STATUS_COMMON_ERP_FAILED, + 68, 0); retval = ZFCP_ERP_EXIT; } break; @@ -1516,7 +1523,9 @@ zfcp_erp_strategy_statechange(int action, case ZFCP_ERP_ACTION_REOPEN_UNIT: if (zfcp_erp_strategy_statechange_detected(&unit->status, status)) { - zfcp_erp_unit_reopen_internal(unit, ZFCP_STATUS_COMMON_ERP_FAILED); + zfcp_erp_unit_reopen_internal(unit, + ZFCP_STATUS_COMMON_ERP_FAILED, + 69, 0); retval = ZFCP_ERP_EXIT; } break; @@ -1700,29 +1709,29 @@ zfcp_erp_strategy_followup_actions(int action, case ZFCP_ERP_ACTION_REOPEN_ADAPTER: if (status == ZFCP_ERP_SUCCEEDED) - zfcp_erp_port_reopen_all_internal(adapter, 0); + zfcp_erp_port_reopen_all_internal(adapter, 0, 70, 0); else - zfcp_erp_adapter_reopen_internal(adapter, 0); + zfcp_erp_adapter_reopen_internal(adapter, 0, 71, 0); break; case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: if (status == ZFCP_ERP_SUCCEEDED) - zfcp_erp_port_reopen_internal(port, 0); + zfcp_erp_port_reopen_internal(port, 0, 72, 0); else - zfcp_erp_adapter_reopen_internal(adapter, 0); + zfcp_erp_adapter_reopen_internal(adapter, 0, 73, 0); break; case ZFCP_ERP_ACTION_REOPEN_PORT: if (status == ZFCP_ERP_SUCCEEDED) - zfcp_erp_unit_reopen_all_internal(port, 0); + zfcp_erp_unit_reopen_all_internal(port, 0, 74, 0); else - zfcp_erp_port_forced_reopen_internal(port, 0); + zfcp_erp_port_forced_reopen_internal(port, 0, 75, 0); break; case ZFCP_ERP_ACTION_REOPEN_UNIT: /* Nothing to do if status == ZFCP_ERP_SUCCEEDED */ if (status != ZFCP_ERP_SUCCEEDED) - zfcp_erp_port_reopen_internal(unit->port, 0); + zfcp_erp_port_reopen_internal(unit->port, 0, 76, 0); break; } @@ -1863,30 +1872,32 @@ void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, u8 id, u64 ref, * returns: 0 - initiated action successfully * <0 - failed to initiate action */ -int -zfcp_erp_port_reopen_all(struct zfcp_adapter *adapter, int clear_mask) +int zfcp_erp_port_reopen_all(struct zfcp_adapter *adapter, int clear_mask, + u8 id, u64 ref) { int retval; unsigned long flags; read_lock_irqsave(&zfcp_data.config_lock, flags); write_lock(&adapter->erp_lock); - retval = zfcp_erp_port_reopen_all_internal(adapter, clear_mask); + retval = zfcp_erp_port_reopen_all_internal(adapter, clear_mask, id, + ref); write_unlock(&adapter->erp_lock); read_unlock_irqrestore(&zfcp_data.config_lock, flags); return retval; } -static int -zfcp_erp_port_reopen_all_internal(struct zfcp_adapter *adapter, int clear_mask) +static int zfcp_erp_port_reopen_all_internal(struct zfcp_adapter *adapter, + int clear_mask, u8 id, u64 ref) { int retval = 0; struct zfcp_port *port; list_for_each_entry(port, &adapter->port_list_head, list) if (!atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status)) - zfcp_erp_port_reopen_internal(port, clear_mask); + zfcp_erp_port_reopen_internal(port, clear_mask, id, + ref); return retval; } @@ -1898,14 +1909,14 @@ zfcp_erp_port_reopen_all_internal(struct zfcp_adapter *adapter, int clear_mask) * * returns: FIXME */ -static int -zfcp_erp_unit_reopen_all_internal(struct zfcp_port *port, int clear_mask) +static int zfcp_erp_unit_reopen_all_internal(struct zfcp_port *port, + int clear_mask, u8 id, u64 ref) { int retval = 0; struct zfcp_unit *unit; list_for_each_entry(unit, &port->unit_list_head, list) - zfcp_erp_unit_reopen_internal(unit, clear_mask); + zfcp_erp_unit_reopen_internal(unit, clear_mask, id, ref); return retval; } @@ -2466,8 +2477,8 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) /* nameserver port may live again */ atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING, &adapter->nameserver_port->status); - if (zfcp_erp_port_reopen(adapter->nameserver_port, 0) - >= 0) { + if (zfcp_erp_port_reopen(adapter->nameserver_port, 0, + 77, (u64)erp_action) >= 0) { erp_action->step = ZFCP_ERP_STEP_NAMESERVER_OPEN; retval = ZFCP_ERP_CONTINUES; @@ -2963,14 +2974,12 @@ void zfcp_erp_start_timer(struct zfcp_fsf_req *fsf_req) * * returns: */ -static int -zfcp_erp_action_enqueue(int action, - struct zfcp_adapter *adapter, - struct zfcp_port *port, struct zfcp_unit *unit) +static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, + struct zfcp_port *port, + struct zfcp_unit *unit, u8 id, u64 ref) { - int retval = 1; + int retval = 1, need = want; struct zfcp_erp_action *erp_action = NULL; - int stronger_action = 0; u32 status = 0; /* @@ -2989,9 +2998,9 @@ zfcp_erp_action_enqueue(int action, &adapter->status)) return -EIO; - debug_event(adapter->erp_dbf, 4, &action, sizeof (int)); + debug_event(adapter->erp_dbf, 4, &want, sizeof (int)); /* check whether we really need this */ - switch (action) { + switch (want) { case ZFCP_ERP_ACTION_REOPEN_UNIT: if (atomic_test_mask (ZFCP_STATUS_COMMON_ERP_INUSE, &unit->status)) { @@ -3009,10 +3018,8 @@ zfcp_erp_action_enqueue(int action, goto out; } if (!atomic_test_mask - (ZFCP_STATUS_COMMON_UNBLOCKED, &port->status)) { - stronger_action = ZFCP_ERP_ACTION_REOPEN_PORT; - unit = NULL; - } + (ZFCP_STATUS_COMMON_UNBLOCKED, &port->status)) + need = ZFCP_ERP_ACTION_REOPEN_PORT; /* fall through !!! */ case ZFCP_ERP_ACTION_REOPEN_PORT: @@ -3032,7 +3039,7 @@ zfcp_erp_action_enqueue(int action, ZFCP_ERP_ACTION_REOPEN_PORT_FORCED) { ZFCP_LOG_INFO("dropped erp action %i (port " "0x%016Lx, action in use: %i)\n", - action, port->wwpn, + want, port->wwpn, port->erp_action.action); debug_text_event(adapter->erp_dbf, 4, "pf_actenq_drp"); @@ -3050,10 +3057,8 @@ zfcp_erp_action_enqueue(int action, goto out; } if (!atomic_test_mask - (ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status)) { - stronger_action = ZFCP_ERP_ACTION_REOPEN_ADAPTER; - port = NULL; - } + (ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status)) + need = ZFCP_ERP_ACTION_REOPEN_ADAPTER; /* fall through !!! */ case ZFCP_ERP_ACTION_REOPEN_ADAPTER: @@ -3066,30 +3071,28 @@ zfcp_erp_action_enqueue(int action, default: 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, &want, sizeof (int)); ZFCP_LOG_NORMAL("bug: unknown erp action requested " "on adapter %s (action=%d)\n", - zfcp_get_busid_by_adapter(adapter), action); + zfcp_get_busid_by_adapter(adapter), want); goto out; } /* check whether we need something stronger first */ - if (stronger_action) { + if (need) { debug_text_event(adapter->erp_dbf, 4, "a_actenq_str"); - debug_event(adapter->erp_dbf, 4, &stronger_action, + debug_event(adapter->erp_dbf, 4, &need, sizeof (int)); ZFCP_LOG_DEBUG("stronger erp action %d needed before " "erp action %d on adapter %s\n", - stronger_action, action, - zfcp_get_busid_by_adapter(adapter)); - action = stronger_action; + need, want, zfcp_get_busid_by_adapter(adapter)); } /* mark adapter to have some error recovery pending */ atomic_set_mask(ZFCP_STATUS_ADAPTER_ERP_PENDING, &adapter->status); /* setup error recovery action */ - switch (action) { + switch (need) { case ZFCP_ERP_ACTION_REOPEN_UNIT: zfcp_unit_get(unit); @@ -3128,7 +3131,7 @@ zfcp_erp_action_enqueue(int action, erp_action->adapter = adapter; erp_action->port = port; erp_action->unit = unit; - erp_action->action = action; + erp_action->action = need; erp_action->status = status; ++adapter->erp_total_count; @@ -3139,6 +3142,8 @@ zfcp_erp_action_enqueue(int action, zfcp_rec_dbf_event_thread(1, adapter, 0); retval = 0; out: + zfcp_rec_dbf_event_trigger(id, ref, want, need, (u64)erp_action, + adapter, port, unit); return retval; } @@ -3322,7 +3327,7 @@ void zfcp_erp_port_boxed(struct zfcp_port *port, u8 id, u64 ref) zfcp_erp_modify_port_status(port, id, ref, ZFCP_STATUS_COMMON_ACCESS_BOXED, ZFCP_SET); read_unlock_irqrestore(&zfcp_data.config_lock, flags); - zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED); + zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, id, ref); } void zfcp_erp_unit_boxed(struct zfcp_unit *unit, u8 id, u64 ref) @@ -3333,7 +3338,7 @@ void zfcp_erp_unit_boxed(struct zfcp_unit *unit, u8 id, u64 ref) debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); zfcp_erp_modify_unit_status(unit, id, ref, ZFCP_STATUS_COMMON_ACCESS_BOXED, ZFCP_SET); - zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED); + zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED, id, ref); } void zfcp_erp_port_access_denied(struct zfcp_port *port, u8 id, u64 ref) @@ -3361,8 +3366,8 @@ void zfcp_erp_unit_access_denied(struct zfcp_unit *unit, u8 id, u64 ref) ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); } -void -zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter) +void zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter, u8 id, + u64 ref) { struct zfcp_port *port; unsigned long flags; @@ -3375,15 +3380,14 @@ zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter) read_lock_irqsave(&zfcp_data.config_lock, flags); if (adapter->nameserver_port) - zfcp_erp_port_access_changed(adapter->nameserver_port); + zfcp_erp_port_access_changed(adapter->nameserver_port, id, ref); list_for_each_entry(port, &adapter->port_list_head, list) if (port != adapter->nameserver_port) - zfcp_erp_port_access_changed(port); + zfcp_erp_port_access_changed(port, id, ref); read_unlock_irqrestore(&zfcp_data.config_lock, flags); } -void -zfcp_erp_port_access_changed(struct zfcp_port *port) +void zfcp_erp_port_access_changed(struct zfcp_port *port, u8 id, u64 ref) { struct zfcp_adapter *adapter = port->adapter; struct zfcp_unit *unit; @@ -3397,21 +3401,20 @@ zfcp_erp_port_access_changed(struct zfcp_port *port) &port->status)) { if (!atomic_test_mask(ZFCP_STATUS_PORT_WKA, &port->status)) list_for_each_entry(unit, &port->unit_list_head, list) - zfcp_erp_unit_access_changed(unit); + zfcp_erp_unit_access_changed(unit, id, ref); return; } ZFCP_LOG_NORMAL("reopen of port 0x%016Lx on adapter %s " "(due to ACT update)\n", port->wwpn, zfcp_get_busid_by_adapter(adapter)); - if (zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED) != 0) + if (zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, id, ref)) ZFCP_LOG_NORMAL("failed reopen of port" "(adapter %s, wwpn=0x%016Lx)\n", zfcp_get_busid_by_adapter(adapter), port->wwpn); } -void -zfcp_erp_unit_access_changed(struct zfcp_unit *unit) +void zfcp_erp_unit_access_changed(struct zfcp_unit *unit, u8 id, u64 ref) { struct zfcp_adapter *adapter = unit->port->adapter; @@ -3428,7 +3431,7 @@ zfcp_erp_unit_access_changed(struct zfcp_unit *unit) " on adapter %s (due to ACT update)\n", unit->fcp_lun, unit->port->wwpn, zfcp_get_busid_by_adapter(adapter)); - if (zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED) != 0) + if (zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED, id, ref)) ZFCP_LOG_NORMAL("failed reopen of unit (adapter %s, " "wwpn=0x%016Lx, fcp_lun=0x%016Lx)\n", zfcp_get_busid_by_adapter(adapter), diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index 20ad6fde2e2..e10ed145baa 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h @@ -133,20 +133,20 @@ extern struct fc_function_template zfcp_transport_functions; /******************************** ERP ****************************************/ extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, u8, u64, u32, int); -extern int zfcp_erp_adapter_reopen(struct zfcp_adapter *, int); -extern int zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int); +extern int zfcp_erp_adapter_reopen(struct zfcp_adapter *, int, u8, u64); +extern int zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int, u8, u64); extern void zfcp_erp_adapter_failed(struct zfcp_adapter *, u8, u64); extern void zfcp_erp_modify_port_status(struct zfcp_port *, u8, u64, u32, int); -extern int zfcp_erp_port_reopen(struct zfcp_port *, int); -extern int zfcp_erp_port_shutdown(struct zfcp_port *, int); -extern int zfcp_erp_port_forced_reopen(struct zfcp_port *, int); +extern int zfcp_erp_port_reopen(struct zfcp_port *, int, u8, u64); +extern int zfcp_erp_port_shutdown(struct zfcp_port *, int, u8, u64); +extern int zfcp_erp_port_forced_reopen(struct zfcp_port *, int, u8, u64); extern void zfcp_erp_port_failed(struct zfcp_port *, u8, u64); -extern int zfcp_erp_port_reopen_all(struct zfcp_adapter *, int); +extern int zfcp_erp_port_reopen_all(struct zfcp_adapter *, int, u8, u64); extern void zfcp_erp_modify_unit_status(struct zfcp_unit *, u8, u64, u32, int); -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_reopen(struct zfcp_unit *, int, u8, u64); +extern int zfcp_erp_unit_shutdown(struct zfcp_unit *, int, u8, u64); extern void zfcp_erp_unit_failed(struct zfcp_unit *, u8, u64); extern int zfcp_erp_thread_setup(struct zfcp_adapter *); @@ -160,9 +160,9 @@ extern void zfcp_erp_port_boxed(struct zfcp_port *, u8 id, u64 ref); extern void zfcp_erp_unit_boxed(struct zfcp_unit *, u8 id, u64 ref); extern void zfcp_erp_port_access_denied(struct zfcp_port *, u8 id, u64 ref); extern void zfcp_erp_unit_access_denied(struct zfcp_unit *, u8 id, u64 ref); -extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *); -extern void zfcp_erp_port_access_changed(struct zfcp_port *); -extern void zfcp_erp_unit_access_changed(struct zfcp_unit *); +extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *, u8, u64); +extern void zfcp_erp_port_access_changed(struct zfcp_port *, u8, u64); +extern void zfcp_erp_unit_access_changed(struct zfcp_unit *, u8, u64); /******************************** AUX ****************************************/ extern void zfcp_rec_dbf_event_thread(u8 id, struct zfcp_adapter *adapter, @@ -170,6 +170,9 @@ extern void zfcp_rec_dbf_event_thread(u8 id, struct zfcp_adapter *adapter, extern void zfcp_rec_dbf_event_adapter(u8 id, u64 ref, struct zfcp_adapter *); extern void zfcp_rec_dbf_event_port(u8 id, u64 ref, struct zfcp_port *port); extern void zfcp_rec_dbf_event_unit(u8 id, u64 ref, struct zfcp_unit *unit); +extern void zfcp_rec_dbf_event_trigger(u8 id, u64 ref, u8 want, u8 need, + u64 action, struct zfcp_adapter *, + struct zfcp_port *, struct zfcp_unit *); extern void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *); extern void zfcp_hba_dbf_event_fsf_unsol(const char *, struct zfcp_adapter *, diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 2b7ddb78767..ffdf99736a4 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -298,7 +298,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_adapter(adapter), prot_status_qual->version_error.fsf_version, ZFCP_QTCB_VERSION); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 117, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -309,7 +309,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) qtcb->prefix.req_seq_no, zfcp_get_busid_by_adapter(adapter), prot_status_qual->sequence_error.exp_req_seq_no); - zfcp_erp_adapter_reopen(adapter, 0); + zfcp_erp_adapter_reopen(adapter, 0, 98, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_RETRY; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -320,7 +320,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) "that used on adapter %s. " "Stopping all operations on this adapter.\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 118, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -337,14 +337,15 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) *(unsigned long long*) (&qtcb->bottom.support.req_handle), zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 78, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_PROT_LINK_DOWN: zfcp_fsf_link_down_info_eval(fsf_req, 37, &prot_status_qual->link_down_info); - zfcp_erp_adapter_reopen(adapter, 0); + /* FIXME: reopening adapter now? better wait for link up */ + zfcp_erp_adapter_reopen(adapter, 0, 79, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -359,7 +360,8 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) ZFCP_SET); zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED - | ZFCP_STATUS_COMMON_ERP_FAILED); + | ZFCP_STATUS_COMMON_ERP_FAILED, + 99, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -369,7 +371,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) "Restarting all operations on this " "adapter.\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_reopen(adapter, 0); + zfcp_erp_adapter_reopen(adapter, 0, 100, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_RETRY; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -382,7 +384,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) "(debug info 0x%x).\n", zfcp_get_busid_by_adapter(adapter), qtcb->prefix.prot_status); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 119, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; } @@ -421,7 +423,8 @@ zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *fsf_req) "(debug info 0x%x).\n", zfcp_get_busid_by_adapter(fsf_req->adapter), fsf_req->qtcb->header.fsf_command); - zfcp_erp_adapter_shutdown(fsf_req->adapter, 0); + zfcp_erp_adapter_shutdown(fsf_req->adapter, 0, 120, + (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -475,7 +478,8 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req) "problem on the adapter %s " "Stopping all operations on this adapter. ", zfcp_get_busid_by_adapter(fsf_req->adapter)); - zfcp_erp_adapter_shutdown(fsf_req->adapter, 0); + zfcp_erp_adapter_shutdown(fsf_req->adapter, 0, 121, + (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_PROGRAMMING_ERROR: @@ -796,12 +800,12 @@ zfcp_fsf_status_read_port_closed(struct zfcp_fsf_req *fsf_req) case FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT: debug_text_event(adapter->erp_dbf, 3, "unsol_pc_phys:"); - zfcp_erp_port_reopen(port, 0); + zfcp_erp_port_reopen(port, 0, 101, (u64)fsf_req); break; case FSF_STATUS_READ_SUB_ERROR_PORT: debug_text_event(adapter->erp_dbf, 1, "unsol_pc_err:"); - zfcp_erp_port_shutdown(port, 0); + zfcp_erp_port_shutdown(port, 0, 122, (u64)fsf_req); break; default: @@ -935,7 +939,8 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) ZFCP_SET); zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED - | ZFCP_STATUS_COMMON_ERP_FAILED); + | ZFCP_STATUS_COMMON_ERP_FAILED, + 102, (u64)fsf_req); break; case FSF_STATUS_READ_NOTIFICATION_LOST: @@ -969,13 +974,14 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) if (status_buffer->status_subtype & FSF_STATUS_READ_SUB_ACT_UPDATED) - zfcp_erp_adapter_access_changed(adapter); + zfcp_erp_adapter_access_changed(adapter, 135, + (u64)fsf_req); break; case FSF_STATUS_READ_CFDC_UPDATED: ZFCP_LOG_NORMAL("CFDC has been updated on the adapter %s\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_access_changed(adapter); + zfcp_erp_adapter_access_changed(adapter, 136, (u64)fsf_req); break; case FSF_STATUS_READ_CFDC_HARDENED: @@ -1044,7 +1050,7 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_INFO("restart adapter %s due to status read " "buffer shortage\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_reopen(adapter, 0); + zfcp_erp_adapter_reopen(adapter, 0, 103, (u64)fsf_req); } } out: @@ -1167,7 +1173,8 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) /* Let's hope this sorts out the mess */ debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_s_phand_nv1"); - zfcp_erp_adapter_reopen(unit->port->adapter, 0); + zfcp_erp_adapter_reopen(unit->port->adapter, 0, 104, + (u64)new_fsf_req); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; } break; @@ -1199,7 +1206,8 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) /* Let's hope this sorts out the mess */ debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_s_lhand_nv1"); - zfcp_erp_port_reopen(unit->port, 0); + zfcp_erp_port_reopen(unit->port, 0, 105, + (u64)new_fsf_req); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; } break; @@ -1478,7 +1486,7 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) ZFCP_FC_SERVICE_CLASS_DEFAULT); /* stop operation for this adapter */ debug_text_exception(adapter->erp_dbf, 0, "fsf_s_class_nsup"); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 123, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -1547,7 +1555,7 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); debug_text_event(adapter->erp_dbf, 1, "fsf_s_phandle_nv"); - zfcp_erp_adapter_reopen(adapter, 0); + zfcp_erp_adapter_reopen(adapter, 0, 106, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -1782,7 +1790,7 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) ZFCP_FC_SERVICE_CLASS_DEFAULT); /* stop operation for this adapter */ debug_text_exception(adapter->erp_dbf, 0, "fsf_s_class_nsup"); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 124, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2104,7 +2112,7 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) "driver (try updated device driver)\n", zfcp_get_busid_by_adapter(adapter)); debug_text_event(adapter->erp_dbf, 0, "low_qtcb_ver"); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 125, (u64)fsf_req); return -EIO; } if (ZFCP_QTCB_VERSION > bottom->high_qtcb_version) { @@ -2114,7 +2122,7 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) "(consider a microcode upgrade)\n", zfcp_get_busid_by_adapter(adapter)); debug_text_event(adapter->erp_dbf, 0, "high_qtcb_ver"); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 126, (u64)fsf_req); return -EIO; } return 0; @@ -2164,7 +2172,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_adapter(adapter)); debug_text_event(fsf_req->adapter->erp_dbf, 0, "top-al"); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 127, (u64)fsf_req); return -EIO; case FC_PORTTYPE_NPORT: ZFCP_LOG_NORMAL("Switched fabric fibrechannel " @@ -2181,7 +2189,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_adapter(adapter)); debug_text_exception(fsf_req->adapter->erp_dbf, 0, "unknown-topo"); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 128, (u64)fsf_req); return -EIO; } bottom = &qtcb->bottom.config; @@ -2197,7 +2205,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) "qtcb-size"); debug_event(fsf_req->adapter->erp_dbf, 0, &bottom->max_qtcb_size, sizeof (u32)); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 129, (u64)fsf_req); return -EIO; } atomic_set_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, @@ -2219,7 +2227,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) debug_text_event(fsf_req->adapter->erp_dbf, 0, "fsf-stat-ng"); debug_event(fsf_req->adapter->erp_dbf, 0, &fsf_req->qtcb->header.fsf_status, sizeof(u32)); - zfcp_erp_adapter_shutdown(adapter, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 130, (u64)fsf_req); return -EIO; } return 0; @@ -2760,7 +2768,7 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req) sizeof (union fsf_status_qual)); debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_phand_nv"); - zfcp_erp_adapter_reopen(port->adapter, 0); + zfcp_erp_adapter_reopen(port->adapter, 0, 107, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2903,7 +2911,7 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) sizeof (union fsf_status_qual)); debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_phand_nv"); - zfcp_erp_adapter_reopen(port->adapter, 0); + zfcp_erp_adapter_reopen(port->adapter, 0, 108, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3128,7 +3136,8 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); debug_text_event(adapter->erp_dbf, 1, "fsf_s_ph_nv"); - zfcp_erp_adapter_reopen(unit->port->adapter, 0); + zfcp_erp_adapter_reopen(unit->port->adapter, 0, 109, + (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3311,13 +3320,15 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) "unit not supported\n"); zfcp_erp_unit_failed(unit, 35, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; - zfcp_erp_unit_shutdown(unit, 0); + zfcp_erp_unit_shutdown(unit, 0, 80, + (u64)fsf_req); } else if (!exclusive && readwrite) { ZFCP_LOG_NORMAL("shared access of read-write " "unit not supported\n"); zfcp_erp_unit_failed(unit, 36, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; - zfcp_erp_unit_shutdown(unit, 0); + zfcp_erp_unit_shutdown(unit, 0, 81, + (u64)fsf_req); } } @@ -3445,7 +3456,8 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) sizeof (union fsf_status_qual)); debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_phand_nv"); - zfcp_erp_adapter_reopen(unit->port->adapter, 0); + zfcp_erp_adapter_reopen(unit->port->adapter, 0, 110, + (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3463,7 +3475,7 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) sizeof (union fsf_status_qual)); debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_lhand_nv"); - zfcp_erp_port_reopen(unit->port, 0); + zfcp_erp_port_reopen(unit->port, 0, 111, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3681,7 +3693,7 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter, zfcp_get_busid_by_unit(unit), unit->port->wwpn, unit->fcp_lun); - zfcp_erp_unit_shutdown(unit, 0); + zfcp_erp_unit_shutdown(unit, 0, 131, (u64)fsf_req); retval = -EINVAL; } goto no_fit; @@ -3841,7 +3853,8 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) sizeof (union fsf_status_qual)); debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_phand_nv"); - zfcp_erp_adapter_reopen(unit->port->adapter, 0); + zfcp_erp_adapter_reopen(unit->port->adapter, 0, 112, + (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3859,7 +3872,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) sizeof (union fsf_status_qual)); debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_uhand_nv"); - zfcp_erp_port_reopen(unit->port, 0); + zfcp_erp_port_reopen(unit->port, 0, 113, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3877,7 +3890,8 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) sizeof (union fsf_status_qual)); debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_hand_mis"); - zfcp_erp_adapter_reopen(unit->port->adapter, 0); + zfcp_erp_adapter_reopen(unit->port->adapter, 0, 114, + (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3889,7 +3903,8 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) /* stop operation for this adapter */ debug_text_exception(fsf_req->adapter->erp_dbf, 0, "fsf_s_class_nsup"); - zfcp_erp_adapter_shutdown(unit->port->adapter, 0); + zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 132, + (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3907,7 +3922,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) sizeof (union fsf_status_qual)); debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_fcp_lun_nv"); - zfcp_erp_port_reopen(unit->port, 0); + zfcp_erp_port_reopen(unit->port, 0, 115, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3945,7 +3960,8 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) /* stop operation for this adapter */ debug_text_event(fsf_req->adapter->erp_dbf, 0, "fsf_s_dir_ind_nv"); - zfcp_erp_adapter_shutdown(unit->port->adapter, 0); + zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 133, + (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3960,7 +3976,8 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) /* stop operation for this adapter */ debug_text_event(fsf_req->adapter->erp_dbf, 0, "fsf_s_cmd_len_nv"); - zfcp_erp_adapter_shutdown(unit->port->adapter, 0); + zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 134, + (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -4863,7 +4880,7 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req) req_queue->free_index -= fsf_req->sbal_number; req_queue->free_index += QDIO_MAX_BUFFERS_PER_Q; req_queue->free_index %= QDIO_MAX_BUFFERS_PER_Q; /* wrap */ - zfcp_erp_adapter_reopen(adapter, 0); + zfcp_erp_adapter_reopen(adapter, 0, 116, (u64)fsf_req); } else { req_queue->distance_from_int = new_distance_from_int; /* diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index 22fdc17e0d0..d742d0a9df7 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c @@ -175,8 +175,8 @@ zfcp_qdio_handler_error_check(struct zfcp_adapter *adapter, unsigned int status, * which is set again in case we have missed by a mile. */ zfcp_erp_adapter_reopen(adapter, - ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED | - ZFCP_STATUS_COMMON_ERP_FAILED); + ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED | + ZFCP_STATUS_COMMON_ERP_FAILED, 140, 0); } return retval; } diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 1198f0b27e3..cd844b2ad7a 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -529,7 +529,7 @@ static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt) unit->fcp_lun, unit->port->wwpn, zfcp_get_busid_by_adapter(unit->port->adapter)); - zfcp_erp_adapter_reopen(adapter, 0); + zfcp_erp_adapter_reopen(adapter, 0, 141, (u64)scpnt); zfcp_erp_wait(adapter); return SUCCESS; diff --git a/drivers/s390/scsi/zfcp_sysfs_adapter.c b/drivers/s390/scsi/zfcp_sysfs_adapter.c index ec340530c82..e0bbcc440a5 100644 --- a/drivers/s390/scsi/zfcp_sysfs_adapter.c +++ b/drivers/s390/scsi/zfcp_sysfs_adapter.c @@ -89,7 +89,7 @@ zfcp_sysfs_port_add_store(struct device *dev, struct device_attribute *attr, con retval = 0; - zfcp_erp_port_reopen(port, 0); + zfcp_erp_port_reopen(port, 0, 91, 0); zfcp_erp_wait(port->adapter); zfcp_port_put(port); out: @@ -147,7 +147,7 @@ zfcp_sysfs_port_remove_store(struct device *dev, struct device_attribute *attr, goto out; } - zfcp_erp_port_shutdown(port, 0); + zfcp_erp_port_shutdown(port, 0, 92, 0); zfcp_erp_wait(adapter); zfcp_port_put(port); zfcp_port_dequeue(port); @@ -193,7 +193,7 @@ zfcp_sysfs_adapter_failed_store(struct device *dev, struct device_attribute *att zfcp_erp_modify_adapter_status(adapter, 44, 0, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); - zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED); + zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 93, 0); zfcp_erp_wait(adapter); out: up(&zfcp_data.config_sema); diff --git a/drivers/s390/scsi/zfcp_sysfs_port.c b/drivers/s390/scsi/zfcp_sysfs_port.c index 9cc2bc5be72..538195034c6 100644 --- a/drivers/s390/scsi/zfcp_sysfs_port.c +++ b/drivers/s390/scsi/zfcp_sysfs_port.c @@ -94,7 +94,7 @@ zfcp_sysfs_unit_add_store(struct device *dev, struct device_attribute *attr, con retval = 0; - zfcp_erp_unit_reopen(unit, 0); + zfcp_erp_unit_reopen(unit, 0, 94, 0); zfcp_erp_wait(unit->port->adapter); zfcp_unit_put(unit); out: @@ -150,7 +150,7 @@ zfcp_sysfs_unit_remove_store(struct device *dev, struct device_attribute *attr, goto out; } - zfcp_erp_unit_shutdown(unit, 0); + zfcp_erp_unit_shutdown(unit, 0, 95, 0); zfcp_erp_wait(unit->port->adapter); zfcp_unit_put(unit); zfcp_unit_dequeue(unit); @@ -195,7 +195,7 @@ zfcp_sysfs_port_failed_store(struct device *dev, struct device_attribute *attr, zfcp_erp_modify_port_status(port, 45, 0, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); - zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED); + zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, 96, 0); zfcp_erp_wait(port->adapter); out: up(&zfcp_data.config_sema); diff --git a/drivers/s390/scsi/zfcp_sysfs_unit.c b/drivers/s390/scsi/zfcp_sysfs_unit.c index 52a5f6a25ff..fd73568b44b 100644 --- a/drivers/s390/scsi/zfcp_sysfs_unit.c +++ b/drivers/s390/scsi/zfcp_sysfs_unit.c @@ -96,7 +96,7 @@ zfcp_sysfs_unit_failed_store(struct device *dev, struct device_attribute *attr, zfcp_erp_modify_unit_status(unit, 46, 0, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); - zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED); + zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED, 97, 0); zfcp_erp_wait(unit->port->adapter); out: up(&zfcp_data.config_sema); -- cgit v1.2.3 From 6f4f365e9c5d721c4d03ee8009dd6fab47feb045 Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Thu, 27 Mar 2008 14:22:04 +0100 Subject: [SCSI] zfcp: Add trace records for recovery actions. This patch writes trace records for various phases of a recovery action: action being created, action being processed, action continueing asynchronously, action gone, action timed out, action dismissed etc. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.c | 35 +++++++++++++++++++++++++++++++++++ drivers/s390/scsi/zfcp_def.h | 9 +++++++++ drivers/s390/scsi/zfcp_erp.c | 6 ++++++ drivers/s390/scsi/zfcp_ext.h | 1 + 4 files changed, 51 insertions(+) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index f207b0bd0ca..466a689c538 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -524,6 +524,7 @@ static const char *zfcp_rec_dbf_tags[] = { [ZFCP_REC_DBF_ID_THREAD] = "thread", [ZFCP_REC_DBF_ID_TARGET] = "target", [ZFCP_REC_DBF_ID_TRIGGER] = "trigger", + [ZFCP_REC_DBF_ID_ACTION] = "action", }; static const char *zfcp_rec_dbf_ids[] = { @@ -671,6 +672,11 @@ static const char *zfcp_rec_dbf_ids[] = { [139] = "hbaapi unit shutdown", [140] = "qdio error", [141] = "scsi host reset", + [142] = "dismissing fsf request for recovery action", + [143] = "recovery action timed out", + [144] = "recovery action gone", + [145] = "recovery action being processed", + [146] = "recovery action ready for next step", }; static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, @@ -708,6 +714,12 @@ static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, zfcp_dbf_out(&p, "port_status", "0x%08x", r->u.trigger.ps); zfcp_dbf_out(&p, "unit_status", "0x%08x", r->u.trigger.us); break; + case ZFCP_REC_DBF_ID_ACTION: + zfcp_dbf_out(&p, "erp_action", "0x%016Lx", r->u.action.action); + zfcp_dbf_out(&p, "fsf_req", "0x%016Lx", r->u.action.fsf_req); + zfcp_dbf_out(&p, "status", "0x%08Lx", r->u.action.status); + zfcp_dbf_out(&p, "step", "0x%08Lx", r->u.action.step); + break; } sprintf(p, "\n"); return (p - buf) + 1; @@ -861,6 +873,29 @@ void zfcp_rec_dbf_event_trigger(u8 id2, u64 ref, u8 want, u8 need, u64 action, spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); } +/** + * zfcp_rec_dbf_event_action - trace event showing progress of recovery action + * @id2: identifier + * @erp_action: error recovery action struct pointer + */ +void zfcp_rec_dbf_event_action(u8 id2, struct zfcp_erp_action *erp_action) +{ + struct zfcp_adapter *adapter = erp_action->adapter; + struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf; + unsigned long flags; + + spin_lock_irqsave(&adapter->rec_dbf_lock, flags); + memset(r, 0, sizeof(*r)); + r->id = ZFCP_REC_DBF_ID_ACTION; + r->id2 = id2; + r->u.action.action = (u64)erp_action; + r->u.action.status = erp_action->status; + r->u.action.step = erp_action->step; + r->u.action.fsf_req = (u64)erp_action->fsf_req; + debug_event(adapter->rec_dbf, 4, r, sizeof(*r)); + spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); +} + static void _zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req, u32 s_id, u32 d_id, void *buffer, int buflen) diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index aad75cfa1c6..9a4d870a820 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -307,10 +307,18 @@ struct zfcp_rec_dbf_record_trigger { u64 fcp_lun; } __attribute__ ((packed)); +struct zfcp_rec_dbf_record_action { + u32 status; + u32 step; + u64 action; + u64 fsf_req; +} __attribute__ ((packed)); + struct zfcp_rec_dbf_record { u8 id; u8 id2; union { + struct zfcp_rec_dbf_record_action action; struct zfcp_rec_dbf_record_thread thread; struct zfcp_rec_dbf_record_target target; struct zfcp_rec_dbf_record_trigger trigger; @@ -318,6 +326,7 @@ struct zfcp_rec_dbf_record { } __attribute__ ((packed)); enum { + ZFCP_REC_DBF_ID_ACTION, ZFCP_REC_DBF_ID_THREAD, ZFCP_REC_DBF_ID_TARGET, ZFCP_REC_DBF_ID_TRIGGER, diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 55e034b10de..335ab70181e 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -893,8 +893,10 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action) "a_ca_disreq"); erp_action->fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; + zfcp_rec_dbf_event_action(142, erp_action); } if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) { + zfcp_rec_dbf_event_action(143, erp_action); ZFCP_LOG_NORMAL("error: erp step timed out " "(action=%d, fsf_req=%p)\n ", erp_action->action, @@ -3162,6 +3164,8 @@ zfcp_erp_action_dequeue(struct zfcp_erp_action *erp_action) debug_text_event(adapter->erp_dbf, 4, "a_actdeq"); debug_event(adapter->erp_dbf, 4, &erp_action->action, sizeof (int)); list_del(&erp_action->list); + zfcp_rec_dbf_event_action(144, erp_action); + switch (erp_action->action) { case ZFCP_ERP_ACTION_REOPEN_UNIT: atomic_clear_mask(ZFCP_STATUS_COMMON_ERP_INUSE, @@ -3305,6 +3309,7 @@ static void zfcp_erp_action_to_running(struct zfcp_erp_action *erp_action) debug_text_event(adapter->erp_dbf, 6, "a_toru"); debug_event(adapter->erp_dbf, 6, &erp_action->action, sizeof (int)); list_move(&erp_action->list, &erp_action->adapter->erp_running_head); + zfcp_rec_dbf_event_action(145, erp_action); } static void zfcp_erp_action_to_ready(struct zfcp_erp_action *erp_action) @@ -3314,6 +3319,7 @@ static void zfcp_erp_action_to_ready(struct zfcp_erp_action *erp_action) debug_text_event(adapter->erp_dbf, 6, "a_tore"); debug_event(adapter->erp_dbf, 6, &erp_action->action, sizeof (int)); list_move(&erp_action->list, &erp_action->adapter->erp_ready_head); + zfcp_rec_dbf_event_action(146, erp_action); } void zfcp_erp_port_boxed(struct zfcp_port *port, u8 id, u64 ref) diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index e10ed145baa..6de0147d84d 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h @@ -173,6 +173,7 @@ extern void zfcp_rec_dbf_event_unit(u8 id, u64 ref, struct zfcp_unit *unit); extern void zfcp_rec_dbf_event_trigger(u8 id, u64 ref, u8 want, u8 need, u64 action, struct zfcp_adapter *, struct zfcp_port *, struct zfcp_unit *); +extern void zfcp_rec_dbf_event_action(u8 id, struct zfcp_erp_action *); extern void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *); extern void zfcp_hba_dbf_event_fsf_unsol(const char *, struct zfcp_adapter *, -- cgit v1.2.3 From 507e49693a074e878f20718fb97a5da01ccd9cbd Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Thu, 27 Mar 2008 14:22:05 +0100 Subject: [SCSI] zfcp: Remove obsolete erp_dbf trace This patch removes the now obsolete erp_dbf trace. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_aux.c | 1 - drivers/s390/scsi/zfcp_ccw.c | 3 - drivers/s390/scsi/zfcp_dbf.c | 11 -- drivers/s390/scsi/zfcp_def.h | 8 -- drivers/s390/scsi/zfcp_erp.c | 305 +----------------------------------------- drivers/s390/scsi/zfcp_fsf.c | 199 --------------------------- drivers/s390/scsi/zfcp_qdio.c | 2 - 7 files changed, 4 insertions(+), 525 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index d2a744200c9..05a33c247c6 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -1030,7 +1030,6 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device) /* initialize debug locks */ - spin_lock_init(&adapter->erp_dbf_lock); spin_lock_init(&adapter->hba_dbf_lock); spin_lock_init(&adapter->san_dbf_lock); spin_lock_init(&adapter->scsi_dbf_lock); diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index 8edd90583cd..db9f538362a 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c @@ -223,19 +223,16 @@ zfcp_ccw_notify(struct ccw_device *ccw_device, int event) case CIO_GONE: ZFCP_LOG_NORMAL("adapter %s: device gone\n", zfcp_get_busid_by_adapter(adapter)); - debug_text_event(adapter->erp_dbf,1,"dev_gone"); zfcp_erp_adapter_shutdown(adapter, 0, 87, 0); break; case CIO_NO_PATH: ZFCP_LOG_NORMAL("adapter %s: no path\n", zfcp_get_busid_by_adapter(adapter)); - debug_text_event(adapter->erp_dbf,1,"no_path"); zfcp_erp_adapter_shutdown(adapter, 0, 88, 0); break; case CIO_OPER: ZFCP_LOG_NORMAL("adapter %s: operational again\n", zfcp_get_busid_by_adapter(adapter)); - debug_text_event(adapter->erp_dbf,1,"dev_oper"); zfcp_erp_modify_adapter_status(adapter, 11, 0, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 466a689c538..aecdc7f2dbc 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -1301,15 +1301,6 @@ int zfcp_adapter_debug_register(struct zfcp_adapter *adapter) { char dbf_name[DEBUG_MAX_NAME_LEN]; - /* debug feature area which records recovery activity */ - sprintf(dbf_name, "zfcp_%s_erp", zfcp_get_busid_by_adapter(adapter)); - adapter->erp_dbf = debug_register(dbf_name, dbfsize, 2, - sizeof(struct zfcp_erp_dbf_record)); - if (!adapter->erp_dbf) - goto failed; - debug_register_view(adapter->erp_dbf, &debug_hex_ascii_view); - debug_set_level(adapter->erp_dbf, 3); - /* debug feature area which records recovery activity */ sprintf(dbf_name, "zfcp_%s_rec", zfcp_get_busid_by_adapter(adapter)); adapter->rec_dbf = debug_register(dbf_name, dbfsize, 1, @@ -1368,12 +1359,10 @@ void zfcp_adapter_debug_unregister(struct zfcp_adapter *adapter) debug_unregister(adapter->san_dbf); debug_unregister(adapter->hba_dbf); debug_unregister(adapter->rec_dbf); - debug_unregister(adapter->erp_dbf); adapter->scsi_dbf = NULL; adapter->san_dbf = NULL; adapter->hba_dbf = NULL; adapter->rec_dbf = NULL; - adapter->erp_dbf = NULL; } #undef ZFCP_LOG_AREA diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 9a4d870a820..85c0488719f 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -274,11 +274,6 @@ struct zfcp_dbf_dump { u8 data[]; /* dump data */ } __attribute__ ((packed)); -/* FIXME: to be inflated when reworking the erp dbf */ -struct zfcp_erp_dbf_record { - u8 dummy[16]; -} __attribute__ ((packed)); - struct zfcp_rec_dbf_record_thread { u32 sema; u32 total; @@ -969,17 +964,14 @@ struct zfcp_adapter { u32 erp_low_mem_count; /* nr of erp actions waiting for memory */ struct zfcp_port *nameserver_port; /* adapter's nameserver */ - debug_info_t *erp_dbf; debug_info_t *rec_dbf; debug_info_t *hba_dbf; debug_info_t *san_dbf; /* debug feature areas */ debug_info_t *scsi_dbf; - spinlock_t erp_dbf_lock; spinlock_t rec_dbf_lock; spinlock_t hba_dbf_lock; spinlock_t san_dbf_lock; spinlock_t scsi_dbf_lock; - struct zfcp_erp_dbf_record erp_dbf_buf; struct zfcp_rec_dbf_record rec_dbf_buf; struct zfcp_hba_dbf_record hba_dbf_buf; struct zfcp_san_dbf_record san_dbf_buf; diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 335ab70181e..feb1fda33d2 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -132,11 +132,9 @@ static void zfcp_close_qdio(struct zfcp_adapter *adapter) atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status); write_unlock_irq(&req_queue->queue_lock); - debug_text_event(adapter->erp_dbf, 3, "qdio_down2a"); while (qdio_shutdown(adapter->ccw_device, QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS) ssleep(1); - debug_text_event(adapter->erp_dbf, 3, "qdio_down2b"); /* cleanup used outbound sbals */ count = atomic_read(&req_queue->free_count); @@ -209,7 +207,6 @@ static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter, { int retval; - debug_text_event(adapter->erp_dbf, 5, "a_ro"); ZFCP_LOG_DEBUG("reopen adapter %s\n", zfcp_get_busid_by_adapter(adapter)); @@ -218,7 +215,6 @@ static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter, if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &adapter->status)) { ZFCP_LOG_DEBUG("skipped reopen of failed adapter %s\n", zfcp_get_busid_by_adapter(adapter)); - debug_text_event(adapter->erp_dbf, 5, "a_ro_f"); /* ensure propagation of failed status to new devices */ zfcp_erp_adapter_failed(adapter, 13, 0); retval = -EIO; @@ -403,7 +399,6 @@ zfcp_erp_adisc_handler(unsigned long data) "force physical port reopen " "(adapter %s, port d_id=0x%06x)\n", zfcp_get_busid_by_adapter(adapter), d_id); - debug_text_event(adapter->erp_dbf, 3, "forcreop"); if (zfcp_erp_port_forced_reopen(port, 0, 63, 0)) ZFCP_LOG_NORMAL("failed reopen of port " "(adapter %s, wwpn=0x%016Lx)\n", @@ -492,10 +487,6 @@ static int zfcp_erp_port_forced_reopen_internal(struct zfcp_port *port, int clear_mask, u8 id, u64 ref) { int retval; - struct zfcp_adapter *adapter = port->adapter; - - debug_text_event(adapter->erp_dbf, 5, "pf_ro"); - debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); ZFCP_LOG_DEBUG("forced reopen of port 0x%016Lx on adapter %s\n", port->wwpn, zfcp_get_busid_by_port(port)); @@ -506,8 +497,6 @@ static int zfcp_erp_port_forced_reopen_internal(struct zfcp_port *port, ZFCP_LOG_DEBUG("skipped forced reopen of failed port 0x%016Lx " "on adapter %s\n", port->wwpn, zfcp_get_busid_by_port(port)); - debug_text_event(adapter->erp_dbf, 5, "pf_ro_f"); - debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); retval = -EIO; goto out; } @@ -560,10 +549,6 @@ static int zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask, u8 id, u64 ref) { int retval; - struct zfcp_adapter *adapter = port->adapter; - - debug_text_event(adapter->erp_dbf, 5, "p_ro"); - debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); ZFCP_LOG_DEBUG("reopen of port 0x%016Lx on adapter %s\n", port->wwpn, zfcp_get_busid_by_port(port)); @@ -574,8 +559,6 @@ static int zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask, ZFCP_LOG_DEBUG("skipped reopen of failed port 0x%016Lx " "on adapter %s\n", port->wwpn, zfcp_get_busid_by_port(port)); - debug_text_event(adapter->erp_dbf, 5, "p_ro_f"); - debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); /* ensure propagation of failed status to new devices */ zfcp_erp_port_failed(port, 14, 0); retval = -EIO; @@ -630,8 +613,6 @@ static int zfcp_erp_unit_reopen_internal(struct zfcp_unit *unit, int clear_mask, int retval; struct zfcp_adapter *adapter = unit->port->adapter; - debug_text_event(adapter->erp_dbf, 5, "u_ro"); - debug_event(adapter->erp_dbf, 5, &unit->fcp_lun, sizeof (fcp_lun_t)); ZFCP_LOG_DEBUG("reopen of unit 0x%016Lx on port 0x%016Lx " "on adapter %s\n", unit->fcp_lun, unit->port->wwpn, zfcp_get_busid_by_unit(unit)); @@ -643,9 +624,6 @@ static int zfcp_erp_unit_reopen_internal(struct zfcp_unit *unit, int clear_mask, "on port 0x%016Lx on adapter %s\n", unit->fcp_lun, unit->port->wwpn, zfcp_get_busid_by_unit(unit)); - debug_text_event(adapter->erp_dbf, 5, "u_ro_f"); - debug_event(adapter->erp_dbf, 5, &unit->fcp_lun, - sizeof (fcp_lun_t)); retval = -EIO; goto out; } @@ -690,7 +668,6 @@ int zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear_mask, u8 id, u64 ref) */ static void zfcp_erp_adapter_block(struct zfcp_adapter *adapter, int clear_mask) { - debug_text_event(adapter->erp_dbf, 6, "a_bl"); zfcp_erp_modify_adapter_status(adapter, 15, 0, ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, ZFCP_CLEAR); @@ -725,7 +702,6 @@ static int atomic_test_and_clear_mask(unsigned long mask, atomic_t *v) */ static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter) { - debug_text_event(adapter->erp_dbf, 6, "a_ubl"); if (atomic_test_and_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status)) zfcp_rec_dbf_event_adapter(16, 0, adapter); @@ -743,10 +719,6 @@ static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter) static void zfcp_erp_port_block(struct zfcp_port *port, int clear_mask) { - struct zfcp_adapter *adapter = port->adapter; - - debug_text_event(adapter->erp_dbf, 6, "p_bl"); - debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t)); zfcp_erp_modify_port_status(port, 17, 0, ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, ZFCP_CLEAR); @@ -762,10 +734,6 @@ zfcp_erp_port_block(struct zfcp_port *port, int clear_mask) static void zfcp_erp_port_unblock(struct zfcp_port *port) { - struct zfcp_adapter *adapter = port->adapter; - - debug_text_event(adapter->erp_dbf, 6, "p_ubl"); - debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t)); if (atomic_test_and_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status)) zfcp_rec_dbf_event_port(18, 0, port); @@ -783,10 +751,6 @@ zfcp_erp_port_unblock(struct zfcp_port *port) static void zfcp_erp_unit_block(struct zfcp_unit *unit, int clear_mask) { - struct zfcp_adapter *adapter = unit->port->adapter; - - debug_text_event(adapter->erp_dbf, 6, "u_bl"); - debug_event(adapter->erp_dbf, 6, &unit->fcp_lun, sizeof (fcp_lun_t)); zfcp_erp_modify_unit_status(unit, 19, 0, ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, ZFCP_CLEAR); @@ -802,10 +766,6 @@ zfcp_erp_unit_block(struct zfcp_unit *unit, int clear_mask) static void zfcp_erp_unit_unblock(struct zfcp_unit *unit) { - struct zfcp_adapter *adapter = unit->port->adapter; - - debug_text_event(adapter->erp_dbf, 6, "u_ubl"); - debug_event(adapter->erp_dbf, 6, &unit->fcp_lun, sizeof (fcp_lun_t)); if (atomic_test_and_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status)) zfcp_rec_dbf_event_unit(20, 0, unit); @@ -816,9 +776,6 @@ zfcp_erp_action_ready(struct zfcp_erp_action *erp_action) { struct zfcp_adapter *adapter = erp_action->adapter; - debug_text_event(adapter->erp_dbf, 4, "a_ar"); - debug_event(adapter->erp_dbf, 4, &erp_action->action, sizeof (int)); - zfcp_erp_action_to_ready(erp_action); up(&adapter->erp_ready_sem); zfcp_rec_dbf_event_thread(2, adapter, 0); @@ -883,14 +840,9 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action) if (zfcp_reqlist_find_safe(adapter, erp_action->fsf_req) && erp_action->fsf_req->erp_action == erp_action) { /* fsf_req still exists */ - debug_text_event(adapter->erp_dbf, 3, "a_ca_req"); - debug_event(adapter->erp_dbf, 3, &erp_action->fsf_req, - sizeof (unsigned long)); /* dismiss fsf_req of timed out/dismissed erp_action */ if (erp_action->status & (ZFCP_STATUS_ERP_DISMISSED | ZFCP_STATUS_ERP_TIMEDOUT)) { - debug_text_event(adapter->erp_dbf, 3, - "a_ca_disreq"); erp_action->fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; zfcp_rec_dbf_event_action(142, erp_action); @@ -915,7 +867,6 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action) erp_action->fsf_req = NULL; } } else { - debug_text_event(adapter->erp_dbf, 3, "a_ca_gonereq"); /* * even if this fsf_req has gone, forget about * association between erp_action and fsf_req @@ -923,8 +874,7 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action) erp_action->fsf_req = NULL; } spin_unlock(&adapter->req_list_lock); - } else - debug_text_event(adapter->erp_dbf, 3, "a_ca_noreq"); + } } /** @@ -936,19 +886,11 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action) static void zfcp_erp_async_handler_nolock(struct zfcp_erp_action *erp_action, unsigned long set_mask) { - struct zfcp_adapter *adapter = erp_action->adapter; - if (zfcp_erp_action_exists(erp_action) == ZFCP_ERP_ACTION_RUNNING) { - debug_text_event(adapter->erp_dbf, 2, "a_asyh_ex"); - debug_event(adapter->erp_dbf, 2, &erp_action->action, - sizeof (int)); erp_action->status |= set_mask; zfcp_erp_action_ready(erp_action); } else { /* action is ready or gone - nothing to do */ - debug_text_event(adapter->erp_dbf, 3, "a_asyh_gone"); - debug_event(adapter->erp_dbf, 3, &erp_action->action, - sizeof (int)); } } @@ -975,10 +917,6 @@ static void zfcp_erp_memwait_handler(unsigned long data) { struct zfcp_erp_action *erp_action = (struct zfcp_erp_action *) data; - struct zfcp_adapter *adapter = erp_action->adapter; - - debug_text_event(adapter->erp_dbf, 2, "a_mwh"); - debug_event(adapter->erp_dbf, 2, &erp_action->action, sizeof (int)); zfcp_erp_async_handler(erp_action, 0); } @@ -991,10 +929,6 @@ zfcp_erp_memwait_handler(unsigned long data) static void zfcp_erp_timeout_handler(unsigned long data) { struct zfcp_erp_action *erp_action = (struct zfcp_erp_action *) data; - struct zfcp_adapter *adapter = erp_action->adapter; - - debug_text_event(adapter->erp_dbf, 2, "a_th"); - debug_event(adapter->erp_dbf, 2, &erp_action->action, sizeof (int)); zfcp_erp_async_handler(erp_action, ZFCP_STATUS_ERP_TIMEDOUT); } @@ -1009,11 +943,6 @@ static void zfcp_erp_timeout_handler(unsigned long data) */ static void zfcp_erp_action_dismiss(struct zfcp_erp_action *erp_action) { - struct zfcp_adapter *adapter = erp_action->adapter; - - debug_text_event(adapter->erp_dbf, 2, "a_adis"); - debug_event(adapter->erp_dbf, 2, &erp_action->action, sizeof (int)); - erp_action->status |= ZFCP_STATUS_ERP_DISMISSED; if (zfcp_erp_action_exists(erp_action) == ZFCP_ERP_ACTION_RUNNING) zfcp_erp_action_ready(erp_action); @@ -1031,12 +960,10 @@ zfcp_erp_thread_setup(struct zfcp_adapter *adapter) ZFCP_LOG_NORMAL("error: creation of erp thread failed for " "adapter %s\n", zfcp_get_busid_by_adapter(adapter)); - debug_text_event(adapter->erp_dbf, 5, "a_thset_fail"); } else { wait_event(adapter->erp_thread_wqh, atomic_test_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status)); - debug_text_event(adapter->erp_dbf, 5, "a_thset_ok"); } return (retval < 0); @@ -1072,8 +999,6 @@ zfcp_erp_thread_kill(struct zfcp_adapter *adapter) atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL, &adapter->status); - debug_text_event(adapter->erp_dbf, 5, "a_thki_ok"); - return retval; } @@ -1096,7 +1021,6 @@ zfcp_erp_thread(void *data) /* Block all signals */ siginitsetinv(¤t->blocked, 0); atomic_set_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status); - debug_text_event(adapter->erp_dbf, 5, "a_th_run"); wake_up(&adapter->erp_thread_wqh); while (!atomic_test_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL, @@ -1124,11 +1048,9 @@ zfcp_erp_thread(void *data) zfcp_rec_dbf_event_thread(4, adapter, 1); down_interruptible(&adapter->erp_ready_sem); zfcp_rec_dbf_event_thread(5, adapter, 1); - debug_text_event(adapter->erp_dbf, 5, "a_th_woken"); } atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status); - debug_text_event(adapter->erp_dbf, 5, "a_th_stop"); wake_up(&adapter->erp_thread_wqh); return 0; @@ -1164,7 +1086,6 @@ zfcp_erp_strategy(struct zfcp_erp_action *erp_action) /* dequeue dismissed action and leave, if required */ retval = zfcp_erp_strategy_check_action(erp_action, retval); if (retval == ZFCP_ERP_DISMISSED) { - debug_text_event(adapter->erp_dbf, 4, "a_st_dis1"); goto unlock; } @@ -1215,20 +1136,17 @@ zfcp_erp_strategy(struct zfcp_erp_action *erp_action) element was timed out. */ if (adapter->erp_total_count == adapter->erp_low_mem_count) { - debug_text_event(adapter->erp_dbf, 3, "a_st_lowmem"); ZFCP_LOG_NORMAL("error: no mempool elements available, " "restarting I/O on adapter %s " "to free mempool\n", zfcp_get_busid_by_adapter(adapter)); zfcp_erp_adapter_reopen_internal(adapter, 0, 66, 0); } else { - debug_text_event(adapter->erp_dbf, 2, "a_st_memw"); retval = zfcp_erp_strategy_memwait(erp_action); } goto unlock; case ZFCP_ERP_CONTINUES: /* leave since this action runs asynchronously */ - debug_text_event(adapter->erp_dbf, 6, "a_st_cont"); if (erp_action->status & ZFCP_STATUS_ERP_LOWMEM) { --adapter->erp_low_mem_count; erp_action->status &= ~ZFCP_STATUS_ERP_LOWMEM; @@ -1257,7 +1175,6 @@ zfcp_erp_strategy(struct zfcp_erp_action *erp_action) * action is repeated in order to process state change */ if (retval == ZFCP_ERP_EXIT) { - debug_text_event(adapter->erp_dbf, 2, "a_st_exit"); goto unlock; } @@ -1283,8 +1200,6 @@ zfcp_erp_strategy(struct zfcp_erp_action *erp_action) if (retval != ZFCP_ERP_DISMISSED) zfcp_erp_strategy_check_queues(adapter); - debug_text_event(adapter->erp_dbf, 6, "a_st_done"); - return retval; } @@ -1299,17 +1214,12 @@ zfcp_erp_strategy(struct zfcp_erp_action *erp_action) static int zfcp_erp_strategy_check_action(struct zfcp_erp_action *erp_action, int retval) { - struct zfcp_adapter *adapter = erp_action->adapter; - zfcp_erp_strategy_check_fsfreq(erp_action); - debug_event(adapter->erp_dbf, 5, &erp_action->action, sizeof (int)); if (erp_action->status & ZFCP_STATUS_ERP_DISMISSED) { - debug_text_event(adapter->erp_dbf, 3, "a_stcd_dis"); zfcp_erp_action_dequeue(erp_action); retval = ZFCP_ERP_DISMISSED; - } else - debug_text_event(adapter->erp_dbf, 5, "a_stcd_nodis"); + } return retval; } @@ -1318,7 +1228,6 @@ static int zfcp_erp_strategy_do_action(struct zfcp_erp_action *erp_action) { int retval = ZFCP_ERP_FAILED; - struct zfcp_adapter *adapter = erp_action->adapter; /* * try to execute/continue action as far as possible, @@ -1348,9 +1257,6 @@ zfcp_erp_strategy_do_action(struct zfcp_erp_action *erp_action) break; default: - debug_text_exception(adapter->erp_dbf, 1, "a_stda_bug"); - debug_event(adapter->erp_dbf, 1, &erp_action->action, - sizeof (int)); ZFCP_LOG_NORMAL("bug: unknown erp action requested on " "adapter %s (action=%d)\n", zfcp_get_busid_by_adapter(erp_action->adapter), @@ -1372,10 +1278,7 @@ static int zfcp_erp_strategy_memwait(struct zfcp_erp_action *erp_action) { int retval = ZFCP_ERP_CONTINUES; - struct zfcp_adapter *adapter = erp_action->adapter; - debug_text_event(adapter->erp_dbf, 6, "a_mwinit"); - debug_event(adapter->erp_dbf, 6, &erp_action->action, sizeof (int)); init_timer(&erp_action->timer); erp_action->timer.function = zfcp_erp_memwait_handler; erp_action->timer.data = (unsigned long) erp_action; @@ -1398,7 +1301,6 @@ zfcp_erp_adapter_failed(struct zfcp_adapter *adapter, u8 id, u64 ref) ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); ZFCP_LOG_NORMAL("adapter erp failed on adapter %s\n", zfcp_get_busid_by_adapter(adapter)); - debug_text_event(adapter->erp_dbf, 2, "a_afail"); } /* @@ -1420,9 +1322,6 @@ zfcp_erp_port_failed(struct zfcp_port *port, u8 id, u64 ref) else ZFCP_LOG_NORMAL("port erp failed (adapter %s, wwpn=0x%016Lx)\n", zfcp_get_busid_by_port(port), port->wwpn); - - debug_text_event(port->adapter->erp_dbf, 2, "p_pfail"); - debug_event(port->adapter->erp_dbf, 2, &port->wwpn, sizeof (wwn_t)); } /* @@ -1440,9 +1339,6 @@ zfcp_erp_unit_failed(struct zfcp_unit *unit, u8 id, u64 ref) ZFCP_LOG_NORMAL("unit erp failed on unit 0x%016Lx on port 0x%016Lx " " on adapter %s\n", unit->fcp_lun, unit->port->wwpn, zfcp_get_busid_by_unit(unit)); - debug_text_event(unit->port->adapter->erp_dbf, 2, "u_ufail"); - debug_event(unit->port->adapter->erp_dbf, 2, - &unit->fcp_lun, sizeof (fcp_lun_t)); } /* @@ -1466,10 +1362,6 @@ zfcp_erp_strategy_check_target(struct zfcp_erp_action *erp_action, int result) struct zfcp_port *port = erp_action->port; struct zfcp_unit *unit = erp_action->unit; - debug_text_event(adapter->erp_dbf, 5, "a_stct_norm"); - debug_event(adapter->erp_dbf, 5, &erp_action->action, sizeof (int)); - debug_event(adapter->erp_dbf, 5, &result, sizeof (int)); - switch (erp_action->action) { case ZFCP_ERP_ACTION_REOPEN_UNIT: @@ -1496,9 +1388,6 @@ zfcp_erp_strategy_statechange(int action, struct zfcp_port *port, struct zfcp_unit *unit, int retval) { - debug_text_event(adapter->erp_dbf, 3, "a_stsc"); - debug_event(adapter->erp_dbf, 3, &action, sizeof (int)); - switch (action) { case ZFCP_ERP_ACTION_REOPEN_ADAPTER: @@ -1551,10 +1440,6 @@ zfcp_erp_strategy_statechange_detected(atomic_t * target_status, u32 erp_status) static int zfcp_erp_strategy_check_unit(struct zfcp_unit *unit, int result) { - debug_text_event(unit->port->adapter->erp_dbf, 5, "u_stct"); - debug_event(unit->port->adapter->erp_dbf, 5, &unit->fcp_lun, - sizeof (fcp_lun_t)); - switch (result) { case ZFCP_ERP_SUCCEEDED : atomic_set(&unit->erp_counter, 0); @@ -1581,9 +1466,6 @@ zfcp_erp_strategy_check_unit(struct zfcp_unit *unit, int result) static int zfcp_erp_strategy_check_port(struct zfcp_port *port, int result) { - debug_text_event(port->adapter->erp_dbf, 5, "p_stct"); - debug_event(port->adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); - switch (result) { case ZFCP_ERP_SUCCEEDED : atomic_set(&port->erp_counter, 0); @@ -1610,8 +1492,6 @@ zfcp_erp_strategy_check_port(struct zfcp_port *port, int result) static int zfcp_erp_strategy_check_adapter(struct zfcp_adapter *adapter, int result) { - debug_text_event(adapter->erp_dbf, 5, "a_stct"); - switch (result) { case ZFCP_ERP_SUCCEEDED : atomic_set(&adapter->erp_counter, 0); @@ -1703,9 +1583,6 @@ zfcp_erp_strategy_followup_actions(int action, struct zfcp_port *port, struct zfcp_unit *unit, int status) { - debug_text_event(adapter->erp_dbf, 5, "a_stfol"); - debug_event(adapter->erp_dbf, 5, &action, sizeof (int)); - /* initiate follow-up actions depending on success of finished action */ switch (action) { @@ -1749,12 +1626,10 @@ zfcp_erp_strategy_check_queues(struct zfcp_adapter *adapter) read_lock(&adapter->erp_lock); if (list_empty(&adapter->erp_ready_head) && list_empty(&adapter->erp_running_head)) { - debug_text_event(adapter->erp_dbf, 4, "a_cq_wake"); atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_PENDING, &adapter->status); wake_up(&adapter->erp_done_wqh); - } else - debug_text_event(adapter->erp_dbf, 5, "a_cq_notempty"); + } read_unlock(&adapter->erp_lock); read_unlock_irqrestore(&zfcp_data.config_lock, flags); @@ -1786,16 +1661,13 @@ void zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, u8 id, if (set_or_clear == ZFCP_SET) { changed = atomic_test_and_set_mask(mask, &adapter->status); - debug_text_event(adapter->erp_dbf, 3, "a_mod_as_s"); } else { changed = atomic_test_and_clear_mask(mask, &adapter->status); if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) atomic_set(&adapter->erp_counter, 0); - debug_text_event(adapter->erp_dbf, 3, "a_mod_as_c"); } if (changed) zfcp_rec_dbf_event_adapter(id, ref, adapter); - debug_event(adapter->erp_dbf, 3, &mask, sizeof (u32)); /* Deal with all underlying devices, only pass common_mask */ if (common_mask) @@ -1818,17 +1690,13 @@ void zfcp_erp_modify_port_status(struct zfcp_port *port, u8 id, u64 ref, if (set_or_clear == ZFCP_SET) { changed = atomic_test_and_set_mask(mask, &port->status); - debug_text_event(port->adapter->erp_dbf, 3, "p_mod_ps_s"); } else { changed = atomic_test_and_clear_mask(mask, &port->status); if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) atomic_set(&port->erp_counter, 0); - debug_text_event(port->adapter->erp_dbf, 3, "p_mod_ps_c"); } if (changed) zfcp_rec_dbf_event_port(id, ref, port); - debug_event(port->adapter->erp_dbf, 3, &port->wwpn, sizeof (wwn_t)); - debug_event(port->adapter->erp_dbf, 3, &mask, sizeof (u32)); /* Modify status of all underlying devices, only pass common mask */ if (common_mask) @@ -1850,19 +1718,14 @@ void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, u8 id, u64 ref, if (set_or_clear == ZFCP_SET) { changed = atomic_test_and_set_mask(mask, &unit->status); - debug_text_event(unit->port->adapter->erp_dbf, 3, "u_mod_us_s"); } else { changed = atomic_test_and_clear_mask(mask, &unit->status); if (mask & ZFCP_STATUS_COMMON_ERP_FAILED) { atomic_set(&unit->erp_counter, 0); } - debug_text_event(unit->port->adapter->erp_dbf, 3, "u_mod_us_c"); } if (changed) zfcp_rec_dbf_event_unit(id, ref, unit); - debug_event(unit->port->adapter->erp_dbf, 3, &unit->fcp_lun, - sizeof (fcp_lun_t)); - debug_event(unit->port->adapter->erp_dbf, 3, &mask, sizeof (u32)); } /* @@ -1946,10 +1809,6 @@ zfcp_erp_adapter_strategy(struct zfcp_erp_action *erp_action) else retval = zfcp_erp_adapter_strategy_open(erp_action); - debug_text_event(adapter->erp_dbf, 3, "a_ast/ret"); - debug_event(adapter->erp_dbf, 3, &erp_action->action, sizeof (int)); - debug_event(adapter->erp_dbf, 3, &retval, sizeof (int)); - if (retval == ZFCP_ERP_FAILED) { ZFCP_LOG_INFO("Waiting to allow the adapter %s " "to recover itself\n", @@ -2075,7 +1934,6 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action) zfcp_get_busid_by_adapter(adapter)); goto failed_qdio_establish; } - debug_text_event(adapter->erp_dbf, 3, "qdio_est"); if (qdio_activate(adapter->ccw_device, 0) != 0) { ZFCP_LOG_INFO("error: activation of QDIO queues failed " @@ -2083,7 +1941,6 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action) zfcp_get_busid_by_adapter(adapter)); goto failed_qdio_activate; } - debug_text_event(adapter->erp_dbf, 3, "qdio_act"); /* * put buffers into response queue, @@ -2131,11 +1988,9 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action) /* NOP */ failed_qdio_activate: - debug_text_event(adapter->erp_dbf, 3, "qdio_down1a"); while (qdio_shutdown(adapter->ccw_device, QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS) ssleep(1); - debug_text_event(adapter->erp_dbf, 3, "qdio_down1b"); failed_qdio_establish: failed_sanity: @@ -2181,14 +2036,12 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) write_unlock_irq(&adapter->erp_lock); if (zfcp_fsf_exchange_config_data(erp_action)) { retval = ZFCP_ERP_FAILED; - debug_text_event(adapter->erp_dbf, 5, "a_fstx_xf"); ZFCP_LOG_INFO("error: initiation of exchange of " "configuration data failed for " "adapter %s\n", zfcp_get_busid_by_adapter(adapter)); break; } - debug_text_event(adapter->erp_dbf, 6, "a_fstx_xok"); ZFCP_LOG_DEBUG("Xchange underway\n"); /* @@ -2254,13 +2107,10 @@ zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action) ret = zfcp_fsf_exchange_port_data(erp_action); if (ret == -EOPNOTSUPP) { - debug_text_event(adapter->erp_dbf, 3, "a_xport_notsupp"); return ZFCP_ERP_SUCCEEDED; } else if (ret) { - debug_text_event(adapter->erp_dbf, 3, "a_xport_failed"); return ZFCP_ERP_FAILED; } - debug_text_event(adapter->erp_dbf, 6, "a_xport_ok"); ret = ZFCP_ERP_SUCCEEDED; zfcp_rec_dbf_event_thread(8, adapter, 1); @@ -2319,7 +2169,6 @@ zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action) { int retval = ZFCP_ERP_FAILED; struct zfcp_port *port = erp_action->port; - struct zfcp_adapter *adapter = erp_action->adapter; switch (erp_action->step) { @@ -2356,11 +2205,6 @@ zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action) break; } - debug_text_event(adapter->erp_dbf, 3, "p_pfst/ret"); - debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof (wwn_t)); - debug_event(adapter->erp_dbf, 3, &erp_action->action, sizeof (int)); - debug_event(adapter->erp_dbf, 3, &retval, sizeof (int)); - return retval; } @@ -2378,7 +2222,6 @@ zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action) { int retval = ZFCP_ERP_FAILED; struct zfcp_port *port = erp_action->port; - struct zfcp_adapter *adapter = erp_action->adapter; switch (erp_action->step) { @@ -2411,11 +2254,6 @@ zfcp_erp_port_strategy(struct zfcp_erp_action *erp_action) retval = zfcp_erp_port_strategy_open(erp_action); out: - debug_text_event(adapter->erp_dbf, 3, "p_pst/ret"); - debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof (wwn_t)); - debug_event(adapter->erp_dbf, 3, &erp_action->action, sizeof (int)); - debug_event(adapter->erp_dbf, 3, &retval, sizeof (int)); - return retval; } @@ -2607,13 +2445,7 @@ zfcp_erp_port_strategy_open_nameserver_wakeup(struct zfcp_erp_action read_lock_irqsave(&adapter->erp_lock, flags); list_for_each_entry_safe(erp_action, tmp, &adapter->erp_running_head, list) { - debug_text_event(adapter->erp_dbf, 4, "p_pstnsw_n"); - debug_event(adapter->erp_dbf, 4, &erp_action->port->wwpn, - sizeof (wwn_t)); if (erp_action->step == ZFCP_ERP_STEP_NAMESERVER_OPEN) { - debug_text_event(adapter->erp_dbf, 3, "p_pstnsw_w"); - debug_event(adapter->erp_dbf, 3, - &erp_action->port->wwpn, sizeof (wwn_t)); if (atomic_test_mask( ZFCP_STATUS_COMMON_ERP_FAILED, &adapter->nameserver_port->status)) @@ -2638,26 +2470,18 @@ static int zfcp_erp_port_forced_strategy_close(struct zfcp_erp_action *erp_action) { int retval; - struct zfcp_adapter *adapter = erp_action->adapter; - struct zfcp_port *port = erp_action->port; retval = zfcp_fsf_close_physical_port(erp_action); if (retval == -ENOMEM) { - debug_text_event(adapter->erp_dbf, 5, "o_pfstc_nomem"); - debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); retval = ZFCP_ERP_NOMEM; goto out; } erp_action->step = ZFCP_ERP_STEP_PHYS_PORT_CLOSING; if (retval != 0) { - debug_text_event(adapter->erp_dbf, 5, "o_pfstc_cpf"); - debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); /* could not send 'open', fail */ retval = ZFCP_ERP_FAILED; goto out; } - debug_text_event(adapter->erp_dbf, 6, "o_pfstc_cpok"); - debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t)); retval = ZFCP_ERP_CONTINUES; out: return retval; @@ -2667,10 +2491,6 @@ static int zfcp_erp_port_strategy_clearstati(struct zfcp_port *port) { int retval = 0; - struct zfcp_adapter *adapter = port->adapter; - - debug_text_event(adapter->erp_dbf, 5, "p_pstclst"); - debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); atomic_clear_mask(ZFCP_STATUS_COMMON_OPENING | ZFCP_STATUS_COMMON_CLOSING | @@ -2694,26 +2514,18 @@ static int zfcp_erp_port_strategy_close(struct zfcp_erp_action *erp_action) { int retval; - struct zfcp_adapter *adapter = erp_action->adapter; - struct zfcp_port *port = erp_action->port; retval = zfcp_fsf_close_port(erp_action); if (retval == -ENOMEM) { - debug_text_event(adapter->erp_dbf, 5, "p_pstc_nomem"); - debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); retval = ZFCP_ERP_NOMEM; goto out; } erp_action->step = ZFCP_ERP_STEP_PORT_CLOSING; if (retval != 0) { - debug_text_event(adapter->erp_dbf, 5, "p_pstc_cpf"); - debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); /* could not send 'close', fail */ retval = ZFCP_ERP_FAILED; goto out; } - debug_text_event(adapter->erp_dbf, 6, "p_pstc_cpok"); - debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t)); retval = ZFCP_ERP_CONTINUES; out: return retval; @@ -2731,26 +2543,18 @@ static int zfcp_erp_port_strategy_open_port(struct zfcp_erp_action *erp_action) { int retval; - struct zfcp_adapter *adapter = erp_action->adapter; - struct zfcp_port *port = erp_action->port; retval = zfcp_fsf_open_port(erp_action); if (retval == -ENOMEM) { - debug_text_event(adapter->erp_dbf, 5, "p_psto_nomem"); - debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); retval = ZFCP_ERP_NOMEM; goto out; } erp_action->step = ZFCP_ERP_STEP_PORT_OPENING; if (retval != 0) { - debug_text_event(adapter->erp_dbf, 5, "p_psto_opf"); - debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); /* could not send 'open', fail */ retval = ZFCP_ERP_FAILED; goto out; } - debug_text_event(adapter->erp_dbf, 6, "p_psto_opok"); - debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t)); retval = ZFCP_ERP_CONTINUES; out: return retval; @@ -2768,26 +2572,18 @@ static int zfcp_erp_port_strategy_open_common_lookup(struct zfcp_erp_action *erp_action) { int retval; - struct zfcp_adapter *adapter = erp_action->adapter; - struct zfcp_port *port = erp_action->port; retval = zfcp_ns_gid_pn_request(erp_action); if (retval == -ENOMEM) { - debug_text_event(adapter->erp_dbf, 5, "p_pstn_nomem"); - debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); retval = ZFCP_ERP_NOMEM; goto out; } erp_action->step = ZFCP_ERP_STEP_NAMESERVER_LOOKUP; if (retval != 0) { - debug_text_event(adapter->erp_dbf, 5, "p_pstn_ref"); - debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); /* could not send nameserver request, fail */ retval = ZFCP_ERP_FAILED; goto out; } - debug_text_event(adapter->erp_dbf, 6, "p_pstn_reok"); - debug_event(adapter->erp_dbf, 6, &port->wwpn, sizeof (wwn_t)); retval = ZFCP_ERP_CONTINUES; out: return retval; @@ -2808,7 +2604,6 @@ zfcp_erp_unit_strategy(struct zfcp_erp_action *erp_action) { int retval = ZFCP_ERP_FAILED; struct zfcp_unit *unit = erp_action->unit; - struct zfcp_adapter *adapter = erp_action->adapter; switch (erp_action->step) { @@ -2855,10 +2650,6 @@ zfcp_erp_unit_strategy(struct zfcp_erp_action *erp_action) break; } - debug_text_event(adapter->erp_dbf, 3, "u_ust/ret"); - debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof (fcp_lun_t)); - debug_event(adapter->erp_dbf, 3, &erp_action->action, sizeof (int)); - debug_event(adapter->erp_dbf, 3, &retval, sizeof (int)); return retval; } @@ -2866,10 +2657,6 @@ static int zfcp_erp_unit_strategy_clearstati(struct zfcp_unit *unit) { int retval = 0; - struct zfcp_adapter *adapter = unit->port->adapter; - - debug_text_event(adapter->erp_dbf, 5, "u_ustclst"); - debug_event(adapter->erp_dbf, 5, &unit->fcp_lun, sizeof (fcp_lun_t)); atomic_clear_mask(ZFCP_STATUS_COMMON_OPENING | ZFCP_STATUS_COMMON_CLOSING | @@ -2893,28 +2680,18 @@ static int zfcp_erp_unit_strategy_close(struct zfcp_erp_action *erp_action) { int retval; - struct zfcp_adapter *adapter = erp_action->adapter; - struct zfcp_unit *unit = erp_action->unit; retval = zfcp_fsf_close_unit(erp_action); if (retval == -ENOMEM) { - debug_text_event(adapter->erp_dbf, 5, "u_ustc_nomem"); - debug_event(adapter->erp_dbf, 5, &unit->fcp_lun, - sizeof (fcp_lun_t)); retval = ZFCP_ERP_NOMEM; goto out; } erp_action->step = ZFCP_ERP_STEP_UNIT_CLOSING; if (retval != 0) { - debug_text_event(adapter->erp_dbf, 5, "u_ustc_cuf"); - debug_event(adapter->erp_dbf, 5, &unit->fcp_lun, - sizeof (fcp_lun_t)); /* could not send 'close', fail */ retval = ZFCP_ERP_FAILED; goto out; } - debug_text_event(adapter->erp_dbf, 6, "u_ustc_cuok"); - debug_event(adapter->erp_dbf, 6, &unit->fcp_lun, sizeof (fcp_lun_t)); retval = ZFCP_ERP_CONTINUES; out: @@ -2933,28 +2710,18 @@ static int zfcp_erp_unit_strategy_open(struct zfcp_erp_action *erp_action) { int retval; - struct zfcp_adapter *adapter = erp_action->adapter; - struct zfcp_unit *unit = erp_action->unit; retval = zfcp_fsf_open_unit(erp_action); if (retval == -ENOMEM) { - debug_text_event(adapter->erp_dbf, 5, "u_usto_nomem"); - debug_event(adapter->erp_dbf, 5, &unit->fcp_lun, - sizeof (fcp_lun_t)); retval = ZFCP_ERP_NOMEM; goto out; } erp_action->step = ZFCP_ERP_STEP_UNIT_OPENING; if (retval != 0) { - debug_text_event(adapter->erp_dbf, 5, "u_usto_ouf"); - debug_event(adapter->erp_dbf, 5, &unit->fcp_lun, - sizeof (fcp_lun_t)); /* could not send 'open', fail */ retval = ZFCP_ERP_FAILED; goto out; } - debug_text_event(adapter->erp_dbf, 6, "u_usto_ouok"); - debug_event(adapter->erp_dbf, 6, &unit->fcp_lun, sizeof (fcp_lun_t)); retval = ZFCP_ERP_CONTINUES; out: return retval; @@ -3000,17 +2767,11 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, &adapter->status)) return -EIO; - debug_event(adapter->erp_dbf, 4, &want, sizeof (int)); /* check whether we really need this */ switch (want) { case ZFCP_ERP_ACTION_REOPEN_UNIT: if (atomic_test_mask (ZFCP_STATUS_COMMON_ERP_INUSE, &unit->status)) { - debug_text_event(adapter->erp_dbf, 4, "u_actenq_drp"); - debug_event(adapter->erp_dbf, 4, &port->wwpn, - sizeof (wwn_t)); - debug_event(adapter->erp_dbf, 4, &unit->fcp_lun, - sizeof (fcp_lun_t)); goto out; } if (!atomic_test_mask @@ -3027,9 +2788,6 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, case ZFCP_ERP_ACTION_REOPEN_PORT: if (atomic_test_mask (ZFCP_STATUS_COMMON_ERP_INUSE, &port->status)) { - debug_text_event(adapter->erp_dbf, 4, "p_actenq_drp"); - debug_event(adapter->erp_dbf, 4, &port->wwpn, - sizeof (wwn_t)); goto out; } /* fall through !!! */ @@ -3043,13 +2801,7 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, "0x%016Lx, action in use: %i)\n", want, port->wwpn, port->erp_action.action); - debug_text_event(adapter->erp_dbf, 4, - "pf_actenq_drp"); - } else - debug_text_event(adapter->erp_dbf, 4, - "pf_actenq_drpcp"); - debug_event(adapter->erp_dbf, 4, &port->wwpn, - sizeof (wwn_t)); + } goto out; } if (!atomic_test_mask @@ -3066,14 +2818,11 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, case ZFCP_ERP_ACTION_REOPEN_ADAPTER: if (atomic_test_mask (ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status)) { - debug_text_event(adapter->erp_dbf, 4, "a_actenq_drp"); goto out; } break; default: - debug_text_exception(adapter->erp_dbf, 1, "a_actenq_bug"); - debug_event(adapter->erp_dbf, 1, &want, sizeof (int)); ZFCP_LOG_NORMAL("bug: unknown erp action requested " "on adapter %s (action=%d)\n", zfcp_get_busid_by_adapter(adapter), want); @@ -3082,9 +2831,6 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, /* check whether we need something stronger first */ if (need) { - debug_text_event(adapter->erp_dbf, 4, "a_actenq_str"); - debug_event(adapter->erp_dbf, 4, &need, - sizeof (int)); ZFCP_LOG_DEBUG("stronger erp action %d needed before " "erp action %d on adapter %s\n", need, want, zfcp_get_busid_by_adapter(adapter)); @@ -3127,8 +2873,6 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, break; } - debug_text_event(adapter->erp_dbf, 4, "a_actenq"); - memset(erp_action, 0, sizeof (struct zfcp_erp_action)); erp_action->adapter = adapter; erp_action->port = port; @@ -3161,8 +2905,6 @@ zfcp_erp_action_dequeue(struct zfcp_erp_action *erp_action) erp_action->status &= ~ZFCP_STATUS_ERP_LOWMEM; } - debug_text_event(adapter->erp_dbf, 4, "a_actdeq"); - debug_event(adapter->erp_dbf, 4, &erp_action->action, sizeof (int)); list_del(&erp_action->list); zfcp_rec_dbf_event_action(144, erp_action); @@ -3270,7 +3012,6 @@ static void zfcp_erp_action_dismiss_adapter(struct zfcp_adapter *adapter) { struct zfcp_port *port; - debug_text_event(adapter->erp_dbf, 5, "a_actab"); if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status)) zfcp_erp_action_dismiss(&adapter->erp_action); else @@ -3281,10 +3022,7 @@ static void zfcp_erp_action_dismiss_adapter(struct zfcp_adapter *adapter) static void zfcp_erp_action_dismiss_port(struct zfcp_port *port) { struct zfcp_unit *unit; - struct zfcp_adapter *adapter = port->adapter; - debug_text_event(adapter->erp_dbf, 5, "p_actab"); - debug_event(adapter->erp_dbf, 5, &port->wwpn, sizeof (wwn_t)); if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &port->status)) zfcp_erp_action_dismiss(&port->erp_action); else @@ -3294,41 +3032,26 @@ static void zfcp_erp_action_dismiss_port(struct zfcp_port *port) static void zfcp_erp_action_dismiss_unit(struct zfcp_unit *unit) { - struct zfcp_adapter *adapter = unit->port->adapter; - - debug_text_event(adapter->erp_dbf, 5, "u_actab"); - debug_event(adapter->erp_dbf, 5, &unit->fcp_lun, sizeof (fcp_lun_t)); if (atomic_test_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &unit->status)) zfcp_erp_action_dismiss(&unit->erp_action); } static void zfcp_erp_action_to_running(struct zfcp_erp_action *erp_action) { - struct zfcp_adapter *adapter = erp_action->adapter; - - debug_text_event(adapter->erp_dbf, 6, "a_toru"); - debug_event(adapter->erp_dbf, 6, &erp_action->action, sizeof (int)); list_move(&erp_action->list, &erp_action->adapter->erp_running_head); zfcp_rec_dbf_event_action(145, erp_action); } static void zfcp_erp_action_to_ready(struct zfcp_erp_action *erp_action) { - struct zfcp_adapter *adapter = erp_action->adapter; - - debug_text_event(adapter->erp_dbf, 6, "a_tore"); - debug_event(adapter->erp_dbf, 6, &erp_action->action, sizeof (int)); list_move(&erp_action->list, &erp_action->adapter->erp_ready_head); zfcp_rec_dbf_event_action(146, erp_action); } void zfcp_erp_port_boxed(struct zfcp_port *port, u8 id, u64 ref) { - struct zfcp_adapter *adapter = port->adapter; unsigned long flags; - debug_text_event(adapter->erp_dbf, 3, "p_access_boxed"); - debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); read_lock_irqsave(&zfcp_data.config_lock, flags); zfcp_erp_modify_port_status(port, id, ref, ZFCP_STATUS_COMMON_ACCESS_BOXED, ZFCP_SET); @@ -3338,10 +3061,6 @@ void zfcp_erp_port_boxed(struct zfcp_port *port, u8 id, u64 ref) void zfcp_erp_unit_boxed(struct zfcp_unit *unit, u8 id, u64 ref) { - struct zfcp_adapter *adapter = unit->port->adapter; - - debug_text_event(adapter->erp_dbf, 3, "u_access_boxed"); - debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); zfcp_erp_modify_unit_status(unit, id, ref, ZFCP_STATUS_COMMON_ACCESS_BOXED, ZFCP_SET); zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED, id, ref); @@ -3349,11 +3068,8 @@ void zfcp_erp_unit_boxed(struct zfcp_unit *unit, u8 id, u64 ref) void zfcp_erp_port_access_denied(struct zfcp_port *port, u8 id, u64 ref) { - struct zfcp_adapter *adapter = port->adapter; unsigned long flags; - debug_text_event(adapter->erp_dbf, 3, "p_access_denied"); - debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); read_lock_irqsave(&zfcp_data.config_lock, flags); zfcp_erp_modify_port_status(port, id, ref, ZFCP_STATUS_COMMON_ERP_FAILED | @@ -3363,10 +3079,6 @@ void zfcp_erp_port_access_denied(struct zfcp_port *port, u8 id, u64 ref) void zfcp_erp_unit_access_denied(struct zfcp_unit *unit, u8 id, u64 ref) { - struct zfcp_adapter *adapter = unit->port->adapter; - - debug_text_event(adapter->erp_dbf, 3, "u_access_denied"); - debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); zfcp_erp_modify_unit_status(unit, id, ref, ZFCP_STATUS_COMMON_ERP_FAILED | ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); @@ -3381,9 +3093,6 @@ void zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter, u8 id, if (adapter->connection_features & FSF_FEATURE_NPIV_MODE) return; - debug_text_event(adapter->erp_dbf, 3, "a_access_recover"); - debug_event(adapter->erp_dbf, 3, zfcp_get_busid_by_adapter(adapter), 8); - read_lock_irqsave(&zfcp_data.config_lock, flags); if (adapter->nameserver_port) zfcp_erp_port_access_changed(adapter->nameserver_port, id, ref); @@ -3398,9 +3107,6 @@ void zfcp_erp_port_access_changed(struct zfcp_port *port, u8 id, u64 ref) struct zfcp_adapter *adapter = port->adapter; struct zfcp_unit *unit; - debug_text_event(adapter->erp_dbf, 3, "p_access_recover"); - debug_event(adapter->erp_dbf, 3, &port->wwpn, sizeof(wwn_t)); - if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, &port->status) && !atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_BOXED, @@ -3424,9 +3130,6 @@ void zfcp_erp_unit_access_changed(struct zfcp_unit *unit, u8 id, u64 ref) { struct zfcp_adapter *adapter = unit->port->adapter; - debug_text_event(adapter->erp_dbf, 3, "u_access_recover"); - debug_event(adapter->erp_dbf, 3, &unit->fcp_lun, sizeof(fcp_lun_t)); - if (!atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, &unit->status) && !atomic_test_mask(ZFCP_STATUS_COMMON_ACCESS_BOXED, diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index ffdf99736a4..b7aa9696ba6 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -799,19 +799,14 @@ zfcp_fsf_status_read_port_closed(struct zfcp_fsf_req *fsf_req) switch (status_buffer->status_subtype) { case FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT: - debug_text_event(adapter->erp_dbf, 3, "unsol_pc_phys:"); zfcp_erp_port_reopen(port, 0, 101, (u64)fsf_req); break; case FSF_STATUS_READ_SUB_ERROR_PORT: - debug_text_event(adapter->erp_dbf, 1, "unsol_pc_err:"); zfcp_erp_port_shutdown(port, 0, 122, (u64)fsf_req); break; default: - debug_text_event(adapter->erp_dbf, 0, "unsol_unk_sub:"); - debug_exception(adapter->erp_dbf, 0, - &status_buffer->status_subtype, sizeof (u32)); ZFCP_LOG_NORMAL("bug: Undefined status subtype received " "for a reopen indication on port with " "d_id 0x%06x on the adapter %s. " @@ -1002,7 +997,6 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) break; case FSF_STATUS_READ_FEATURE_UPDATE_ALERT: - debug_text_event(adapter->erp_dbf, 2, "unsol_features:"); ZFCP_LOG_INFO("List of supported features on adapter %s has " "been changed from 0x%08X to 0x%08X\n", zfcp_get_busid_by_adapter(adapter), @@ -1151,8 +1145,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) case FSF_PORT_HANDLE_NOT_VALID: if (fsf_stat_qual->word[0] != fsf_stat_qual->word[1]) { - debug_text_event(new_fsf_req->adapter->erp_dbf, 3, - "fsf_s_phand_nv0"); /* * In this case a command that was sent prior to a port * reopen was aborted (handles are different). This is @@ -1171,8 +1163,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) fsf_status_qual, sizeof (union fsf_status_qual)); /* Let's hope this sorts out the mess */ - debug_text_event(new_fsf_req->adapter->erp_dbf, 1, - "fsf_s_phand_nv1"); zfcp_erp_adapter_reopen(unit->port->adapter, 0, 104, (u64)new_fsf_req); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -1181,8 +1171,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) case FSF_LUN_HANDLE_NOT_VALID: if (fsf_stat_qual->word[0] != fsf_stat_qual->word[1]) { - debug_text_event(new_fsf_req->adapter->erp_dbf, 3, - "fsf_s_lhand_nv0"); /* * In this case a command that was sent prior to a unit * reopen was aborted (handles are different). @@ -1204,8 +1192,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) fsf_status_qual, sizeof (union fsf_status_qual)); /* Let's hope this sorts out the mess */ - debug_text_event(new_fsf_req->adapter->erp_dbf, 1, - "fsf_s_lhand_nv1"); zfcp_erp_port_reopen(unit->port, 0, 105, (u64)new_fsf_req); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -1214,8 +1200,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) case FSF_FCP_COMMAND_DOES_NOT_EXIST: retval = 0; - debug_text_event(new_fsf_req->adapter->erp_dbf, 3, - "fsf_s_no_exist"); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED; break; @@ -1223,8 +1207,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) ZFCP_LOG_INFO("Remote port 0x%016Lx on adapter %s needs to " "be reopened\n", unit->port->wwpn, zfcp_get_busid_by_unit(unit)); - debug_text_event(new_fsf_req->adapter->erp_dbf, 2, - "fsf_s_pboxed"); zfcp_erp_port_boxed(unit->port, 47, (u64)new_fsf_req); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; @@ -1236,7 +1218,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) "to be reopened\n", unit->fcp_lun, unit->port->wwpn, zfcp_get_busid_by_unit(unit)); - debug_text_event(new_fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); zfcp_erp_unit_boxed(unit, 48, (u64)new_fsf_req); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; @@ -1245,26 +1226,17 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) case FSF_ADAPTER_STATUS_AVAILABLE: switch (new_fsf_req->qtcb->header.fsf_status_qual.word[0]) { case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: - debug_text_event(new_fsf_req->adapter->erp_dbf, 1, - "fsf_sq_ltest"); zfcp_test_link(unit->port); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: /* SCSI stack will escalate */ - debug_text_event(new_fsf_req->adapter->erp_dbf, 1, - "fsf_sq_ulp"); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; default: ZFCP_LOG_NORMAL ("bug: Wrong status qualifier 0x%x arrived.\n", new_fsf_req->qtcb->header.fsf_status_qual.word[0]); - debug_text_event(new_fsf_req->adapter->erp_dbf, 0, - "fsf_sq_inval:"); - debug_exception(new_fsf_req->adapter->erp_dbf, 0, - &new_fsf_req->qtcb->header. - fsf_status_qual.word[0], sizeof (u32)); break; } break; @@ -1278,11 +1250,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) ZFCP_LOG_NORMAL("bug: An unknown FSF Status was presented " "(debug info 0x%x)\n", new_fsf_req->qtcb->header.fsf_status); - debug_text_event(new_fsf_req->adapter->erp_dbf, 0, - "fsf_s_inval:"); - debug_exception(new_fsf_req->adapter->erp_dbf, 0, - &new_fsf_req->qtcb->header.fsf_status, - sizeof (u32)); break; } skip_fsfstatus: @@ -1485,7 +1452,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_port(port), ZFCP_FC_SERVICE_CLASS_DEFAULT); /* stop operation for this adapter */ - debug_text_exception(adapter->erp_dbf, 0, "fsf_s_class_nsup"); zfcp_erp_adapter_shutdown(adapter, 0, 123, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -1494,13 +1460,11 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) switch (header->fsf_status_qual.word[0]){ case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: /* reopening link to port */ - debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest"); zfcp_test_link(port); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: /* ERP strategy will escalate */ - debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ulp"); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; default: @@ -1528,7 +1492,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) break; } } - debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); zfcp_erp_port_access_denied(port, 55, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -1541,7 +1504,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_INFO, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - debug_text_event(adapter->erp_dbf, 1, "fsf_s_gcom_rej"); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -1554,7 +1516,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_INFO, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - debug_text_event(adapter->erp_dbf, 1, "fsf_s_phandle_nv"); zfcp_erp_adapter_reopen(adapter, 0, 106, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -1563,7 +1524,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_INFO("port needs to be reopened " "(adapter %s, port d_id=0x%06x)\n", zfcp_get_busid_by_port(port), port->d_id); - debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); zfcp_erp_port_boxed(port, 49, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; @@ -1603,9 +1563,6 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) default: ZFCP_LOG_NORMAL("bug: An unknown FSF Status was presented " "(debug info 0x%x)\n", header->fsf_status); - debug_text_event(adapter->erp_dbf, 0, "fsf_sq_inval:"); - debug_exception(adapter->erp_dbf, 0, - &header->fsf_status_qual.word[0], sizeof (u32)); break; } @@ -1789,7 +1746,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_adapter(adapter), ZFCP_FC_SERVICE_CLASS_DEFAULT); /* stop operation for this adapter */ - debug_text_exception(adapter->erp_dbf, 0, "fsf_s_class_nsup"); zfcp_erp_adapter_shutdown(adapter, 0, 124, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -1797,13 +1753,11 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) case FSF_ADAPTER_STATUS_AVAILABLE: switch (header->fsf_status_qual.word[0]){ case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: - debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ltest"); if (port && (send_els->ls_code != ZFCP_LS_ADISC)) zfcp_test_link(port); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: - debug_text_event(adapter->erp_dbf, 1, "fsf_sq_ulp"); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; retval = zfcp_handle_els_rjt(header->fsf_status_qual.word[1], @@ -1811,7 +1765,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) &header->fsf_status_qual.word[2]); break; case FSF_SQ_RETRY_IF_POSSIBLE: - debug_text_event(adapter->erp_dbf, 1, "fsf_sq_retry"); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; default: @@ -1888,7 +1841,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) break; } } - debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); if (port != NULL) zfcp_erp_port_access_denied(port, 56, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -1900,9 +1852,6 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) "(adapter: %s, fsf_status=0x%08x)\n", zfcp_get_busid_by_adapter(adapter), header->fsf_status); - debug_text_event(adapter->erp_dbf, 0, "fsf_sq_inval"); - debug_exception(adapter->erp_dbf, 0, - &header->fsf_status_qual.word[0], sizeof(u32)); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; } @@ -2111,7 +2060,6 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) "versions in comparison to this device " "driver (try updated device driver)\n", zfcp_get_busid_by_adapter(adapter)); - debug_text_event(adapter->erp_dbf, 0, "low_qtcb_ver"); zfcp_erp_adapter_shutdown(adapter, 0, 125, (u64)fsf_req); return -EIO; } @@ -2121,7 +2069,6 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) "versions than this device driver uses" "(consider a microcode upgrade)\n", zfcp_get_busid_by_adapter(adapter)); - debug_text_event(adapter->erp_dbf, 0, "high_qtcb_ver"); zfcp_erp_adapter_shutdown(adapter, 0, 126, (u64)fsf_req); return -EIO; } @@ -2162,16 +2109,12 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) adapter->peer_wwnn, adapter->peer_wwpn, adapter->peer_d_id); - debug_text_event(fsf_req->adapter->erp_dbf, 0, - "top-p-to-p"); break; case FC_PORTTYPE_NLPORT: ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " "topology detected at adapter %s " "unsupported, shutting down adapter\n", zfcp_get_busid_by_adapter(adapter)); - debug_text_event(fsf_req->adapter->erp_dbf, 0, - "top-al"); zfcp_erp_adapter_shutdown(adapter, 0, 127, (u64)fsf_req); return -EIO; case FC_PORTTYPE_NPORT: @@ -2187,8 +2130,6 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) "of a type known to the zfcp " "driver, shutting down adapter\n", zfcp_get_busid_by_adapter(adapter)); - debug_text_exception(fsf_req->adapter->erp_dbf, 0, - "unknown-topo"); zfcp_erp_adapter_shutdown(adapter, 0, 128, (u64)fsf_req); return -EIO; } @@ -2201,10 +2142,6 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) bottom->max_qtcb_size, zfcp_get_busid_by_adapter(adapter), sizeof(struct fsf_qtcb)); - debug_text_event(fsf_req->adapter->erp_dbf, 0, - "qtcb-size"); - debug_event(fsf_req->adapter->erp_dbf, 0, - &bottom->max_qtcb_size, sizeof (u32)); zfcp_erp_adapter_shutdown(adapter, 0, 129, (u64)fsf_req); return -EIO; } @@ -2212,8 +2149,6 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) &adapter->status); break; case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: - debug_text_event(adapter->erp_dbf, 0, "xchg-inco"); - if (zfcp_fsf_exchange_config_evaluate(fsf_req, 0)) return -EIO; @@ -2224,9 +2159,6 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) &qtcb->header.fsf_status_qual.link_down_info); break; default: - debug_text_event(fsf_req->adapter->erp_dbf, 0, "fsf-stat-ng"); - debug_event(fsf_req->adapter->erp_dbf, 0, - &fsf_req->qtcb->header.fsf_status, sizeof(u32)); zfcp_erp_adapter_shutdown(adapter, 0, 130, (u64)fsf_req); return -EIO; } @@ -2406,10 +2338,6 @@ zfcp_fsf_exchange_port_data_handler(struct zfcp_fsf_req *fsf_req) zfcp_fsf_link_down_info_eval(fsf_req, 43, &qtcb->header.fsf_status_qual.link_down_info); break; - default: - debug_text_event(adapter->erp_dbf, 0, "xchg-port-ng"); - debug_event(adapter->erp_dbf, 0, - &fsf_req->qtcb->header.fsf_status, sizeof(u32)); } } @@ -2507,8 +2435,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_NORMAL("bug: remote port 0x%016Lx on adapter %s " "is already open.\n", port->wwpn, zfcp_get_busid_by_port(port)); - debug_text_exception(fsf_req->adapter->erp_dbf, 0, - "fsf_s_popen"); /* * This is a bug, however operation should continue normally * if it is simply ignored @@ -2532,7 +2458,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) break; } } - debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_access"); zfcp_erp_port_access_denied(port, 57, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2542,8 +2467,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) "The remote port 0x%016Lx on adapter %s " "could not be opened. Disabling it.\n", port->wwpn, zfcp_get_busid_by_port(port)); - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_s_max_ports"); zfcp_erp_port_failed(port, 31, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2551,15 +2474,11 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) case FSF_ADAPTER_STATUS_AVAILABLE: switch (header->fsf_status_qual.word[0]) { case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_sq_ltest"); /* ERP strategy will escalate */ fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: /* ERP strategy will escalate */ - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_sq_ulp"); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_NO_RETRY_POSSIBLE: @@ -2568,8 +2487,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) "Disabling it.\n", port->wwpn, zfcp_get_busid_by_port(port)); - debug_text_exception(fsf_req->adapter->erp_dbf, 0, - "fsf_sq_no_retry"); zfcp_erp_port_failed(port, 32, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2577,12 +2494,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_NORMAL ("bug: Wrong status qualifier 0x%x arrived.\n", header->fsf_status_qual.word[0]); - debug_text_event(fsf_req->adapter->erp_dbf, 0, - "fsf_sq_inval:"); - debug_exception( - fsf_req->adapter->erp_dbf, 0, - &header->fsf_status_qual.word[0], - sizeof (u32)); break; } break; @@ -2625,17 +2536,12 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) "warning: insufficient length of " "PLOGI payload (%i)\n", fsf_req->qtcb->bottom.support.els1_length); - debug_text_event(fsf_req->adapter->erp_dbf, 0, - "fsf_s_short_plogi:"); /* skip sanity check and assume wwpn is ok */ } else { if (plogi->serv_param.wwpn != port->wwpn) { ZFCP_LOG_INFO("warning: d_id of port " "0x%016Lx changed during " "open\n", port->wwpn); - debug_text_event( - fsf_req->adapter->erp_dbf, 0, - "fsf_s_did_change:"); atomic_clear_mask( ZFCP_STATUS_PORT_DID_DID, &port->status); @@ -2660,9 +2566,6 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_NORMAL("bug: An unknown FSF Status was presented " "(debug info 0x%x)\n", header->fsf_status); - debug_text_event(fsf_req->adapter->erp_dbf, 0, "fsf_s_inval:"); - debug_exception(fsf_req->adapter->erp_dbf, 0, - &header->fsf_status, sizeof (u32)); break; } @@ -2766,8 +2669,6 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &fsf_req->qtcb->header.fsf_status_qual, sizeof (union fsf_status_qual)); - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_s_phand_nv"); zfcp_erp_adapter_reopen(port->adapter, 0, 107, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2793,10 +2694,6 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_NORMAL("bug: An unknown FSF Status was presented " "(debug info 0x%x)\n", fsf_req->qtcb->header.fsf_status); - debug_text_event(fsf_req->adapter->erp_dbf, 0, "fsf_s_inval:"); - debug_exception(fsf_req->adapter->erp_dbf, 0, - &fsf_req->qtcb->header.fsf_status, - sizeof (u32)); break; } @@ -2909,8 +2806,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_s_phand_nv"); zfcp_erp_adapter_reopen(port->adapter, 0, 108, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2932,7 +2827,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) break; } } - debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_access"); zfcp_erp_port_access_denied(port, 58, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2943,7 +2837,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) "to close it physically.\n", port->wwpn, zfcp_get_busid_by_port(port)); - debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_pboxed"); zfcp_erp_port_boxed(port, 50, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; @@ -2959,26 +2852,17 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) case FSF_ADAPTER_STATUS_AVAILABLE: switch (header->fsf_status_qual.word[0]) { case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_sq_ltest"); /* This will now be escalated by ERP */ fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: /* ERP strategy will escalate */ - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_sq_ulp"); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; default: ZFCP_LOG_NORMAL ("bug: Wrong status qualifier 0x%x arrived.\n", header->fsf_status_qual.word[0]); - debug_text_event(fsf_req->adapter->erp_dbf, 0, - "fsf_sq_inval:"); - debug_exception( - fsf_req->adapter->erp_dbf, 0, - &header->fsf_status_qual.word[0], sizeof (u32)); break; } break; @@ -3001,9 +2885,6 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_NORMAL("bug: An unknown FSF Status was presented " "(debug info 0x%x)\n", header->fsf_status); - debug_text_event(fsf_req->adapter->erp_dbf, 0, "fsf_s_inval:"); - debug_exception(fsf_req->adapter->erp_dbf, 0, - &header->fsf_status, sizeof (u32)); break; } @@ -3135,7 +3016,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - debug_text_event(adapter->erp_dbf, 1, "fsf_s_ph_nv"); zfcp_erp_adapter_reopen(unit->port->adapter, 0, 109, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -3146,8 +3026,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) "remote port 0x%016Lx on adapter %s twice.\n", unit->fcp_lun, unit->port->wwpn, zfcp_get_busid_by_unit(unit)); - debug_text_exception(adapter->erp_dbf, 0, - "fsf_s_uopen"); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3169,7 +3047,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) break; } } - debug_text_event(adapter->erp_dbf, 1, "fsf_s_access"); zfcp_erp_unit_access_denied(unit, 59, (u64)fsf_req); atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status); atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status); @@ -3180,7 +3057,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s " "needs to be reopened\n", unit->port->wwpn, zfcp_get_busid_by_unit(unit)); - debug_text_event(adapter->erp_dbf, 2, "fsf_s_pboxed"); zfcp_erp_port_boxed(unit->port, 51, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; @@ -3221,8 +3097,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - debug_text_event(adapter->erp_dbf, 2, - "fsf_s_l_sh_vio"); zfcp_erp_unit_access_denied(unit, 60, (u64)fsf_req); atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status); atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status); @@ -3237,8 +3111,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) unit->fcp_lun, unit->port->wwpn, zfcp_get_busid_by_unit(unit)); - debug_text_event(adapter->erp_dbf, 1, - "fsf_s_max_units"); zfcp_erp_unit_failed(unit, 34, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3247,26 +3119,17 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) switch (header->fsf_status_qual.word[0]) { case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: /* Re-establish link to port */ - debug_text_event(adapter->erp_dbf, 1, - "fsf_sq_ltest"); zfcp_test_link(unit->port); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: /* ERP strategy will escalate */ - debug_text_event(adapter->erp_dbf, 1, - "fsf_sq_ulp"); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; default: ZFCP_LOG_NORMAL ("bug: Wrong status qualifier 0x%x arrived.\n", header->fsf_status_qual.word[0]); - debug_text_event(adapter->erp_dbf, 0, - "fsf_sq_inval:"); - debug_exception(adapter->erp_dbf, 0, - &header->fsf_status_qual.word[0], - sizeof (u32)); } break; @@ -3339,9 +3202,6 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_NORMAL("bug: An unknown FSF Status was presented " "(debug info 0x%x)\n", header->fsf_status); - debug_text_event(adapter->erp_dbf, 0, "fsf_s_inval:"); - debug_exception(adapter->erp_dbf, 0, - &header->fsf_status, sizeof (u32)); break; } @@ -3454,8 +3314,6 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &fsf_req->qtcb->header.fsf_status_qual, sizeof (union fsf_status_qual)); - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_s_phand_nv"); zfcp_erp_adapter_reopen(unit->port->adapter, 0, 110, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -3473,8 +3331,6 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &fsf_req->qtcb->header.fsf_status_qual, sizeof (union fsf_status_qual)); - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_s_lhand_nv"); zfcp_erp_port_reopen(unit->port, 0, 111, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3484,7 +3340,6 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) "needs to be reopened\n", unit->port->wwpn, zfcp_get_busid_by_unit(unit)); - debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); zfcp_erp_port_boxed(unit->port, 52, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; @@ -3494,27 +3349,17 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) switch (fsf_req->qtcb->header.fsf_status_qual.word[0]) { case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: /* re-establish link to port */ - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_sq_ltest"); zfcp_test_link(unit->port); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: /* ERP strategy will escalate */ - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_sq_ulp"); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; default: ZFCP_LOG_NORMAL ("bug: Wrong status qualifier 0x%x arrived.\n", fsf_req->qtcb->header.fsf_status_qual.word[0]); - debug_text_event(fsf_req->adapter->erp_dbf, 0, - "fsf_sq_inval:"); - debug_exception( - fsf_req->adapter->erp_dbf, 0, - &fsf_req->qtcb->header.fsf_status_qual.word[0], - sizeof (u32)); break; } break; @@ -3535,10 +3380,6 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_NORMAL("bug: An unknown FSF Status was presented " "(debug info 0x%x)\n", fsf_req->qtcb->header.fsf_status); - debug_text_event(fsf_req->adapter->erp_dbf, 0, "fsf_s_inval:"); - debug_exception(fsf_req->adapter->erp_dbf, 0, - &fsf_req->qtcb->header.fsf_status, - sizeof (u32)); break; } @@ -3851,8 +3692,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_s_phand_nv"); zfcp_erp_adapter_reopen(unit->port->adapter, 0, 112, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -3870,8 +3709,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_s_uhand_nv"); zfcp_erp_port_reopen(unit->port, 0, 113, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3888,8 +3725,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_s_hand_mis"); zfcp_erp_adapter_reopen(unit->port->adapter, 0, 114, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -3901,8 +3736,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_unit(unit), ZFCP_FC_SERVICE_CLASS_DEFAULT); /* stop operation for this adapter */ - debug_text_exception(fsf_req->adapter->erp_dbf, 0, - "fsf_s_class_nsup"); zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 132, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -3920,8 +3753,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_s_fcp_lun_nv"); zfcp_erp_port_reopen(unit->port, 0, 115, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3944,7 +3775,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) break; } } - debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_access"); zfcp_erp_unit_access_denied(unit, 61, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3958,8 +3788,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_unit(unit), fsf_req->qtcb->bottom.io.data_direction); /* stop operation for this adapter */ - debug_text_event(fsf_req->adapter->erp_dbf, 0, - "fsf_s_dir_ind_nv"); zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 133, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -3974,8 +3802,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_unit(unit), fsf_req->qtcb->bottom.io.fcp_cmnd_length); /* stop operation for this adapter */ - debug_text_event(fsf_req->adapter->erp_dbf, 0, - "fsf_s_cmd_len_nv"); zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 134, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -3985,7 +3811,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s " "needs to be reopened\n", unit->port->wwpn, zfcp_get_busid_by_unit(unit)); - debug_text_event(fsf_req->adapter->erp_dbf, 2, "fsf_s_pboxed"); zfcp_erp_port_boxed(unit->port, 53, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; @@ -3996,7 +3821,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) "wwpn=0x%016Lx, fcp_lun=0x%016Lx)\n", zfcp_get_busid_by_unit(unit), unit->port->wwpn, unit->fcp_lun); - debug_text_event(fsf_req->adapter->erp_dbf, 1, "fsf_s_lboxed"); zfcp_erp_unit_boxed(unit, 54, (u64)fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; @@ -4006,25 +3830,16 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) switch (header->fsf_status_qual.word[0]) { case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE: /* re-establish link to port */ - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_sq_ltest"); zfcp_test_link(unit->port); break; case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED: /* FIXME(hw) need proper specs for proper action */ /* let scsi stack deal with retries and escalation */ - debug_text_event(fsf_req->adapter->erp_dbf, 1, - "fsf_sq_ulp"); break; default: ZFCP_LOG_NORMAL ("Unknown status qualifier 0x%x arrived.\n", header->fsf_status_qual.word[0]); - debug_text_event(fsf_req->adapter->erp_dbf, 0, - "fsf_sq_inval:"); - debug_exception(fsf_req->adapter->erp_dbf, 0, - &header->fsf_status_qual.word[0], - sizeof(u32)); break; } fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -4035,12 +3850,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) case FSF_FCP_RSP_AVAILABLE: break; - - default: - debug_text_event(fsf_req->adapter->erp_dbf, 0, "fsf_s_inval:"); - debug_exception(fsf_req->adapter->erp_dbf, 0, - &header->fsf_status, sizeof(u32)); - break; } skip_fsfstatus: @@ -4620,9 +4429,6 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req) "was presented on the adapter %s\n", header->fsf_status, zfcp_get_busid_by_adapter(adapter)); - debug_text_event(fsf_req->adapter->erp_dbf, 0, "fsf_sq_inval"); - debug_exception(fsf_req->adapter->erp_dbf, 0, - &header->fsf_status_qual.word[0], sizeof(u32)); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; retval = -EINVAL; break; @@ -4812,7 +4618,6 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req) volatile struct qdio_buffer_element *sbale; int inc_seq_no; int new_distance_from_int; - u64 dbg_tmp[2]; int retval = 0; adapter = fsf_req->adapter; @@ -4862,10 +4667,6 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req) QDIO_FLAG_SYNC_OUTPUT, 0, fsf_req->sbal_first, fsf_req->sbal_number, NULL); - dbg_tmp[0] = (unsigned long) sbale[0].addr; - dbg_tmp[1] = (u64) retval; - debug_event(adapter->erp_dbf, 4, (void *) dbg_tmp, 16); - if (unlikely(retval)) { /* Queues are down..... */ retval = -EIO; diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index d742d0a9df7..5d60a4116af 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c @@ -239,8 +239,6 @@ static void zfcp_qdio_reqid_check(struct zfcp_adapter *adapter, struct zfcp_fsf_req *fsf_req; unsigned long flags; - debug_long_event(adapter->erp_dbf, 4, req_id); - spin_lock_irqsave(&adapter->req_list_lock, flags); fsf_req = zfcp_reqlist_find(adapter, req_id); -- cgit v1.2.3 From 8fc5af168753239d7bf77ccca831196bcdffbfbe Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Mon, 31 Mar 2008 11:15:23 +0200 Subject: [SCSI] zfcp: simplify zfcp_dbf_timestamp() Change zfcp_dbf_timestamp() so that it just calculates timespec from timestamp. First step to be able to rip this code out of zfcp. Besides, this change makes it easier to rip out old-style debug view functions. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index aecdc7f2dbc..edd93533db4 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -49,23 +49,17 @@ static void zfcp_dbf_hexdump(debug_info_t *dbf, void *to, int to_len, } } -static int -zfcp_dbf_stck(char *out_buf, const char *label, unsigned long long stck) +/* FIXME: this duplicate this code in s390 debug feature */ +static void zfcp_dbf_timestamp(unsigned long long stck, struct timespec *time) { unsigned long long sec; - struct timespec dbftime; - int len = 0; stck -= 0x8126d60e46000000LL - (0x3c26700LL * 1000000 * 4096); sec = stck >> 12; do_div(sec, 1000000); - dbftime.tv_sec = sec; + time->tv_sec = sec; stck -= (sec * 1000000) << 12; - dbftime.tv_nsec = ((stck * 1000) >> 12); - len += sprintf(out_buf + len, "%-24s%011lu:%06lu\n", - label, dbftime.tv_sec, dbftime.tv_nsec); - - return len; + time->tv_nsec = ((stck * 1000) >> 12); } static int zfcp_dbf_tag(char *out_buf, const char *label, const char *tag) @@ -146,10 +140,12 @@ zfcp_dbf_view_header(debug_info_t * id, struct debug_view *view, int area, { struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)DEBUG_DATA(entry); int len = 0; + struct timespec t; if (strncmp(dump->tag, "dump", ZFCP_DBF_TAG_SIZE) != 0) { - len += zfcp_dbf_stck(out_buf + len, "timestamp", - entry->id.stck); + zfcp_dbf_timestamp(entry->id.stck, &t); + len += zfcp_dbf_view(out_buf + len, "timestamp", "%011lu:%06lu", + t.tv_sec, t.tv_nsec); len += zfcp_dbf_view(out_buf + len, "cpu", "%02i", entry->id.fields.cpuid); } else { @@ -363,6 +359,7 @@ zfcp_hba_dbf_view_response(char *out_buf, struct zfcp_hba_dbf_record_response *rec) { int len = 0; + struct timespec t; len += zfcp_dbf_view(out_buf + len, "fsf_command", "0x%08x", rec->fsf_command); @@ -370,7 +367,9 @@ zfcp_hba_dbf_view_response(char *out_buf, rec->fsf_reqid); len += zfcp_dbf_view(out_buf + len, "fsf_seqno", "0x%08x", rec->fsf_seqno); - len += zfcp_dbf_stck(out_buf + len, "fsf_issued", rec->fsf_issued); + zfcp_dbf_timestamp(rec->fsf_issued, &t); + len += zfcp_dbf_view(out_buf + len, "fsf_issued", "%011lu:%06lu", + t.tv_sec, t.tv_nsec); len += zfcp_dbf_view(out_buf + len, "fsf_prot_status", "0x%08x", rec->fsf_prot_status); len += zfcp_dbf_view(out_buf + len, "fsf_status", "0x%08x", @@ -1222,6 +1221,7 @@ zfcp_scsi_dbf_view_format(debug_info_t * id, struct debug_view *view, struct zfcp_scsi_dbf_record *rec = (struct zfcp_scsi_dbf_record *)in_buf; int len = 0; + struct timespec t; if (strncmp(rec->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0) return 0; @@ -1253,7 +1253,9 @@ zfcp_scsi_dbf_view_format(debug_info_t * id, struct debug_view *view, rec->fsf_reqid); len += zfcp_dbf_view(out_buf + len, "fsf_seqno", "0x%08x", rec->fsf_seqno); - len += zfcp_dbf_stck(out_buf + len, "fsf_issued", rec->fsf_issued); + zfcp_dbf_timestamp(rec->fsf_issued, &t); + len += zfcp_dbf_view(out_buf + len, "fsf_issued", "%011lu:%06lu", + t.tv_sec, t.tv_nsec); if (strncmp(rec->tag, "rslt", ZFCP_DBF_TAG_SIZE) == 0) { len += zfcp_dbf_view(out_buf + len, "fcp_rsp_validity", "0x%02x", -- cgit v1.2.3 From b634fff743be5e6010c5cbe36ea1e68ff56a6aee Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Mon, 31 Mar 2008 11:15:24 +0200 Subject: [SCSI] zfcp: Cleanup debug trace view functions. Improve readability of code by using more convenient output function. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.c | 382 ++++++++++++++++++------------------------- 1 file changed, 162 insertions(+), 220 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index edd93533db4..15b534206b3 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -139,25 +139,21 @@ zfcp_dbf_view_header(debug_info_t * id, struct debug_view *view, int area, debug_entry_t * entry, char *out_buf) { struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)DEBUG_DATA(entry); - int len = 0; struct timespec t; + char *p = out_buf; if (strncmp(dump->tag, "dump", ZFCP_DBF_TAG_SIZE) != 0) { zfcp_dbf_timestamp(entry->id.stck, &t); - len += zfcp_dbf_view(out_buf + len, "timestamp", "%011lu:%06lu", - t.tv_sec, t.tv_nsec); - len += zfcp_dbf_view(out_buf + len, "cpu", "%02i", - entry->id.fields.cpuid); - } else { - len += zfcp_dbf_view_dump(out_buf + len, NULL, - dump->data, - dump->size, - dump->offset, dump->total_size); + zfcp_dbf_out(&p, "timestamp", "%011lu:%06lu", + t.tv_sec, t.tv_nsec); + zfcp_dbf_out(&p, "cpu", "%02i", entry->id.fields.cpuid); + } else { + p += zfcp_dbf_view_dump(p, NULL, dump->data, dump->size, + dump->offset, dump->total_size); if ((dump->offset + dump->size) == dump->total_size) - len += sprintf(out_buf + len, "\n"); + p += sprintf(p, "\n"); } - - return len; + return p - out_buf; } void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req) @@ -354,82 +350,65 @@ zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter, unsigned int status, spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags); } -static int -zfcp_hba_dbf_view_response(char *out_buf, - struct zfcp_hba_dbf_record_response *rec) +static int zfcp_hba_dbf_view_response(char *buf, + struct zfcp_hba_dbf_record_response *r) { - int len = 0; struct timespec t; + char *p = buf; - len += zfcp_dbf_view(out_buf + len, "fsf_command", "0x%08x", - rec->fsf_command); - len += zfcp_dbf_view(out_buf + len, "fsf_reqid", "0x%0Lx", - rec->fsf_reqid); - len += zfcp_dbf_view(out_buf + len, "fsf_seqno", "0x%08x", - rec->fsf_seqno); - zfcp_dbf_timestamp(rec->fsf_issued, &t); - len += zfcp_dbf_view(out_buf + len, "fsf_issued", "%011lu:%06lu", - t.tv_sec, t.tv_nsec); - len += zfcp_dbf_view(out_buf + len, "fsf_prot_status", "0x%08x", - rec->fsf_prot_status); - len += zfcp_dbf_view(out_buf + len, "fsf_status", "0x%08x", - rec->fsf_status); - len += zfcp_dbf_view_dump(out_buf + len, "fsf_prot_status_qual", - rec->fsf_prot_status_qual, - FSF_PROT_STATUS_QUAL_SIZE, - 0, FSF_PROT_STATUS_QUAL_SIZE); - len += zfcp_dbf_view_dump(out_buf + len, "fsf_status_qual", - rec->fsf_status_qual, - FSF_STATUS_QUALIFIER_SIZE, - 0, FSF_STATUS_QUALIFIER_SIZE); - len += zfcp_dbf_view(out_buf + len, "fsf_req_status", "0x%08x", - rec->fsf_req_status); - len += zfcp_dbf_view(out_buf + len, "sbal_first", "0x%02x", - rec->sbal_first); - len += zfcp_dbf_view(out_buf + len, "sbal_curr", "0x%02x", - rec->sbal_curr); - len += zfcp_dbf_view(out_buf + len, "sbal_last", "0x%02x", - rec->sbal_last); - len += zfcp_dbf_view(out_buf + len, "pool", "0x%02x", rec->pool); - - switch (rec->fsf_command) { + zfcp_dbf_out(&p, "fsf_command", "0x%08x", r->fsf_command); + zfcp_dbf_out(&p, "fsf_reqid", "0x%0Lx", r->fsf_reqid); + zfcp_dbf_out(&p, "fsf_seqno", "0x%08x", r->fsf_seqno); + zfcp_dbf_timestamp(r->fsf_issued, &t); + zfcp_dbf_out(&p, "fsf_issued", "%011lu:%06lu", t.tv_sec, t.tv_nsec); + zfcp_dbf_out(&p, "fsf_prot_status", "0x%08x", r->fsf_prot_status); + zfcp_dbf_out(&p, "fsf_status", "0x%08x", r->fsf_status); + p += zfcp_dbf_view_dump(p, "fsf_prot_status_qual", + r->fsf_prot_status_qual, + FSF_PROT_STATUS_QUAL_SIZE, + 0, FSF_PROT_STATUS_QUAL_SIZE); + p += zfcp_dbf_view_dump(p, "fsf_status_qual", + r->fsf_status_qual, + FSF_STATUS_QUALIFIER_SIZE, + 0, FSF_STATUS_QUALIFIER_SIZE); + zfcp_dbf_out(&p, "fsf_req_status", "0x%08x", r->fsf_req_status); + zfcp_dbf_out(&p, "sbal_first", "0x%02x", r->sbal_first); + zfcp_dbf_out(&p, "sbal_curr", "0x%02x", r->sbal_curr); + zfcp_dbf_out(&p, "sbal_last", "0x%02x", r->sbal_last); + zfcp_dbf_out(&p, "pool", "0x%02x", r->pool); + + switch (r->fsf_command) { case FSF_QTCB_FCP_CMND: - if (rec->fsf_req_status & ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT) + if (r->fsf_req_status & ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT) break; - len += zfcp_dbf_view(out_buf + len, "scsi_cmnd", "0x%0Lx", - rec->data.send_fcp.scsi_cmnd); - len += zfcp_dbf_view(out_buf + len, "scsi_serial", "0x%016Lx", - rec->data.send_fcp.scsi_serial); + zfcp_dbf_out(&p, "scsi_cmnd", "0x%0Lx", + r->data.send_fcp.scsi_cmnd); + zfcp_dbf_out(&p, "scsi_serial", "0x%016Lx", + r->data.send_fcp.scsi_serial); break; case FSF_QTCB_OPEN_PORT_WITH_DID: case FSF_QTCB_CLOSE_PORT: case FSF_QTCB_CLOSE_PHYSICAL_PORT: - len += zfcp_dbf_view(out_buf + len, "wwpn", "0x%016Lx", - rec->data.port.wwpn); - len += zfcp_dbf_view(out_buf + len, "d_id", "0x%06x", - rec->data.port.d_id); - len += zfcp_dbf_view(out_buf + len, "port_handle", "0x%08x", - rec->data.port.port_handle); + zfcp_dbf_out(&p, "wwpn", "0x%016Lx", r->data.port.wwpn); + zfcp_dbf_out(&p, "d_id", "0x%06x", r->data.port.d_id); + zfcp_dbf_out(&p, "port_handle", "0x%08x", + r->data.port.port_handle); break; case FSF_QTCB_OPEN_LUN: case FSF_QTCB_CLOSE_LUN: - len += zfcp_dbf_view(out_buf + len, "wwpn", "0x%016Lx", - rec->data.unit.wwpn); - len += zfcp_dbf_view(out_buf + len, "fcp_lun", "0x%016Lx", - rec->data.unit.fcp_lun); - len += zfcp_dbf_view(out_buf + len, "port_handle", "0x%08x", - rec->data.unit.port_handle); - len += zfcp_dbf_view(out_buf + len, "lun_handle", "0x%08x", - rec->data.unit.lun_handle); + zfcp_dbf_out(&p, "wwpn", "0x%016Lx", r->data.unit.wwpn); + zfcp_dbf_out(&p, "fcp_lun", "0x%016Lx", r->data.unit.fcp_lun); + zfcp_dbf_out(&p, "port_handle", "0x%08x", + r->data.unit.port_handle); + zfcp_dbf_out(&p, "lun_handle", "0x%08x", + r->data.unit.lun_handle); break; case FSF_QTCB_SEND_ELS: - len += zfcp_dbf_view(out_buf + len, "d_id", "0x%06x", - rec->data.send_els.d_id); - len += zfcp_dbf_view(out_buf + len, "ls_code", "0x%02x", - rec->data.send_els.ls_code); + zfcp_dbf_out(&p, "d_id", "0x%06x", r->data.send_els.d_id); + zfcp_dbf_out(&p, "ls_code", "0x%02x", r->data.send_els.ls_code); break; case FSF_QTCB_ABORT_FCP_CMND: @@ -440,47 +419,36 @@ zfcp_hba_dbf_view_response(char *out_buf, case FSF_QTCB_UPLOAD_CONTROL_FILE: break; } - - return len; + return p - buf; } -static int -zfcp_hba_dbf_view_status(char *out_buf, struct zfcp_hba_dbf_record_status *rec) +static int zfcp_hba_dbf_view_status(char *buf, + struct zfcp_hba_dbf_record_status *r) { - int len = 0; - - len += zfcp_dbf_view(out_buf + len, "failed", "0x%02x", rec->failed); - len += zfcp_dbf_view(out_buf + len, "status_type", "0x%08x", - rec->status_type); - len += zfcp_dbf_view(out_buf + len, "status_subtype", "0x%08x", - rec->status_subtype); - len += zfcp_dbf_view_dump(out_buf + len, "queue_designator", - (char *)&rec->queue_designator, - sizeof(struct fsf_queue_designator), - 0, sizeof(struct fsf_queue_designator)); - len += zfcp_dbf_view_dump(out_buf + len, "payload", - (char *)&rec->payload, - rec->payload_size, 0, rec->payload_size); + char *p = buf; - return len; + zfcp_dbf_out(&p, "failed", "0x%02x", r->failed); + zfcp_dbf_out(&p, "status_type", "0x%08x", r->status_type); + zfcp_dbf_out(&p, "status_subtype", "0x%08x", r->status_subtype); + p += zfcp_dbf_view_dump(p, "queue_designator", + (char *)&r->queue_designator, + sizeof(struct fsf_queue_designator), + 0, sizeof(struct fsf_queue_designator)); + p += zfcp_dbf_view_dump(p, "payload", (char *)&r->payload, + r->payload_size, 0, r->payload_size); + return p - buf; } -static int -zfcp_hba_dbf_view_qdio(char *out_buf, struct zfcp_hba_dbf_record_qdio *rec) +static int zfcp_hba_dbf_view_qdio(char *buf, struct zfcp_hba_dbf_record_qdio *r) { - int len = 0; - - len += zfcp_dbf_view(out_buf + len, "status", "0x%08x", rec->status); - len += zfcp_dbf_view(out_buf + len, "qdio_error", "0x%08x", - rec->qdio_error); - len += zfcp_dbf_view(out_buf + len, "siga_error", "0x%08x", - rec->siga_error); - len += zfcp_dbf_view(out_buf + len, "sbal_index", "0x%02x", - rec->sbal_index); - len += zfcp_dbf_view(out_buf + len, "sbal_count", "0x%02x", - rec->sbal_count); + char *p = buf; - return len; + zfcp_dbf_out(&p, "status", "0x%08x", r->status); + zfcp_dbf_out(&p, "qdio_error", "0x%08x", r->qdio_error); + zfcp_dbf_out(&p, "siga_error", "0x%08x", r->siga_error); + zfcp_dbf_out(&p, "sbal_index", "0x%02x", r->sbal_index); + zfcp_dbf_out(&p, "sbal_count", "0x%02x", r->sbal_count); + return p - buf; } static int @@ -720,8 +688,8 @@ static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, zfcp_dbf_out(&p, "step", "0x%08Lx", r->u.action.step); break; } - sprintf(p, "\n"); - return (p - buf) + 1; + p += sprintf(p, "\n"); + return p - buf; } static struct debug_view zfcp_rec_dbf_view = { @@ -1024,71 +992,65 @@ static int zfcp_san_dbf_view_format(debug_info_t * id, struct debug_view *view, char *out_buf, const char *in_buf) { - struct zfcp_san_dbf_record *rec = (struct zfcp_san_dbf_record *)in_buf; + struct zfcp_san_dbf_record *r = (struct zfcp_san_dbf_record *)in_buf; char *buffer = NULL; int buflen = 0, total = 0; - int len = 0; + char *p = out_buf; - if (strncmp(rec->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0) + if (strncmp(r->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0) return 0; - len += zfcp_dbf_tag(out_buf + len, "tag", rec->tag); - len += zfcp_dbf_view(out_buf + len, "fsf_reqid", "0x%0Lx", - rec->fsf_reqid); - len += zfcp_dbf_view(out_buf + len, "fsf_seqno", "0x%08x", - rec->fsf_seqno); - len += zfcp_dbf_view(out_buf + len, "s_id", "0x%06x", rec->s_id); - len += zfcp_dbf_view(out_buf + len, "d_id", "0x%06x", rec->d_id); - - if (strncmp(rec->tag, "octc", ZFCP_DBF_TAG_SIZE) == 0) { - len += zfcp_dbf_view(out_buf + len, "cmd_req_code", "0x%04x", - rec->type.ct.type.request.cmd_req_code); - len += zfcp_dbf_view(out_buf + len, "revision", "0x%02x", - rec->type.ct.type.request.revision); - len += zfcp_dbf_view(out_buf + len, "gs_type", "0x%02x", - rec->type.ct.type.request.gs_type); - len += zfcp_dbf_view(out_buf + len, "gs_subtype", "0x%02x", - rec->type.ct.type.request.gs_subtype); - len += zfcp_dbf_view(out_buf + len, "options", "0x%02x", - rec->type.ct.type.request.options); - len += zfcp_dbf_view(out_buf + len, "max_res_size", "0x%04x", - rec->type.ct.type.request.max_res_size); - total = rec->type.ct.payload_size; - buffer = rec->type.ct.payload; + p += zfcp_dbf_tag(p, "tag", r->tag); + zfcp_dbf_out(&p, "fsf_reqid", "0x%0Lx", r->fsf_reqid); + zfcp_dbf_out(&p, "fsf_seqno", "0x%08x", r->fsf_seqno); + zfcp_dbf_out(&p, "s_id", "0x%06x", r->s_id); + zfcp_dbf_out(&p, "d_id", "0x%06x", r->d_id); + + if (strncmp(r->tag, "octc", ZFCP_DBF_TAG_SIZE) == 0) { + /* FIXME: struct zfcp_dbf_ct_req *ct = ...; */ + zfcp_dbf_out(&p, "cmd_req_code", "0x%04x", + r->type.ct.type.request.cmd_req_code); + zfcp_dbf_out(&p, "revision", "0x%02x", + r->type.ct.type.request.revision); + zfcp_dbf_out(&p, "gs_type", "0x%02x", + r->type.ct.type.request.gs_type); + zfcp_dbf_out(&p, "gs_subtype", "0x%02x", + r->type.ct.type.request.gs_subtype); + zfcp_dbf_out(&p, "options", "0x%02x", + r->type.ct.type.request.options); + zfcp_dbf_out(&p, "max_res_size", "0x%04x", + r->type.ct.type.request.max_res_size); + total = r->type.ct.payload_size; + buffer = r->type.ct.payload; buflen = min(total, ZFCP_DBF_CT_PAYLOAD); - } else if (strncmp(rec->tag, "rctc", ZFCP_DBF_TAG_SIZE) == 0) { - len += zfcp_dbf_view(out_buf + len, "cmd_rsp_code", "0x%04x", - rec->type.ct.type.response.cmd_rsp_code); - len += zfcp_dbf_view(out_buf + len, "revision", "0x%02x", - rec->type.ct.type.response.revision); - len += zfcp_dbf_view(out_buf + len, "reason_code", "0x%02x", - rec->type.ct.type.response.reason_code); - len += - zfcp_dbf_view(out_buf + len, "reason_code_expl", "0x%02x", - rec->type.ct.type.response.reason_code_expl); - len += - zfcp_dbf_view(out_buf + len, "vendor_unique", "0x%02x", - rec->type.ct.type.response.vendor_unique); - total = rec->type.ct.payload_size; - buffer = rec->type.ct.payload; + } else if (strncmp(r->tag, "rctc", ZFCP_DBF_TAG_SIZE) == 0) { + zfcp_dbf_out(&p, "cmd_rsp_code", "0x%04x", + r->type.ct.type.response.cmd_rsp_code); + zfcp_dbf_out(&p, "revision", "0x%02x", + r->type.ct.type.response.revision); + zfcp_dbf_out(&p, "reason_code", "0x%02x", + r->type.ct.type.response.reason_code); + zfcp_dbf_out(&p, "reason_code_expl", "0x%02x", + r->type.ct.type.response.reason_code_expl); + zfcp_dbf_out(&p, "vendor_unique", "0x%02x", + r->type.ct.type.response.vendor_unique); + total = r->type.ct.payload_size; + buffer = r->type.ct.payload; buflen = min(total, ZFCP_DBF_CT_PAYLOAD); - } else if (strncmp(rec->tag, "oels", ZFCP_DBF_TAG_SIZE) == 0 || - strncmp(rec->tag, "rels", ZFCP_DBF_TAG_SIZE) == 0 || - strncmp(rec->tag, "iels", ZFCP_DBF_TAG_SIZE) == 0) { - len += zfcp_dbf_view(out_buf + len, "ls_code", "0x%02x", - rec->type.els.ls_code); - total = rec->type.els.payload_size; - buffer = rec->type.els.payload; + } else if (strncmp(r->tag, "oels", ZFCP_DBF_TAG_SIZE) == 0 || + strncmp(r->tag, "rels", ZFCP_DBF_TAG_SIZE) == 0 || + strncmp(r->tag, "iels", ZFCP_DBF_TAG_SIZE) == 0) { + zfcp_dbf_out(&p, "ls_code", "0x%02x", r->type.els.ls_code); + total = r->type.els.payload_size; + buffer = r->type.els.payload; buflen = min(total, ZFCP_DBF_ELS_PAYLOAD); } - len += zfcp_dbf_view_dump(out_buf + len, "payload", - buffer, buflen, 0, total); - + p += zfcp_dbf_view_dump(p, "payload", buffer, buflen, 0, total); if (buflen == total) - len += sprintf(out_buf + len, "\n"); + p += sprintf(p, "\n"); - return len; + return p - out_buf; } static struct debug_view zfcp_san_dbf_view = { @@ -1218,71 +1180,51 @@ static int zfcp_scsi_dbf_view_format(debug_info_t * id, struct debug_view *view, char *out_buf, const char *in_buf) { - struct zfcp_scsi_dbf_record *rec = - (struct zfcp_scsi_dbf_record *)in_buf; - int len = 0; + struct zfcp_scsi_dbf_record *r = (struct zfcp_scsi_dbf_record *)in_buf; struct timespec t; + char *p = out_buf; - if (strncmp(rec->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0) + if (strncmp(r->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0) return 0; - len += zfcp_dbf_tag(out_buf + len, "tag", rec->tag); - len += zfcp_dbf_tag(out_buf + len, "tag2", rec->tag2); - len += zfcp_dbf_view(out_buf + len, "scsi_id", "0x%08x", rec->scsi_id); - len += zfcp_dbf_view(out_buf + len, "scsi_lun", "0x%08x", - rec->scsi_lun); - len += zfcp_dbf_view(out_buf + len, "scsi_result", "0x%08x", - rec->scsi_result); - len += zfcp_dbf_view(out_buf + len, "scsi_cmnd", "0x%0Lx", - rec->scsi_cmnd); - len += zfcp_dbf_view(out_buf + len, "scsi_serial", "0x%016Lx", - rec->scsi_serial); - len += zfcp_dbf_view_dump(out_buf + len, "scsi_opcode", - rec->scsi_opcode, - ZFCP_DBF_SCSI_OPCODE, - 0, ZFCP_DBF_SCSI_OPCODE); - len += zfcp_dbf_view(out_buf + len, "scsi_retries", "0x%02x", - rec->scsi_retries); - len += zfcp_dbf_view(out_buf + len, "scsi_allowed", "0x%02x", - rec->scsi_allowed); - if (strncmp(rec->tag, "abrt", ZFCP_DBF_TAG_SIZE) == 0) { - len += zfcp_dbf_view(out_buf + len, "old_fsf_reqid", "0x%0Lx", - rec->type.old_fsf_reqid); - } - len += zfcp_dbf_view(out_buf + len, "fsf_reqid", "0x%0Lx", - rec->fsf_reqid); - len += zfcp_dbf_view(out_buf + len, "fsf_seqno", "0x%08x", - rec->fsf_seqno); - zfcp_dbf_timestamp(rec->fsf_issued, &t); - len += zfcp_dbf_view(out_buf + len, "fsf_issued", "%011lu:%06lu", - t.tv_sec, t.tv_nsec); - if (strncmp(rec->tag, "rslt", ZFCP_DBF_TAG_SIZE) == 0) { - len += - zfcp_dbf_view(out_buf + len, "fcp_rsp_validity", "0x%02x", - rec->type.fcp.rsp_validity); - len += - zfcp_dbf_view(out_buf + len, "fcp_rsp_scsi_status", - "0x%02x", rec->type.fcp.rsp_scsi_status); - len += - zfcp_dbf_view(out_buf + len, "fcp_rsp_resid", "0x%08x", - rec->type.fcp.rsp_resid); - len += - zfcp_dbf_view(out_buf + len, "fcp_rsp_code", "0x%08x", - rec->type.fcp.rsp_code); - len += - zfcp_dbf_view(out_buf + len, "fcp_sns_info_len", "0x%08x", - rec->type.fcp.sns_info_len); - len += - zfcp_dbf_view_dump(out_buf + len, "fcp_sns_info", - rec->type.fcp.sns_info, - min((int)rec->type.fcp.sns_info_len, - ZFCP_DBF_SCSI_FCP_SNS_INFO), 0, - rec->type.fcp.sns_info_len); + p += zfcp_dbf_tag(p, "tag", r->tag); + p += zfcp_dbf_tag(p, "tag2", r->tag2); + zfcp_dbf_out(&p, "scsi_id", "0x%08x", r->scsi_id); + zfcp_dbf_out(&p, "scsi_lun", "0x%08x", r->scsi_lun); + zfcp_dbf_out(&p, "scsi_result", "0x%08x", r->scsi_result); + zfcp_dbf_out(&p, "scsi_cmnd", "0x%0Lx", r->scsi_cmnd); + zfcp_dbf_out(&p, "scsi_serial", "0x%016Lx", r->scsi_serial); + p += zfcp_dbf_view_dump(p, "scsi_opcode", r->scsi_opcode, + ZFCP_DBF_SCSI_OPCODE, 0, ZFCP_DBF_SCSI_OPCODE); + zfcp_dbf_out(&p, "scsi_retries", "0x%02x", r->scsi_retries); + zfcp_dbf_out(&p, "scsi_allowed", "0x%02x", r->scsi_allowed); + if (strncmp(r->tag, "abrt", ZFCP_DBF_TAG_SIZE) == 0) + zfcp_dbf_out(&p, "old_fsf_reqid", "0x%0Lx", + r->type.old_fsf_reqid); + zfcp_dbf_out(&p, "fsf_reqid", "0x%0Lx", r->fsf_reqid); + zfcp_dbf_out(&p, "fsf_seqno", "0x%08x", r->fsf_seqno); + zfcp_dbf_timestamp(r->fsf_issued, &t); + zfcp_dbf_out(&p, "fsf_issued", "%011lu:%06lu", t.tv_sec, t.tv_nsec); + + if (strncmp(r->tag, "rslt", ZFCP_DBF_TAG_SIZE) == 0) { + zfcp_dbf_out(&p, "fcp_rsp_validity", "0x%02x", + r->type.fcp.rsp_validity); + zfcp_dbf_out(&p, "fcp_rsp_scsi_status", + "0x%02x", r->type.fcp.rsp_scsi_status); + zfcp_dbf_out(&p, "fcp_rsp_resid", "0x%08x", + r->type.fcp.rsp_resid); + zfcp_dbf_out(&p, "fcp_rsp_code", "0x%08x", + r->type.fcp.rsp_code); + zfcp_dbf_out(&p, "fcp_sns_info_len", "0x%08x", + r->type.fcp.sns_info_len); + p += zfcp_dbf_view_dump(p, "fcp_sns_info", + r->type.fcp.sns_info, + min((int)r->type.fcp.sns_info_len, + ZFCP_DBF_SCSI_FCP_SNS_INFO), 0, + r->type.fcp.sns_info_len); } - - len += sprintf(out_buf + len, "\n"); - - return len; + p += sprintf(p, "\n"); + return p - out_buf; } static struct debug_view zfcp_scsi_dbf_view = { -- cgit v1.2.3 From c7b7fc8c30df49a4ca5743d5f062666adcc1dc15 Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Mon, 31 Mar 2008 11:15:25 +0200 Subject: [SCSI] zfcp: Remove obsolete output function from debug trace. Remove obsolete output function. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.c | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 15b534206b3..427115b17ed 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -74,21 +74,6 @@ static int zfcp_dbf_tag(char *out_buf, const char *label, const char *tag) return len; } -static int -zfcp_dbf_view(char *out_buf, const char *label, const char *format, ...) -{ - va_list arg; - int len = 0; - - len += sprintf(out_buf + len, "%-24s", label); - va_start(arg, format); - len += vsprintf(out_buf + len, format, arg); - va_end(arg); - len += sprintf(out_buf + len, "\n"); - - return len; -} - static void zfcp_dbf_outs(char **buf, const char *s1, const char *s2) { *buf += sprintf(*buf, "%-24s%s\n", s1, s2); -- cgit v1.2.3 From df29f4ac4d3e8fcc8d8c85b7aeb8cc0df2a3f68a Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Mon, 31 Mar 2008 11:15:26 +0200 Subject: [SCSI] zfcp: Simplify usage of hex dump output function for debug trace. Simplify usage of output function for hex dumps. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.c | 69 ++++++++++++++++++-------------------------- 1 file changed, 28 insertions(+), 41 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 427115b17ed..0341fc5e06c 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -90,33 +90,26 @@ static void zfcp_dbf_out(char **buf, const char *s, const char *format, ...) *buf += sprintf(*buf, "\n"); } -static int -zfcp_dbf_view_dump(char *out_buf, const char *label, - char *buffer, int buflen, int offset, int total_size) +static void zfcp_dbf_outd(char **p, const char *label, char *buffer, + int buflen, int offset, int total_size) { - int len = 0; - - if (offset == 0) - len += sprintf(out_buf + len, "%-24s ", label); - + if (!offset) + *p += sprintf(*p, "%-24s ", label); while (buflen--) { if (offset > 0) { if ((offset % 32) == 0) - len += sprintf(out_buf + len, "\n%-24c ", ' '); + *p += sprintf(*p, "\n%-24c ", ' '); else if ((offset % 4) == 0) - len += sprintf(out_buf + len, " "); + *p += sprintf(*p, " "); } - len += sprintf(out_buf + len, "%02x", *buffer++); + *p += sprintf(*p, "%02x", *buffer++); if (++offset == total_size) { - len += sprintf(out_buf + len, "\n"); + *p += sprintf(*p, "\n"); break; } } - - if (total_size == 0) - len += sprintf(out_buf + len, "\n"); - - return len; + if (!total_size) + *p += sprintf(*p, "\n"); } static int @@ -133,8 +126,8 @@ zfcp_dbf_view_header(debug_info_t * id, struct debug_view *view, int area, t.tv_sec, t.tv_nsec); zfcp_dbf_out(&p, "cpu", "%02i", entry->id.fields.cpuid); } else { - p += zfcp_dbf_view_dump(p, NULL, dump->data, dump->size, - dump->offset, dump->total_size); + zfcp_dbf_outd(&p, NULL, dump->data, dump->size, dump->offset, + dump->total_size); if ((dump->offset + dump->size) == dump->total_size) p += sprintf(p, "\n"); } @@ -348,14 +341,10 @@ static int zfcp_hba_dbf_view_response(char *buf, zfcp_dbf_out(&p, "fsf_issued", "%011lu:%06lu", t.tv_sec, t.tv_nsec); zfcp_dbf_out(&p, "fsf_prot_status", "0x%08x", r->fsf_prot_status); zfcp_dbf_out(&p, "fsf_status", "0x%08x", r->fsf_status); - p += zfcp_dbf_view_dump(p, "fsf_prot_status_qual", - r->fsf_prot_status_qual, - FSF_PROT_STATUS_QUAL_SIZE, - 0, FSF_PROT_STATUS_QUAL_SIZE); - p += zfcp_dbf_view_dump(p, "fsf_status_qual", - r->fsf_status_qual, - FSF_STATUS_QUALIFIER_SIZE, - 0, FSF_STATUS_QUALIFIER_SIZE); + zfcp_dbf_outd(&p, "fsf_prot_status_qual", r->fsf_prot_status_qual, + FSF_PROT_STATUS_QUAL_SIZE, 0, FSF_PROT_STATUS_QUAL_SIZE); + zfcp_dbf_outd(&p, "fsf_status_qual", r->fsf_status_qual, + FSF_STATUS_QUALIFIER_SIZE, 0, FSF_STATUS_QUALIFIER_SIZE); zfcp_dbf_out(&p, "fsf_req_status", "0x%08x", r->fsf_req_status); zfcp_dbf_out(&p, "sbal_first", "0x%02x", r->sbal_first); zfcp_dbf_out(&p, "sbal_curr", "0x%02x", r->sbal_curr); @@ -415,12 +404,11 @@ static int zfcp_hba_dbf_view_status(char *buf, zfcp_dbf_out(&p, "failed", "0x%02x", r->failed); zfcp_dbf_out(&p, "status_type", "0x%08x", r->status_type); zfcp_dbf_out(&p, "status_subtype", "0x%08x", r->status_subtype); - p += zfcp_dbf_view_dump(p, "queue_designator", - (char *)&r->queue_designator, - sizeof(struct fsf_queue_designator), - 0, sizeof(struct fsf_queue_designator)); - p += zfcp_dbf_view_dump(p, "payload", (char *)&r->payload, - r->payload_size, 0, r->payload_size); + zfcp_dbf_outd(&p, "queue_designator", (char *)&r->queue_designator, + sizeof(struct fsf_queue_designator), 0, + sizeof(struct fsf_queue_designator)); + zfcp_dbf_outd(&p, "payload", (char *)&r->payload, r->payload_size, 0, + r->payload_size); return p - buf; } @@ -1031,7 +1019,7 @@ zfcp_san_dbf_view_format(debug_info_t * id, struct debug_view *view, buflen = min(total, ZFCP_DBF_ELS_PAYLOAD); } - p += zfcp_dbf_view_dump(p, "payload", buffer, buflen, 0, total); + zfcp_dbf_outd(&p, "payload", buffer, buflen, 0, total); if (buflen == total) p += sprintf(p, "\n"); @@ -1179,8 +1167,8 @@ zfcp_scsi_dbf_view_format(debug_info_t * id, struct debug_view *view, zfcp_dbf_out(&p, "scsi_result", "0x%08x", r->scsi_result); zfcp_dbf_out(&p, "scsi_cmnd", "0x%0Lx", r->scsi_cmnd); zfcp_dbf_out(&p, "scsi_serial", "0x%016Lx", r->scsi_serial); - p += zfcp_dbf_view_dump(p, "scsi_opcode", r->scsi_opcode, - ZFCP_DBF_SCSI_OPCODE, 0, ZFCP_DBF_SCSI_OPCODE); + zfcp_dbf_outd(&p, "scsi_opcode", r->scsi_opcode, ZFCP_DBF_SCSI_OPCODE, + 0, ZFCP_DBF_SCSI_OPCODE); zfcp_dbf_out(&p, "scsi_retries", "0x%02x", r->scsi_retries); zfcp_dbf_out(&p, "scsi_allowed", "0x%02x", r->scsi_allowed); if (strncmp(r->tag, "abrt", ZFCP_DBF_TAG_SIZE) == 0) @@ -1202,11 +1190,10 @@ zfcp_scsi_dbf_view_format(debug_info_t * id, struct debug_view *view, r->type.fcp.rsp_code); zfcp_dbf_out(&p, "fcp_sns_info_len", "0x%08x", r->type.fcp.sns_info_len); - p += zfcp_dbf_view_dump(p, "fcp_sns_info", - r->type.fcp.sns_info, - min((int)r->type.fcp.sns_info_len, - ZFCP_DBF_SCSI_FCP_SNS_INFO), 0, - r->type.fcp.sns_info_len); + zfcp_dbf_outd(&p, "fcp_sns_info", r->type.fcp.sns_info, + min((int)r->type.fcp.sns_info_len, + ZFCP_DBF_SCSI_FCP_SNS_INFO), 0, + r->type.fcp.sns_info_len); } p += sprintf(p, "\n"); return p - out_buf; -- cgit v1.2.3 From a9c857757ea09b63040bba7ab149557ac2bfb274 Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Mon, 31 Mar 2008 11:15:27 +0200 Subject: [SCSI] zfcp: Simplify zfcp_dbf_tag and related functions in debug trace. Simplify usage of zfcp_dbf_tag() and calling functions. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.c | 143 ++++++++++++++++++++----------------------- 1 file changed, 65 insertions(+), 78 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 0341fc5e06c..0ab985c037f 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -62,16 +62,14 @@ static void zfcp_dbf_timestamp(unsigned long long stck, struct timespec *time) time->tv_nsec = ((stck * 1000) >> 12); } -static int zfcp_dbf_tag(char *out_buf, const char *label, const char *tag) +static void zfcp_dbf_tag(char **p, const char *label, const char *tag) { - int len = 0, i; + int i; - len += sprintf(out_buf + len, "%-24s", label); + *p += sprintf(*p, "%-24s", label); for (i = 0; i < ZFCP_DBF_TAG_SIZE; i++) - len += sprintf(out_buf + len, "%c", tag[i]); - len += sprintf(out_buf + len, "\n"); - - return len; + *p += sprintf(*p, "%c", tag[i]); + *p += sprintf(*p, "\n"); } static void zfcp_dbf_outs(char **buf, const char *s1, const char *s2) @@ -328,61 +326,60 @@ zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter, unsigned int status, spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags); } -static int zfcp_hba_dbf_view_response(char *buf, - struct zfcp_hba_dbf_record_response *r) +static void zfcp_hba_dbf_view_response(char **p, + struct zfcp_hba_dbf_record_response *r) { struct timespec t; - char *p = buf; - zfcp_dbf_out(&p, "fsf_command", "0x%08x", r->fsf_command); - zfcp_dbf_out(&p, "fsf_reqid", "0x%0Lx", r->fsf_reqid); - zfcp_dbf_out(&p, "fsf_seqno", "0x%08x", r->fsf_seqno); + zfcp_dbf_out(p, "fsf_command", "0x%08x", r->fsf_command); + zfcp_dbf_out(p, "fsf_reqid", "0x%0Lx", r->fsf_reqid); + zfcp_dbf_out(p, "fsf_seqno", "0x%08x", r->fsf_seqno); zfcp_dbf_timestamp(r->fsf_issued, &t); - zfcp_dbf_out(&p, "fsf_issued", "%011lu:%06lu", t.tv_sec, t.tv_nsec); - zfcp_dbf_out(&p, "fsf_prot_status", "0x%08x", r->fsf_prot_status); - zfcp_dbf_out(&p, "fsf_status", "0x%08x", r->fsf_status); - zfcp_dbf_outd(&p, "fsf_prot_status_qual", r->fsf_prot_status_qual, + zfcp_dbf_out(p, "fsf_issued", "%011lu:%06lu", t.tv_sec, t.tv_nsec); + zfcp_dbf_out(p, "fsf_prot_status", "0x%08x", r->fsf_prot_status); + zfcp_dbf_out(p, "fsf_status", "0x%08x", r->fsf_status); + zfcp_dbf_outd(p, "fsf_prot_status_qual", r->fsf_prot_status_qual, FSF_PROT_STATUS_QUAL_SIZE, 0, FSF_PROT_STATUS_QUAL_SIZE); - zfcp_dbf_outd(&p, "fsf_status_qual", r->fsf_status_qual, + zfcp_dbf_outd(p, "fsf_status_qual", r->fsf_status_qual, FSF_STATUS_QUALIFIER_SIZE, 0, FSF_STATUS_QUALIFIER_SIZE); - zfcp_dbf_out(&p, "fsf_req_status", "0x%08x", r->fsf_req_status); - zfcp_dbf_out(&p, "sbal_first", "0x%02x", r->sbal_first); - zfcp_dbf_out(&p, "sbal_curr", "0x%02x", r->sbal_curr); - zfcp_dbf_out(&p, "sbal_last", "0x%02x", r->sbal_last); - zfcp_dbf_out(&p, "pool", "0x%02x", r->pool); + zfcp_dbf_out(p, "fsf_req_status", "0x%08x", r->fsf_req_status); + zfcp_dbf_out(p, "sbal_first", "0x%02x", r->sbal_first); + zfcp_dbf_out(p, "sbal_curr", "0x%02x", r->sbal_curr); + zfcp_dbf_out(p, "sbal_last", "0x%02x", r->sbal_last); + zfcp_dbf_out(p, "pool", "0x%02x", r->pool); switch (r->fsf_command) { case FSF_QTCB_FCP_CMND: if (r->fsf_req_status & ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT) break; - zfcp_dbf_out(&p, "scsi_cmnd", "0x%0Lx", + zfcp_dbf_out(p, "scsi_cmnd", "0x%0Lx", r->data.send_fcp.scsi_cmnd); - zfcp_dbf_out(&p, "scsi_serial", "0x%016Lx", + zfcp_dbf_out(p, "scsi_serial", "0x%016Lx", r->data.send_fcp.scsi_serial); break; case FSF_QTCB_OPEN_PORT_WITH_DID: case FSF_QTCB_CLOSE_PORT: case FSF_QTCB_CLOSE_PHYSICAL_PORT: - zfcp_dbf_out(&p, "wwpn", "0x%016Lx", r->data.port.wwpn); - zfcp_dbf_out(&p, "d_id", "0x%06x", r->data.port.d_id); - zfcp_dbf_out(&p, "port_handle", "0x%08x", + zfcp_dbf_out(p, "wwpn", "0x%016Lx", r->data.port.wwpn); + zfcp_dbf_out(p, "d_id", "0x%06x", r->data.port.d_id); + zfcp_dbf_out(p, "port_handle", "0x%08x", r->data.port.port_handle); break; case FSF_QTCB_OPEN_LUN: case FSF_QTCB_CLOSE_LUN: - zfcp_dbf_out(&p, "wwpn", "0x%016Lx", r->data.unit.wwpn); - zfcp_dbf_out(&p, "fcp_lun", "0x%016Lx", r->data.unit.fcp_lun); - zfcp_dbf_out(&p, "port_handle", "0x%08x", + zfcp_dbf_out(p, "wwpn", "0x%016Lx", r->data.unit.wwpn); + zfcp_dbf_out(p, "fcp_lun", "0x%016Lx", r->data.unit.fcp_lun); + zfcp_dbf_out(p, "port_handle", "0x%08x", r->data.unit.port_handle); - zfcp_dbf_out(&p, "lun_handle", "0x%08x", + zfcp_dbf_out(p, "lun_handle", "0x%08x", r->data.unit.lun_handle); break; case FSF_QTCB_SEND_ELS: - zfcp_dbf_out(&p, "d_id", "0x%06x", r->data.send_els.d_id); - zfcp_dbf_out(&p, "ls_code", "0x%02x", r->data.send_els.ls_code); + zfcp_dbf_out(p, "d_id", "0x%06x", r->data.send_els.d_id); + zfcp_dbf_out(p, "ls_code", "0x%02x", r->data.send_els.ls_code); break; case FSF_QTCB_ABORT_FCP_CMND: @@ -393,62 +390,52 @@ static int zfcp_hba_dbf_view_response(char *buf, case FSF_QTCB_UPLOAD_CONTROL_FILE: break; } - return p - buf; } -static int zfcp_hba_dbf_view_status(char *buf, - struct zfcp_hba_dbf_record_status *r) +static void zfcp_hba_dbf_view_status(char **p, + struct zfcp_hba_dbf_record_status *r) { - char *p = buf; - - zfcp_dbf_out(&p, "failed", "0x%02x", r->failed); - zfcp_dbf_out(&p, "status_type", "0x%08x", r->status_type); - zfcp_dbf_out(&p, "status_subtype", "0x%08x", r->status_subtype); - zfcp_dbf_outd(&p, "queue_designator", (char *)&r->queue_designator, + zfcp_dbf_out(p, "failed", "0x%02x", r->failed); + zfcp_dbf_out(p, "status_type", "0x%08x", r->status_type); + zfcp_dbf_out(p, "status_subtype", "0x%08x", r->status_subtype); + zfcp_dbf_outd(p, "queue_designator", (char *)&r->queue_designator, sizeof(struct fsf_queue_designator), 0, sizeof(struct fsf_queue_designator)); - zfcp_dbf_outd(&p, "payload", (char *)&r->payload, r->payload_size, 0, + zfcp_dbf_outd(p, "payload", (char *)&r->payload, r->payload_size, 0, r->payload_size); - return p - buf; } -static int zfcp_hba_dbf_view_qdio(char *buf, struct zfcp_hba_dbf_record_qdio *r) +static void zfcp_hba_dbf_view_qdio(char **p, struct zfcp_hba_dbf_record_qdio *r) { - char *p = buf; - - zfcp_dbf_out(&p, "status", "0x%08x", r->status); - zfcp_dbf_out(&p, "qdio_error", "0x%08x", r->qdio_error); - zfcp_dbf_out(&p, "siga_error", "0x%08x", r->siga_error); - zfcp_dbf_out(&p, "sbal_index", "0x%02x", r->sbal_index); - zfcp_dbf_out(&p, "sbal_count", "0x%02x", r->sbal_count); - return p - buf; + zfcp_dbf_out(p, "status", "0x%08x", r->status); + zfcp_dbf_out(p, "qdio_error", "0x%08x", r->qdio_error); + zfcp_dbf_out(p, "siga_error", "0x%08x", r->siga_error); + zfcp_dbf_out(p, "sbal_index", "0x%02x", r->sbal_index); + zfcp_dbf_out(p, "sbal_count", "0x%02x", r->sbal_count); } -static int -zfcp_hba_dbf_view_format(debug_info_t * id, struct debug_view *view, - char *out_buf, const char *in_buf) +static int zfcp_hba_dbf_view_format(debug_info_t *id, struct debug_view *view, + char *out_buf, const char *in_buf) { - struct zfcp_hba_dbf_record *rec = (struct zfcp_hba_dbf_record *)in_buf; - int len = 0; + struct zfcp_hba_dbf_record *r = (struct zfcp_hba_dbf_record *)in_buf; + char *p = out_buf; - if (strncmp(rec->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0) + if (strncmp(r->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0) return 0; - len += zfcp_dbf_tag(out_buf + len, "tag", rec->tag); - if (isalpha(rec->tag2[0])) - len += zfcp_dbf_tag(out_buf + len, "tag2", rec->tag2); - if (strncmp(rec->tag, "resp", ZFCP_DBF_TAG_SIZE) == 0) - len += zfcp_hba_dbf_view_response(out_buf + len, - &rec->type.response); - else if (strncmp(rec->tag, "stat", ZFCP_DBF_TAG_SIZE) == 0) - len += zfcp_hba_dbf_view_status(out_buf + len, - &rec->type.status); - else if (strncmp(rec->tag, "qdio", ZFCP_DBF_TAG_SIZE) == 0) - len += zfcp_hba_dbf_view_qdio(out_buf + len, &rec->type.qdio); - - len += sprintf(out_buf + len, "\n"); - - return len; + zfcp_dbf_tag(&p, "tag", r->tag); + if (isalpha(r->tag2[0])) + zfcp_dbf_tag(&p, "tag2", r->tag2); + + if (strncmp(r->tag, "resp", ZFCP_DBF_TAG_SIZE) == 0) + zfcp_hba_dbf_view_response(&p, &r->type.response); + else if (strncmp(r->tag, "stat", ZFCP_DBF_TAG_SIZE) == 0) + zfcp_hba_dbf_view_status(&p, &r->type.status); + else if (strncmp(r->tag, "qdio", ZFCP_DBF_TAG_SIZE) == 0) + zfcp_hba_dbf_view_qdio(&p, &r->type.qdio); + + p += sprintf(p, "\n"); + return p - out_buf; } static struct debug_view zfcp_hba_dbf_view = { @@ -973,7 +960,7 @@ zfcp_san_dbf_view_format(debug_info_t * id, struct debug_view *view, if (strncmp(r->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0) return 0; - p += zfcp_dbf_tag(p, "tag", r->tag); + zfcp_dbf_tag(&p, "tag", r->tag); zfcp_dbf_out(&p, "fsf_reqid", "0x%0Lx", r->fsf_reqid); zfcp_dbf_out(&p, "fsf_seqno", "0x%08x", r->fsf_seqno); zfcp_dbf_out(&p, "s_id", "0x%06x", r->s_id); @@ -1160,8 +1147,8 @@ zfcp_scsi_dbf_view_format(debug_info_t * id, struct debug_view *view, if (strncmp(r->tag, "dump", ZFCP_DBF_TAG_SIZE) == 0) return 0; - p += zfcp_dbf_tag(p, "tag", r->tag); - p += zfcp_dbf_tag(p, "tag2", r->tag2); + zfcp_dbf_tag(&p, "tag", r->tag); + zfcp_dbf_tag(&p, "tag2", r->tag2); zfcp_dbf_out(&p, "scsi_id", "0x%08x", r->scsi_id); zfcp_dbf_out(&p, "scsi_lun", "0x%08x", r->scsi_lun); zfcp_dbf_out(&p, "scsi_result", "0x%08x", r->scsi_result); -- cgit v1.2.3 From 2b604c9b909ce1c98e51208eee2f70ee3e604079 Mon Sep 17 00:00:00 2001 From: Christof Schmitt Date: Mon, 31 Mar 2008 11:15:28 +0200 Subject: [SCSI] zfcp: Move DBF definitions to private header file Unclutter the global zfcp_def.h header. Move everything required to call into the debug feature to a new header file. Signed-off-by: Christof Schmitt Signed-off-by: Martin Peschke Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.h | 233 +++++++++++++++++++++++++++++++++++++++++++ drivers/s390/scsi/zfcp_def.h | 210 +------------------------------------- 2 files changed, 234 insertions(+), 209 deletions(-) create mode 100644 drivers/s390/scsi/zfcp_dbf.h (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h new file mode 100644 index 00000000000..5d88c01d598 --- /dev/null +++ b/drivers/s390/scsi/zfcp_dbf.h @@ -0,0 +1,233 @@ +/* + * This file is part of the zfcp device driver for + * FCP adapters for IBM System z9 and zSeries. + * + * Copyright IBM Corp. 2008, 2008 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef ZFCP_DBF_H +#define ZFCP_DBF_H + +#include "zfcp_fsf.h" + +#define ZFCP_DBF_TAG_SIZE 4 + +struct zfcp_dbf_dump { + u8 tag[ZFCP_DBF_TAG_SIZE]; + u32 total_size; /* size of total dump data */ + u32 offset; /* how much data has being already dumped */ + u32 size; /* how much data comes with this record */ + u8 data[]; /* dump data */ +} __attribute__ ((packed)); + +struct zfcp_rec_dbf_record_thread { + u32 sema; + u32 total; + u32 ready; + u32 running; +} __attribute__ ((packed)); + +struct zfcp_rec_dbf_record_target { + u64 ref; + u32 status; + u32 d_id; + u64 wwpn; + u64 fcp_lun; + u32 erp_count; +} __attribute__ ((packed)); + +struct zfcp_rec_dbf_record_trigger { + u8 want; + u8 need; + u32 as; + u32 ps; + u32 us; + u64 ref; + u64 action; + u64 wwpn; + u64 fcp_lun; +} __attribute__ ((packed)); + +struct zfcp_rec_dbf_record_action { + u32 status; + u32 step; + u64 action; + u64 fsf_req; +} __attribute__ ((packed)); + +struct zfcp_rec_dbf_record { + u8 id; + u8 id2; + union { + struct zfcp_rec_dbf_record_action action; + struct zfcp_rec_dbf_record_thread thread; + struct zfcp_rec_dbf_record_target target; + struct zfcp_rec_dbf_record_trigger trigger; + } u; +} __attribute__ ((packed)); + +enum { + ZFCP_REC_DBF_ID_ACTION, + ZFCP_REC_DBF_ID_THREAD, + ZFCP_REC_DBF_ID_TARGET, + ZFCP_REC_DBF_ID_TRIGGER, +}; + +struct zfcp_hba_dbf_record_response { + u32 fsf_command; + u64 fsf_reqid; + u32 fsf_seqno; + u64 fsf_issued; + u32 fsf_prot_status; + u32 fsf_status; + u8 fsf_prot_status_qual[FSF_PROT_STATUS_QUAL_SIZE]; + u8 fsf_status_qual[FSF_STATUS_QUALIFIER_SIZE]; + u32 fsf_req_status; + u8 sbal_first; + u8 sbal_curr; + u8 sbal_last; + u8 pool; + u64 erp_action; + union { + struct { + u64 scsi_cmnd; + u64 scsi_serial; + } send_fcp; + struct { + u64 wwpn; + u32 d_id; + u32 port_handle; + } port; + struct { + u64 wwpn; + u64 fcp_lun; + u32 port_handle; + u32 lun_handle; + } unit; + struct { + u32 d_id; + u8 ls_code; + } send_els; + } data; +} __attribute__ ((packed)); + +struct zfcp_hba_dbf_record_status { + u8 failed; + u32 status_type; + u32 status_subtype; + struct fsf_queue_designator + queue_designator; + u32 payload_size; +#define ZFCP_DBF_UNSOL_PAYLOAD 80 +#define ZFCP_DBF_UNSOL_PAYLOAD_SENSE_DATA_AVAIL 32 +#define ZFCP_DBF_UNSOL_PAYLOAD_BIT_ERROR_THRESHOLD 56 +#define ZFCP_DBF_UNSOL_PAYLOAD_FEATURE_UPDATE_ALERT 2 * sizeof(u32) + u8 payload[ZFCP_DBF_UNSOL_PAYLOAD]; +} __attribute__ ((packed)); + +struct zfcp_hba_dbf_record_qdio { + u32 status; + u32 qdio_error; + u32 siga_error; + u8 sbal_index; + u8 sbal_count; +} __attribute__ ((packed)); + +struct zfcp_hba_dbf_record { + u8 tag[ZFCP_DBF_TAG_SIZE]; + u8 tag2[ZFCP_DBF_TAG_SIZE]; + union { + struct zfcp_hba_dbf_record_response response; + struct zfcp_hba_dbf_record_status status; + struct zfcp_hba_dbf_record_qdio qdio; + } type; +} __attribute__ ((packed)); + +struct zfcp_san_dbf_record_ct { + union { + struct { + u16 cmd_req_code; + u8 revision; + u8 gs_type; + u8 gs_subtype; + u8 options; + u16 max_res_size; + } request; + struct { + u16 cmd_rsp_code; + u8 revision; + u8 reason_code; + u8 reason_code_expl; + u8 vendor_unique; + } response; + } type; + u32 payload_size; +#define ZFCP_DBF_CT_PAYLOAD 24 + u8 payload[ZFCP_DBF_CT_PAYLOAD]; +} __attribute__ ((packed)); + +struct zfcp_san_dbf_record_els { + u8 ls_code; + u32 payload_size; +#define ZFCP_DBF_ELS_PAYLOAD 32 +#define ZFCP_DBF_ELS_MAX_PAYLOAD 1024 + u8 payload[ZFCP_DBF_ELS_PAYLOAD]; +} __attribute__ ((packed)); + +struct zfcp_san_dbf_record { + u8 tag[ZFCP_DBF_TAG_SIZE]; + u64 fsf_reqid; + u32 fsf_seqno; + u32 s_id; + u32 d_id; + union { + struct zfcp_san_dbf_record_ct ct; + struct zfcp_san_dbf_record_els els; + } type; +} __attribute__ ((packed)); + +struct zfcp_scsi_dbf_record { + u8 tag[ZFCP_DBF_TAG_SIZE]; + u8 tag2[ZFCP_DBF_TAG_SIZE]; + u32 scsi_id; + u32 scsi_lun; + u32 scsi_result; + u64 scsi_cmnd; + u64 scsi_serial; +#define ZFCP_DBF_SCSI_OPCODE 16 + u8 scsi_opcode[ZFCP_DBF_SCSI_OPCODE]; + u8 scsi_retries; + u8 scsi_allowed; + u64 fsf_reqid; + u32 fsf_seqno; + u64 fsf_issued; + union { + u64 old_fsf_reqid; + struct { + u8 rsp_validity; + u8 rsp_scsi_status; + u32 rsp_resid; + u8 rsp_code; +#define ZFCP_DBF_SCSI_FCP_SNS_INFO 16 +#define ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO 256 + u32 sns_info_len; + u8 sns_info[ZFCP_DBF_SCSI_FCP_SNS_INFO]; + } fcp; + } type; +} __attribute__ ((packed)); + +#endif /* ZFCP_DBF_H */ diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 85c0488719f..ac23be50fd7 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -47,6 +47,7 @@ #include #include #include +#include "zfcp_dbf.h" #include "zfcp_fsf.h" @@ -261,215 +262,6 @@ struct fcp_logo { wwn_t nport_wwpn; } __attribute__((packed)); -/* - * DBF stuff - */ -#define ZFCP_DBF_TAG_SIZE 4 - -struct zfcp_dbf_dump { - u8 tag[ZFCP_DBF_TAG_SIZE]; - u32 total_size; /* size of total dump data */ - u32 offset; /* how much data has being already dumped */ - u32 size; /* how much data comes with this record */ - u8 data[]; /* dump data */ -} __attribute__ ((packed)); - -struct zfcp_rec_dbf_record_thread { - u32 sema; - u32 total; - u32 ready; - u32 running; -} __attribute__ ((packed)); - -struct zfcp_rec_dbf_record_target { - u64 ref; - u32 status; - u32 d_id; - u64 wwpn; - u64 fcp_lun; - u32 erp_count; -} __attribute__ ((packed)); - -struct zfcp_rec_dbf_record_trigger { - u8 want; - u8 need; - u32 as; - u32 ps; - u32 us; - u64 ref; - u64 action; - u64 wwpn; - u64 fcp_lun; -} __attribute__ ((packed)); - -struct zfcp_rec_dbf_record_action { - u32 status; - u32 step; - u64 action; - u64 fsf_req; -} __attribute__ ((packed)); - -struct zfcp_rec_dbf_record { - u8 id; - u8 id2; - union { - struct zfcp_rec_dbf_record_action action; - struct zfcp_rec_dbf_record_thread thread; - struct zfcp_rec_dbf_record_target target; - struct zfcp_rec_dbf_record_trigger trigger; - } u; -} __attribute__ ((packed)); - -enum { - ZFCP_REC_DBF_ID_ACTION, - ZFCP_REC_DBF_ID_THREAD, - ZFCP_REC_DBF_ID_TARGET, - ZFCP_REC_DBF_ID_TRIGGER, -}; - -struct zfcp_hba_dbf_record_response { - u32 fsf_command; - u64 fsf_reqid; - u32 fsf_seqno; - u64 fsf_issued; - u32 fsf_prot_status; - u32 fsf_status; - u8 fsf_prot_status_qual[FSF_PROT_STATUS_QUAL_SIZE]; - u8 fsf_status_qual[FSF_STATUS_QUALIFIER_SIZE]; - u32 fsf_req_status; - u8 sbal_first; - u8 sbal_curr; - u8 sbal_last; - u8 pool; - u64 erp_action; - union { - struct { - u64 scsi_cmnd; - u64 scsi_serial; - } send_fcp; - struct { - u64 wwpn; - u32 d_id; - u32 port_handle; - } port; - struct { - u64 wwpn; - u64 fcp_lun; - u32 port_handle; - u32 lun_handle; - } unit; - struct { - u32 d_id; - u8 ls_code; - } send_els; - } data; -} __attribute__ ((packed)); - -struct zfcp_hba_dbf_record_status { - u8 failed; - u32 status_type; - u32 status_subtype; - struct fsf_queue_designator - queue_designator; - u32 payload_size; -#define ZFCP_DBF_UNSOL_PAYLOAD 80 -#define ZFCP_DBF_UNSOL_PAYLOAD_SENSE_DATA_AVAIL 32 -#define ZFCP_DBF_UNSOL_PAYLOAD_BIT_ERROR_THRESHOLD 56 -#define ZFCP_DBF_UNSOL_PAYLOAD_FEATURE_UPDATE_ALERT 2 * sizeof(u32) - u8 payload[ZFCP_DBF_UNSOL_PAYLOAD]; -} __attribute__ ((packed)); - -struct zfcp_hba_dbf_record_qdio { - u32 status; - u32 qdio_error; - u32 siga_error; - u8 sbal_index; - u8 sbal_count; -} __attribute__ ((packed)); - -struct zfcp_hba_dbf_record { - u8 tag[ZFCP_DBF_TAG_SIZE]; - u8 tag2[ZFCP_DBF_TAG_SIZE]; - union { - struct zfcp_hba_dbf_record_response response; - struct zfcp_hba_dbf_record_status status; - struct zfcp_hba_dbf_record_qdio qdio; - } type; -} __attribute__ ((packed)); - -struct zfcp_san_dbf_record_ct { - union { - struct { - u16 cmd_req_code; - u8 revision; - u8 gs_type; - u8 gs_subtype; - u8 options; - u16 max_res_size; - } request; - struct { - u16 cmd_rsp_code; - u8 revision; - u8 reason_code; - u8 reason_code_expl; - u8 vendor_unique; - } response; - } type; - u32 payload_size; -#define ZFCP_DBF_CT_PAYLOAD 24 - u8 payload[ZFCP_DBF_CT_PAYLOAD]; -} __attribute__ ((packed)); - -struct zfcp_san_dbf_record_els { - u8 ls_code; - u32 payload_size; -#define ZFCP_DBF_ELS_PAYLOAD 32 -#define ZFCP_DBF_ELS_MAX_PAYLOAD 1024 - u8 payload[ZFCP_DBF_ELS_PAYLOAD]; -} __attribute__ ((packed)); - -struct zfcp_san_dbf_record { - u8 tag[ZFCP_DBF_TAG_SIZE]; - u64 fsf_reqid; - u32 fsf_seqno; - u32 s_id; - u32 d_id; - union { - struct zfcp_san_dbf_record_ct ct; - struct zfcp_san_dbf_record_els els; - } type; -} __attribute__ ((packed)); - -struct zfcp_scsi_dbf_record { - u8 tag[ZFCP_DBF_TAG_SIZE]; - u8 tag2[ZFCP_DBF_TAG_SIZE]; - u32 scsi_id; - u32 scsi_lun; - u32 scsi_result; - u64 scsi_cmnd; - u64 scsi_serial; -#define ZFCP_DBF_SCSI_OPCODE 16 - u8 scsi_opcode[ZFCP_DBF_SCSI_OPCODE]; - u8 scsi_retries; - u8 scsi_allowed; - u64 fsf_reqid; - u32 fsf_seqno; - u64 fsf_issued; - union { - u64 old_fsf_reqid; - struct { - u8 rsp_validity; - u8 rsp_scsi_status; - u32 rsp_resid; - u8 rsp_code; -#define ZFCP_DBF_SCSI_FCP_SNS_INFO 16 -#define ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO 256 - u32 sns_info_len; - u8 sns_info[ZFCP_DBF_SCSI_FCP_SNS_INFO]; - } fcp; - } type; -} __attribute__ ((packed)); - /* * FC-FS stuff */ -- cgit v1.2.3 From 6bc473dd324237acbaa7a4c5e73d00dd5fc389ec Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Mon, 31 Mar 2008 11:15:29 +0200 Subject: [SCSI] zfcp: Shorten excessive names in debug trace. Saving on line breaks, improving readability, by shortening excessive function names and identifiers, by simplifying some functions call chains, and by simplifying nesting of some data structure. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.c | 305 +++++++++++++++++++------------------------ drivers/s390/scsi/zfcp_dbf.h | 74 +++++------ 2 files changed, 170 insertions(+), 209 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 0ab985c037f..a39a3e33a5b 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -144,12 +144,12 @@ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req) struct zfcp_unit *unit; struct zfcp_send_els *send_els; struct zfcp_hba_dbf_record *rec = &adapter->hba_dbf_buf; - struct zfcp_hba_dbf_record_response *response = &rec->type.response; + struct zfcp_hba_dbf_record_response *response = &rec->u.response; int level; unsigned long flags; spin_lock_irqsave(&adapter->hba_dbf_lock, flags); - memset(rec, 0, sizeof(struct zfcp_hba_dbf_record)); + memset(rec, 0, sizeof(*rec)); strncpy(rec->tag, "resp", ZFCP_DBF_TAG_SIZE); if ((qtcb->prefix.prot_status != FSF_PROT_GOOD) && @@ -193,11 +193,9 @@ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req) if (fsf_req->status & ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT) break; scsi_cmnd = (struct scsi_cmnd *)fsf_req->data; - if (scsi_cmnd != NULL) { - response->data.send_fcp.scsi_cmnd - = (unsigned long)scsi_cmnd; - response->data.send_fcp.scsi_serial - = scsi_cmnd->serial_number; + if (scsi_cmnd) { + response->u.fcp.cmnd = (unsigned long)scsi_cmnd; + response->u.fcp.serial = scsi_cmnd->serial_number; } break; @@ -205,25 +203,25 @@ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req) case FSF_QTCB_CLOSE_PORT: case FSF_QTCB_CLOSE_PHYSICAL_PORT: port = (struct zfcp_port *)fsf_req->data; - response->data.port.wwpn = port->wwpn; - response->data.port.d_id = port->d_id; - response->data.port.port_handle = qtcb->header.port_handle; + response->u.port.wwpn = port->wwpn; + response->u.port.d_id = port->d_id; + response->u.port.port_handle = qtcb->header.port_handle; break; case FSF_QTCB_OPEN_LUN: case FSF_QTCB_CLOSE_LUN: unit = (struct zfcp_unit *)fsf_req->data; port = unit->port; - response->data.unit.wwpn = port->wwpn; - response->data.unit.fcp_lun = unit->fcp_lun; - response->data.unit.port_handle = qtcb->header.port_handle; - response->data.unit.lun_handle = qtcb->header.lun_handle; + response->u.unit.wwpn = port->wwpn; + response->u.unit.fcp_lun = unit->fcp_lun; + response->u.unit.port_handle = qtcb->header.port_handle; + response->u.unit.lun_handle = qtcb->header.lun_handle; break; case FSF_QTCB_SEND_ELS: send_els = (struct zfcp_send_els *)fsf_req->data; - response->data.send_els.d_id = qtcb->bottom.support.d_id; - response->data.send_els.ls_code = send_els->ls_code >> 24; + response->u.els.d_id = qtcb->bottom.support.d_id; + response->u.els.ls_code = send_els->ls_code >> 24; break; case FSF_QTCB_ABORT_FCP_CMND: @@ -235,8 +233,7 @@ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req) break; } - debug_event(adapter->hba_dbf, level, - rec, sizeof(struct zfcp_hba_dbf_record)); + debug_event(adapter->hba_dbf, level, rec, sizeof(*rec)); /* have fcp channel microcode fixed to use as little as possible */ if (fsf_req->fsf_command != FSF_QTCB_FCP_CMND) { @@ -259,26 +256,26 @@ zfcp_hba_dbf_event_fsf_unsol(const char *tag, struct zfcp_adapter *adapter, unsigned long flags; spin_lock_irqsave(&adapter->hba_dbf_lock, flags); - memset(rec, 0, sizeof(struct zfcp_hba_dbf_record)); + memset(rec, 0, sizeof(*rec)); strncpy(rec->tag, "stat", ZFCP_DBF_TAG_SIZE); strncpy(rec->tag2, tag, ZFCP_DBF_TAG_SIZE); - rec->type.status.failed = adapter->status_read_failed; + rec->u.status.failed = adapter->status_read_failed; if (status_buffer != NULL) { - rec->type.status.status_type = status_buffer->status_type; - rec->type.status.status_subtype = status_buffer->status_subtype; - memcpy(&rec->type.status.queue_designator, + rec->u.status.status_type = status_buffer->status_type; + rec->u.status.status_subtype = status_buffer->status_subtype; + memcpy(&rec->u.status.queue_designator, &status_buffer->queue_designator, sizeof(struct fsf_queue_designator)); switch (status_buffer->status_type) { case FSF_STATUS_READ_SENSE_DATA_AVAIL: - rec->type.status.payload_size = + rec->u.status.payload_size = ZFCP_DBF_UNSOL_PAYLOAD_SENSE_DATA_AVAIL; break; case FSF_STATUS_READ_BIT_ERROR_THRESHOLD: - rec->type.status.payload_size = + rec->u.status.payload_size = ZFCP_DBF_UNSOL_PAYLOAD_BIT_ERROR_THRESHOLD; break; @@ -286,22 +283,21 @@ zfcp_hba_dbf_event_fsf_unsol(const char *tag, struct zfcp_adapter *adapter, switch (status_buffer->status_subtype) { case FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK: case FSF_STATUS_READ_SUB_FDISC_FAILED: - rec->type.status.payload_size = + rec->u.status.payload_size = sizeof(struct fsf_link_down_info); } break; case FSF_STATUS_READ_FEATURE_UPDATE_ALERT: - rec->type.status.payload_size = + rec->u.status.payload_size = ZFCP_DBF_UNSOL_PAYLOAD_FEATURE_UPDATE_ALERT; break; } - memcpy(&rec->type.status.payload, - &status_buffer->payload, rec->type.status.payload_size); + memcpy(&rec->u.status.payload, + &status_buffer->payload, rec->u.status.payload_size); } - debug_event(adapter->hba_dbf, 2, - rec, sizeof(struct zfcp_hba_dbf_record)); + debug_event(adapter->hba_dbf, 2, rec, sizeof(*rec)); spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags); } @@ -310,19 +306,18 @@ zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter, unsigned int status, unsigned int qdio_error, unsigned int siga_error, int sbal_index, int sbal_count) { - struct zfcp_hba_dbf_record *rec = &adapter->hba_dbf_buf; + struct zfcp_hba_dbf_record *r = &adapter->hba_dbf_buf; unsigned long flags; spin_lock_irqsave(&adapter->hba_dbf_lock, flags); - memset(rec, 0, sizeof(struct zfcp_hba_dbf_record)); - strncpy(rec->tag, "qdio", ZFCP_DBF_TAG_SIZE); - rec->type.qdio.status = status; - rec->type.qdio.qdio_error = qdio_error; - rec->type.qdio.siga_error = siga_error; - rec->type.qdio.sbal_index = sbal_index; - rec->type.qdio.sbal_count = sbal_count; - debug_event(adapter->hba_dbf, 0, - rec, sizeof(struct zfcp_hba_dbf_record)); + memset(r, 0, sizeof(*r)); + strncpy(r->tag, "qdio", ZFCP_DBF_TAG_SIZE); + r->u.qdio.status = status; + r->u.qdio.qdio_error = qdio_error; + r->u.qdio.siga_error = siga_error; + r->u.qdio.sbal_index = sbal_index; + r->u.qdio.sbal_count = sbal_count; + debug_event(adapter->hba_dbf, 0, r, sizeof(*r)); spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags); } @@ -352,34 +347,29 @@ static void zfcp_hba_dbf_view_response(char **p, case FSF_QTCB_FCP_CMND: if (r->fsf_req_status & ZFCP_STATUS_FSFREQ_TASK_MANAGEMENT) break; - zfcp_dbf_out(p, "scsi_cmnd", "0x%0Lx", - r->data.send_fcp.scsi_cmnd); - zfcp_dbf_out(p, "scsi_serial", "0x%016Lx", - r->data.send_fcp.scsi_serial); + zfcp_dbf_out(p, "scsi_cmnd", "0x%0Lx", r->u.fcp.cmnd); + zfcp_dbf_out(p, "scsi_serial", "0x%016Lx", r->u.fcp.serial); break; case FSF_QTCB_OPEN_PORT_WITH_DID: case FSF_QTCB_CLOSE_PORT: case FSF_QTCB_CLOSE_PHYSICAL_PORT: - zfcp_dbf_out(p, "wwpn", "0x%016Lx", r->data.port.wwpn); - zfcp_dbf_out(p, "d_id", "0x%06x", r->data.port.d_id); - zfcp_dbf_out(p, "port_handle", "0x%08x", - r->data.port.port_handle); + zfcp_dbf_out(p, "wwpn", "0x%016Lx", r->u.port.wwpn); + zfcp_dbf_out(p, "d_id", "0x%06x", r->u.port.d_id); + zfcp_dbf_out(p, "port_handle", "0x%08x", r->u.port.port_handle); break; case FSF_QTCB_OPEN_LUN: case FSF_QTCB_CLOSE_LUN: - zfcp_dbf_out(p, "wwpn", "0x%016Lx", r->data.unit.wwpn); - zfcp_dbf_out(p, "fcp_lun", "0x%016Lx", r->data.unit.fcp_lun); - zfcp_dbf_out(p, "port_handle", "0x%08x", - r->data.unit.port_handle); - zfcp_dbf_out(p, "lun_handle", "0x%08x", - r->data.unit.lun_handle); + zfcp_dbf_out(p, "wwpn", "0x%016Lx", r->u.unit.wwpn); + zfcp_dbf_out(p, "fcp_lun", "0x%016Lx", r->u.unit.fcp_lun); + zfcp_dbf_out(p, "port_handle", "0x%08x", r->u.unit.port_handle); + zfcp_dbf_out(p, "lun_handle", "0x%08x", r->u.unit.lun_handle); break; case FSF_QTCB_SEND_ELS: - zfcp_dbf_out(p, "d_id", "0x%06x", r->data.send_els.d_id); - zfcp_dbf_out(p, "ls_code", "0x%02x", r->data.send_els.ls_code); + zfcp_dbf_out(p, "d_id", "0x%06x", r->u.els.d_id); + zfcp_dbf_out(p, "ls_code", "0x%02x", r->u.els.ls_code); break; case FSF_QTCB_ABORT_FCP_CMND: @@ -428,11 +418,11 @@ static int zfcp_hba_dbf_view_format(debug_info_t *id, struct debug_view *view, zfcp_dbf_tag(&p, "tag2", r->tag2); if (strncmp(r->tag, "resp", ZFCP_DBF_TAG_SIZE) == 0) - zfcp_hba_dbf_view_response(&p, &r->type.response); + zfcp_hba_dbf_view_response(&p, &r->u.response); else if (strncmp(r->tag, "stat", ZFCP_DBF_TAG_SIZE) == 0) - zfcp_hba_dbf_view_status(&p, &r->type.status); + zfcp_hba_dbf_view_status(&p, &r->u.status); else if (strncmp(r->tag, "qdio", ZFCP_DBF_TAG_SIZE) == 0) - zfcp_hba_dbf_view_qdio(&p, &r->type.qdio); + zfcp_hba_dbf_view_qdio(&p, &r->u.qdio); p += sprintf(p, "\n"); return p - out_buf; @@ -823,57 +813,34 @@ void zfcp_rec_dbf_event_action(u8 id2, struct zfcp_erp_action *erp_action) spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); } -static void -_zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req, - u32 s_id, u32 d_id, void *buffer, int buflen) -{ - struct zfcp_send_ct *send_ct = (struct zfcp_send_ct *)fsf_req->data; - struct zfcp_port *port = send_ct->port; - struct zfcp_adapter *adapter = port->adapter; - struct ct_hdr *header = (struct ct_hdr *)buffer; - struct zfcp_san_dbf_record *rec = &adapter->san_dbf_buf; - struct zfcp_san_dbf_record_ct *ct = &rec->type.ct; - unsigned long flags; - - spin_lock_irqsave(&adapter->san_dbf_lock, flags); - memset(rec, 0, sizeof(struct zfcp_san_dbf_record)); - strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE); - rec->fsf_reqid = (unsigned long)fsf_req; - rec->fsf_seqno = fsf_req->seq_no; - rec->s_id = s_id; - rec->d_id = d_id; - if (strncmp(tag, "octc", ZFCP_DBF_TAG_SIZE) == 0) { - ct->type.request.cmd_req_code = header->cmd_rsp_code; - ct->type.request.revision = header->revision; - ct->type.request.gs_type = header->gs_type; - ct->type.request.gs_subtype = header->gs_subtype; - ct->type.request.options = header->options; - ct->type.request.max_res_size = header->max_res_size; - } else if (strncmp(tag, "rctc", ZFCP_DBF_TAG_SIZE) == 0) { - ct->type.response.cmd_rsp_code = header->cmd_rsp_code; - ct->type.response.revision = header->revision; - ct->type.response.reason_code = header->reason_code; - ct->type.response.reason_code_expl = header->reason_code_expl; - ct->type.response.vendor_unique = header->vendor_unique; - } - ct->payload_size = - min(buflen - (int)sizeof(struct ct_hdr), ZFCP_DBF_CT_PAYLOAD); - memcpy(ct->payload, buffer + sizeof(struct ct_hdr), ct->payload_size); - debug_event(adapter->san_dbf, 3, - rec, sizeof(struct zfcp_san_dbf_record)); - spin_unlock_irqrestore(&adapter->san_dbf_lock, flags); -} - void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req) { struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; struct zfcp_port *port = ct->port; struct zfcp_adapter *adapter = port->adapter; + struct ct_hdr *hdr = zfcp_sg_to_address(ct->req); + struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf; + struct zfcp_san_dbf_record_ct_request *oct = &r->u.ct_req; + unsigned long flags; - _zfcp_san_dbf_event_common_ct("octc", fsf_req, - fc_host_port_id(adapter->scsi_host), - port->d_id, zfcp_sg_to_address(ct->req), - ct->req->length); + spin_lock_irqsave(&adapter->san_dbf_lock, flags); + memset(r, 0, sizeof(*r)); + strncpy(r->tag, "octc", ZFCP_DBF_TAG_SIZE); + r->fsf_reqid = (unsigned long)fsf_req; + r->fsf_seqno = fsf_req->seq_no; + r->s_id = fc_host_port_id(adapter->scsi_host); + r->d_id = port->d_id; + oct->cmd_req_code = hdr->cmd_rsp_code; + oct->revision = hdr->revision; + oct->gs_type = hdr->gs_type; + oct->gs_subtype = hdr->gs_subtype; + oct->options = hdr->options; + oct->max_res_size = hdr->max_res_size; + oct->len = min((int)ct->req->length - (int)sizeof(struct ct_hdr), + ZFCP_DBF_CT_PAYLOAD); + memcpy(oct->payload, (void *)hdr + sizeof(struct ct_hdr), oct->len); + debug_event(adapter->san_dbf, 3, r, sizeof(*r)); + spin_unlock_irqrestore(&adapter->san_dbf_lock, flags); } void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req) @@ -881,11 +848,28 @@ void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req) struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; struct zfcp_port *port = ct->port; struct zfcp_adapter *adapter = port->adapter; + struct ct_hdr *hdr = zfcp_sg_to_address(ct->resp); + struct zfcp_san_dbf_record *r = &adapter->san_dbf_buf; + struct zfcp_san_dbf_record_ct_response *rct = &r->u.ct_resp; + unsigned long flags; - _zfcp_san_dbf_event_common_ct("rctc", fsf_req, port->d_id, - fc_host_port_id(adapter->scsi_host), - zfcp_sg_to_address(ct->resp), - ct->resp->length); + spin_lock_irqsave(&adapter->san_dbf_lock, flags); + memset(r, 0, sizeof(*r)); + strncpy(r->tag, "rctc", ZFCP_DBF_TAG_SIZE); + r->fsf_reqid = (unsigned long)fsf_req; + r->fsf_seqno = fsf_req->seq_no; + r->s_id = port->d_id; + r->d_id = fc_host_port_id(adapter->scsi_host); + rct->cmd_rsp_code = hdr->cmd_rsp_code; + rct->revision = hdr->revision; + rct->reason_code = hdr->reason_code; + rct->expl = hdr->reason_code_expl; + rct->vendor_unique = hdr->vendor_unique; + rct->len = min((int)ct->resp->length - (int)sizeof(struct ct_hdr), + ZFCP_DBF_CT_PAYLOAD); + memcpy(rct->payload, (void *)hdr + sizeof(struct ct_hdr), rct->len); + debug_event(adapter->san_dbf, 3, r, sizeof(*r)); + spin_unlock_irqrestore(&adapter->san_dbf_lock, flags); } static void @@ -898,13 +882,13 @@ _zfcp_san_dbf_event_common_els(const char *tag, int level, unsigned long flags; spin_lock_irqsave(&adapter->san_dbf_lock, flags); - memset(rec, 0, sizeof(struct zfcp_san_dbf_record)); + memset(rec, 0, sizeof(*rec)); strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE); rec->fsf_reqid = (unsigned long)fsf_req; rec->fsf_seqno = fsf_req->seq_no; rec->s_id = s_id; rec->d_id = d_id; - rec->type.els.ls_code = ls_code; + rec->u.els.ls_code = ls_code; debug_event(adapter->san_dbf, level, rec, sizeof(*rec)); zfcp_dbf_hexdump(adapter->san_dbf, rec, sizeof(*rec), level, buffer, min(buflen, ZFCP_DBF_ELS_MAX_PAYLOAD)); @@ -967,42 +951,33 @@ zfcp_san_dbf_view_format(debug_info_t * id, struct debug_view *view, zfcp_dbf_out(&p, "d_id", "0x%06x", r->d_id); if (strncmp(r->tag, "octc", ZFCP_DBF_TAG_SIZE) == 0) { - /* FIXME: struct zfcp_dbf_ct_req *ct = ...; */ - zfcp_dbf_out(&p, "cmd_req_code", "0x%04x", - r->type.ct.type.request.cmd_req_code); - zfcp_dbf_out(&p, "revision", "0x%02x", - r->type.ct.type.request.revision); - zfcp_dbf_out(&p, "gs_type", "0x%02x", - r->type.ct.type.request.gs_type); - zfcp_dbf_out(&p, "gs_subtype", "0x%02x", - r->type.ct.type.request.gs_subtype); - zfcp_dbf_out(&p, "options", "0x%02x", - r->type.ct.type.request.options); - zfcp_dbf_out(&p, "max_res_size", "0x%04x", - r->type.ct.type.request.max_res_size); - total = r->type.ct.payload_size; - buffer = r->type.ct.payload; + struct zfcp_san_dbf_record_ct_request *ct = &r->u.ct_req; + zfcp_dbf_out(&p, "cmd_req_code", "0x%04x", ct->cmd_req_code); + zfcp_dbf_out(&p, "revision", "0x%02x", ct->revision); + zfcp_dbf_out(&p, "gs_type", "0x%02x", ct->gs_type); + zfcp_dbf_out(&p, "gs_subtype", "0x%02x", ct->gs_subtype); + zfcp_dbf_out(&p, "options", "0x%02x", ct->options); + zfcp_dbf_out(&p, "max_res_size", "0x%04x", ct->max_res_size); + total = ct->len; + buffer = ct->payload; buflen = min(total, ZFCP_DBF_CT_PAYLOAD); } else if (strncmp(r->tag, "rctc", ZFCP_DBF_TAG_SIZE) == 0) { - zfcp_dbf_out(&p, "cmd_rsp_code", "0x%04x", - r->type.ct.type.response.cmd_rsp_code); - zfcp_dbf_out(&p, "revision", "0x%02x", - r->type.ct.type.response.revision); - zfcp_dbf_out(&p, "reason_code", "0x%02x", - r->type.ct.type.response.reason_code); - zfcp_dbf_out(&p, "reason_code_expl", "0x%02x", - r->type.ct.type.response.reason_code_expl); - zfcp_dbf_out(&p, "vendor_unique", "0x%02x", - r->type.ct.type.response.vendor_unique); - total = r->type.ct.payload_size; - buffer = r->type.ct.payload; + struct zfcp_san_dbf_record_ct_response *ct = &r->u.ct_resp; + zfcp_dbf_out(&p, "cmd_rsp_code", "0x%04x", ct->cmd_rsp_code); + zfcp_dbf_out(&p, "revision", "0x%02x", ct->revision); + zfcp_dbf_out(&p, "reason_code", "0x%02x", ct->reason_code); + zfcp_dbf_out(&p, "reason_code_expl", "0x%02x", ct->expl); + zfcp_dbf_out(&p, "vendor_unique", "0x%02x", ct->vendor_unique); + total = ct->len; + buffer = ct->payload; buflen = min(total, ZFCP_DBF_CT_PAYLOAD); } else if (strncmp(r->tag, "oels", ZFCP_DBF_TAG_SIZE) == 0 || strncmp(r->tag, "rels", ZFCP_DBF_TAG_SIZE) == 0 || strncmp(r->tag, "iels", ZFCP_DBF_TAG_SIZE) == 0) { - zfcp_dbf_out(&p, "ls_code", "0x%02x", r->type.els.ls_code); - total = r->type.els.payload_size; - buffer = r->type.els.payload; + struct zfcp_san_dbf_record_els *els = &r->u.els; + zfcp_dbf_out(&p, "ls_code", "0x%02x", els->ls_code); + total = els->len; + buffer = els->payload; buflen = min(total, ZFCP_DBF_ELS_PAYLOAD); } @@ -1038,7 +1013,7 @@ _zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level, spin_lock_irqsave(&adapter->scsi_dbf_lock, flags); do { - memset(rec, 0, sizeof(struct zfcp_scsi_dbf_record)); + memset(rec, 0, sizeof(*rec)); if (offset == 0) { strncpy(rec->tag, tag, ZFCP_DBF_TAG_SIZE); strncpy(rec->tag2, tag2, ZFCP_DBF_TAG_SIZE); @@ -1064,20 +1039,16 @@ _zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level, fcp_sns_info = zfcp_get_fcp_sns_info_ptr(fcp_rsp); - rec->type.fcp.rsp_validity = - fcp_rsp->validity.value; - rec->type.fcp.rsp_scsi_status = - fcp_rsp->scsi_status; - rec->type.fcp.rsp_resid = fcp_rsp->fcp_resid; + rec->rsp_validity = fcp_rsp->validity.value; + rec->rsp_scsi_status = fcp_rsp->scsi_status; + rec->rsp_resid = fcp_rsp->fcp_resid; if (fcp_rsp->validity.bits.fcp_rsp_len_valid) - rec->type.fcp.rsp_code = - *(fcp_rsp_info + 3); + rec->rsp_code = *(fcp_rsp_info + 3); if (fcp_rsp->validity.bits.fcp_sns_len_valid) { buflen = min((int)fcp_rsp->fcp_sns_len, ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO); - rec->type.fcp.sns_info_len = buflen; - memcpy(rec->type.fcp.sns_info, - fcp_sns_info, + rec->sns_info_len = buflen; + memcpy(rec->sns_info, fcp_sns_info, min(buflen, ZFCP_DBF_SCSI_FCP_SNS_INFO)); offset += min(buflen, @@ -1088,7 +1059,7 @@ _zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level, rec->fsf_seqno = fsf_req->seq_no; rec->fsf_issued = fsf_req->issued; } - rec->type.old_fsf_reqid = old_req_id; + rec->old_fsf_reqid = old_req_id; } else { strncpy(dump->tag, "dump", ZFCP_DBF_TAG_SIZE); dump->total_size = buflen; @@ -1100,8 +1071,7 @@ _zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level, memcpy(dump->data, fcp_sns_info + offset, dump->size); offset += dump->size; } - debug_event(adapter->scsi_dbf, level, - rec, sizeof(struct zfcp_scsi_dbf_record)); + debug_event(adapter->scsi_dbf, level, rec, sizeof(*rec)); } while (offset < buflen); spin_unlock_irqrestore(&adapter->scsi_dbf_lock, flags); } @@ -1159,28 +1129,23 @@ zfcp_scsi_dbf_view_format(debug_info_t * id, struct debug_view *view, zfcp_dbf_out(&p, "scsi_retries", "0x%02x", r->scsi_retries); zfcp_dbf_out(&p, "scsi_allowed", "0x%02x", r->scsi_allowed); if (strncmp(r->tag, "abrt", ZFCP_DBF_TAG_SIZE) == 0) - zfcp_dbf_out(&p, "old_fsf_reqid", "0x%0Lx", - r->type.old_fsf_reqid); + zfcp_dbf_out(&p, "old_fsf_reqid", "0x%0Lx", r->old_fsf_reqid); zfcp_dbf_out(&p, "fsf_reqid", "0x%0Lx", r->fsf_reqid); zfcp_dbf_out(&p, "fsf_seqno", "0x%08x", r->fsf_seqno); zfcp_dbf_timestamp(r->fsf_issued, &t); zfcp_dbf_out(&p, "fsf_issued", "%011lu:%06lu", t.tv_sec, t.tv_nsec); if (strncmp(r->tag, "rslt", ZFCP_DBF_TAG_SIZE) == 0) { - zfcp_dbf_out(&p, "fcp_rsp_validity", "0x%02x", - r->type.fcp.rsp_validity); - zfcp_dbf_out(&p, "fcp_rsp_scsi_status", - "0x%02x", r->type.fcp.rsp_scsi_status); - zfcp_dbf_out(&p, "fcp_rsp_resid", "0x%08x", - r->type.fcp.rsp_resid); - zfcp_dbf_out(&p, "fcp_rsp_code", "0x%08x", - r->type.fcp.rsp_code); - zfcp_dbf_out(&p, "fcp_sns_info_len", "0x%08x", - r->type.fcp.sns_info_len); - zfcp_dbf_outd(&p, "fcp_sns_info", r->type.fcp.sns_info, - min((int)r->type.fcp.sns_info_len, + zfcp_dbf_out(&p, "fcp_rsp_validity", "0x%02x", r->rsp_validity); + zfcp_dbf_out(&p, "fcp_rsp_scsi_status", "0x%02x", + r->rsp_scsi_status); + zfcp_dbf_out(&p, "fcp_rsp_resid", "0x%08x", r->rsp_resid); + zfcp_dbf_out(&p, "fcp_rsp_code", "0x%08x", r->rsp_code); + zfcp_dbf_out(&p, "fcp_sns_info_len", "0x%08x", r->sns_info_len); + zfcp_dbf_outd(&p, "fcp_sns_info", r->sns_info, + min((int)r->sns_info_len, ZFCP_DBF_SCSI_FCP_SNS_INFO), 0, - r->type.fcp.sns_info_len); + r->sns_info_len); } p += sprintf(p, "\n"); return p - out_buf; diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h index 5d88c01d598..732a5ba1bea 100644 --- a/drivers/s390/scsi/zfcp_dbf.h +++ b/drivers/s390/scsi/zfcp_dbf.h @@ -104,9 +104,9 @@ struct zfcp_hba_dbf_record_response { u64 erp_action; union { struct { - u64 scsi_cmnd; - u64 scsi_serial; - } send_fcp; + u64 cmnd; + u64 serial; + } fcp; struct { u64 wwpn; u32 d_id; @@ -121,8 +121,8 @@ struct zfcp_hba_dbf_record_response { struct { u32 d_id; u8 ls_code; - } send_els; - } data; + } els; + } u; } __attribute__ ((packed)); struct zfcp_hba_dbf_record_status { @@ -154,35 +154,34 @@ struct zfcp_hba_dbf_record { struct zfcp_hba_dbf_record_response response; struct zfcp_hba_dbf_record_status status; struct zfcp_hba_dbf_record_qdio qdio; - } type; + } u; } __attribute__ ((packed)); -struct zfcp_san_dbf_record_ct { - union { - struct { - u16 cmd_req_code; - u8 revision; - u8 gs_type; - u8 gs_subtype; - u8 options; - u16 max_res_size; - } request; - struct { - u16 cmd_rsp_code; - u8 revision; - u8 reason_code; - u8 reason_code_expl; - u8 vendor_unique; - } response; - } type; - u32 payload_size; +struct zfcp_san_dbf_record_ct_request { + u16 cmd_req_code; + u8 revision; + u8 gs_type; + u8 gs_subtype; + u8 options; + u16 max_res_size; + u32 len; #define ZFCP_DBF_CT_PAYLOAD 24 u8 payload[ZFCP_DBF_CT_PAYLOAD]; } __attribute__ ((packed)); +struct zfcp_san_dbf_record_ct_response { + u16 cmd_rsp_code; + u8 revision; + u8 reason_code; + u8 expl; + u8 vendor_unique; + u32 len; + u8 payload[ZFCP_DBF_CT_PAYLOAD]; +} __attribute__ ((packed)); + struct zfcp_san_dbf_record_els { u8 ls_code; - u32 payload_size; + u32 len; #define ZFCP_DBF_ELS_PAYLOAD 32 #define ZFCP_DBF_ELS_MAX_PAYLOAD 1024 u8 payload[ZFCP_DBF_ELS_PAYLOAD]; @@ -195,9 +194,10 @@ struct zfcp_san_dbf_record { u32 s_id; u32 d_id; union { - struct zfcp_san_dbf_record_ct ct; + struct zfcp_san_dbf_record_ct_request ct_req; + struct zfcp_san_dbf_record_ct_response ct_resp; struct zfcp_san_dbf_record_els els; - } type; + } u; } __attribute__ ((packed)); struct zfcp_scsi_dbf_record { @@ -215,19 +215,15 @@ struct zfcp_scsi_dbf_record { u64 fsf_reqid; u32 fsf_seqno; u64 fsf_issued; - union { - u64 old_fsf_reqid; - struct { - u8 rsp_validity; - u8 rsp_scsi_status; - u32 rsp_resid; - u8 rsp_code; + u64 old_fsf_reqid; + u8 rsp_validity; + u8 rsp_scsi_status; + u32 rsp_resid; + u8 rsp_code; #define ZFCP_DBF_SCSI_FCP_SNS_INFO 16 #define ZFCP_DBF_SCSI_MAX_FCP_SNS_INFO 256 - u32 sns_info_len; - u8 sns_info[ZFCP_DBF_SCSI_FCP_SNS_INFO]; - } fcp; - } type; + u32 sns_info_len; + u8 sns_info[ZFCP_DBF_SCSI_FCP_SNS_INFO]; } __attribute__ ((packed)); #endif /* ZFCP_DBF_H */ -- cgit v1.2.3 From 92c7a83fc1fe7b9c3b26831cf84aedd3962d13ee Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Mon, 31 Mar 2008 11:15:30 +0200 Subject: [SCSI] zfcp: Cleanup line breaks in debug trace. Remove line breaks that do not conform to coding style. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.c | 123 +++++++++++++++++++------------------------ 1 file changed, 55 insertions(+), 68 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index a39a3e33a5b..7e85e87b0ed 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -110,9 +110,8 @@ static void zfcp_dbf_outd(char **p, const char *label, char *buffer, *p += sprintf(*p, "\n"); } -static int -zfcp_dbf_view_header(debug_info_t * id, struct debug_view *view, int area, - debug_entry_t * entry, char *out_buf) +static int zfcp_dbf_view_header(debug_info_t *id, struct debug_view *view, + int area, debug_entry_t *entry, char *out_buf) { struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)DEBUG_DATA(entry); struct timespec t; @@ -137,7 +136,7 @@ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req) struct zfcp_adapter *adapter = fsf_req->adapter; struct fsf_qtcb *qtcb = fsf_req->qtcb; union fsf_prot_status_qual *prot_status_qual = - &qtcb->prefix.prot_status_qual; + &qtcb->prefix.prot_status_qual; union fsf_status_qual *fsf_status_qual = &qtcb->header.fsf_status_qual; struct scsi_cmnd *scsi_cmnd; struct zfcp_port *port; @@ -248,9 +247,8 @@ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req) spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags); } -void -zfcp_hba_dbf_event_fsf_unsol(const char *tag, struct zfcp_adapter *adapter, - struct fsf_status_read_buffer *status_buffer) +void zfcp_hba_dbf_event_fsf_unsol(const char *tag, struct zfcp_adapter *adapter, + struct fsf_status_read_buffer *status_buffer) { struct zfcp_hba_dbf_record *rec = &adapter->hba_dbf_buf; unsigned long flags; @@ -301,10 +299,9 @@ zfcp_hba_dbf_event_fsf_unsol(const char *tag, struct zfcp_adapter *adapter, spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags); } -void -zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter, unsigned int status, - unsigned int qdio_error, unsigned int siga_error, - int sbal_index, int sbal_count) +void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter, unsigned int status, + unsigned int qdio_error, unsigned int siga_error, + int sbal_index, int sbal_count) { struct zfcp_hba_dbf_record *r = &adapter->hba_dbf_buf; unsigned long flags; @@ -872,10 +869,10 @@ void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req) spin_unlock_irqrestore(&adapter->san_dbf_lock, flags); } -static void -_zfcp_san_dbf_event_common_els(const char *tag, int level, - struct zfcp_fsf_req *fsf_req, u32 s_id, - u32 d_id, u8 ls_code, void *buffer, int buflen) +static void zfcp_san_dbf_event_els(const char *tag, int level, + struct zfcp_fsf_req *fsf_req, u32 s_id, + u32 d_id, u8 ls_code, void *buffer, + int buflen) { struct zfcp_adapter *adapter = fsf_req->adapter; struct zfcp_san_dbf_record *rec = &adapter->san_dbf_buf; @@ -899,42 +896,39 @@ void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *fsf_req) { struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data; - _zfcp_san_dbf_event_common_els("oels", 2, fsf_req, - fc_host_port_id(els->adapter->scsi_host), - els->d_id, - *(u8 *) zfcp_sg_to_address(els->req), - zfcp_sg_to_address(els->req), - els->req->length); + zfcp_san_dbf_event_els("oels", 2, fsf_req, + fc_host_port_id(els->adapter->scsi_host), + els->d_id, *(u8 *) zfcp_sg_to_address(els->req), + zfcp_sg_to_address(els->req), els->req->length); } void zfcp_san_dbf_event_els_response(struct zfcp_fsf_req *fsf_req) { struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data; - _zfcp_san_dbf_event_common_els("rels", 2, fsf_req, els->d_id, - fc_host_port_id(els->adapter->scsi_host), - *(u8 *) zfcp_sg_to_address(els->req), - zfcp_sg_to_address(els->resp), - els->resp->length); + zfcp_san_dbf_event_els("rels", 2, fsf_req, els->d_id, + fc_host_port_id(els->adapter->scsi_host), + *(u8 *)zfcp_sg_to_address(els->req), + zfcp_sg_to_address(els->resp), + els->resp->length); } void zfcp_san_dbf_event_incoming_els(struct zfcp_fsf_req *fsf_req) { struct zfcp_adapter *adapter = fsf_req->adapter; - struct fsf_status_read_buffer *status_buffer = - (struct fsf_status_read_buffer *)fsf_req->data; - int length = (int)status_buffer->length - - (int)((void *)&status_buffer->payload - (void *)status_buffer); - - _zfcp_san_dbf_event_common_els("iels", 1, fsf_req, status_buffer->d_id, - fc_host_port_id(adapter->scsi_host), - *(u8 *) status_buffer->payload, - (void *)status_buffer->payload, length); + struct fsf_status_read_buffer *buf = + (struct fsf_status_read_buffer *)fsf_req->data; + int length = (int)buf->length - + (int)((void *)&buf->payload - (void *)buf); + + zfcp_san_dbf_event_els("iels", 1, fsf_req, buf->d_id, + fc_host_port_id(adapter->scsi_host), + *(u8 *)buf->payload, (void *)buf->payload, + length); } -static int -zfcp_san_dbf_view_format(debug_info_t * id, struct debug_view *view, - char *out_buf, const char *in_buf) +static int zfcp_san_dbf_view_format(debug_info_t *id, struct debug_view *view, + char *out_buf, const char *in_buf) { struct zfcp_san_dbf_record *r = (struct zfcp_san_dbf_record *)in_buf; char *buffer = NULL; @@ -997,12 +991,11 @@ static struct debug_view zfcp_san_dbf_view = { NULL }; -static void -_zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level, - struct zfcp_adapter *adapter, - struct scsi_cmnd *scsi_cmnd, - struct zfcp_fsf_req *fsf_req, - unsigned long old_req_id) +static void zfcp_scsi_dbf_event(const char *tag, const char *tag2, int level, + struct zfcp_adapter *adapter, + struct scsi_cmnd *scsi_cmnd, + struct zfcp_fsf_req *fsf_req, + unsigned long old_req_id) { struct zfcp_scsi_dbf_record *rec = &adapter->scsi_dbf_buf; struct zfcp_dbf_dump *dump = (struct zfcp_dbf_dump *)rec; @@ -1076,39 +1069,33 @@ _zfcp_scsi_dbf_event_common(const char *tag, const char *tag2, int level, spin_unlock_irqrestore(&adapter->scsi_dbf_lock, flags); } -void -zfcp_scsi_dbf_event_result(const char *tag, int level, - struct zfcp_adapter *adapter, - struct scsi_cmnd *scsi_cmnd, - struct zfcp_fsf_req *fsf_req) +void zfcp_scsi_dbf_event_result(const char *tag, int level, + struct zfcp_adapter *adapter, + struct scsi_cmnd *scsi_cmnd, + struct zfcp_fsf_req *fsf_req) { - _zfcp_scsi_dbf_event_common("rslt", tag, level, - adapter, scsi_cmnd, fsf_req, 0); + zfcp_scsi_dbf_event("rslt", tag, level, adapter, scsi_cmnd, fsf_req, 0); } -void -zfcp_scsi_dbf_event_abort(const char *tag, struct zfcp_adapter *adapter, - struct scsi_cmnd *scsi_cmnd, - struct zfcp_fsf_req *new_fsf_req, - unsigned long old_req_id) +void zfcp_scsi_dbf_event_abort(const char *tag, struct zfcp_adapter *adapter, + struct scsi_cmnd *scsi_cmnd, + struct zfcp_fsf_req *new_fsf_req, + unsigned long old_req_id) { - _zfcp_scsi_dbf_event_common("abrt", tag, 1, - adapter, scsi_cmnd, new_fsf_req, old_req_id); + zfcp_scsi_dbf_event("abrt", tag, 1, adapter, scsi_cmnd, new_fsf_req, + old_req_id); } -void -zfcp_scsi_dbf_event_devreset(const char *tag, u8 flag, struct zfcp_unit *unit, - struct scsi_cmnd *scsi_cmnd) +void zfcp_scsi_dbf_event_devreset(const char *tag, u8 flag, + struct zfcp_unit *unit, + struct scsi_cmnd *scsi_cmnd) { - struct zfcp_adapter *adapter = unit->port->adapter; - - _zfcp_scsi_dbf_event_common(flag == FCP_TARGET_RESET ? "trst" : "lrst", - tag, 1, adapter, scsi_cmnd, NULL, 0); + zfcp_scsi_dbf_event(flag == FCP_TARGET_RESET ? "trst" : "lrst", tag, 1, + unit->port->adapter, scsi_cmnd, NULL, 0); } -static int -zfcp_scsi_dbf_view_format(debug_info_t * id, struct debug_view *view, - char *out_buf, const char *in_buf) +static int zfcp_scsi_dbf_view_format(debug_info_t *id, struct debug_view *view, + char *out_buf, const char *in_buf) { struct zfcp_scsi_dbf_record *r = (struct zfcp_scsi_dbf_record *)in_buf; struct timespec t; -- cgit v1.2.3 From bfab1637b5d0c9683016917fa8e082ba6ce8d5a6 Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Mon, 31 Mar 2008 11:15:31 +0200 Subject: [SCSI] zfcp: Add docbook comments to debug trace. Add missing docbook-comments for functions forming zfcp's internal trace API. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.c | 62 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 7e85e87b0ed..85ba4cc4190 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -131,6 +131,10 @@ static int zfcp_dbf_view_header(debug_info_t *id, struct debug_view *view, return p - out_buf; } +/** + * zfcp_hba_dbf_event_fsf_response - trace event for request completion + * @fsf_req: request that has been completed + */ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req) { struct zfcp_adapter *adapter = fsf_req->adapter; @@ -247,6 +251,12 @@ void zfcp_hba_dbf_event_fsf_response(struct zfcp_fsf_req *fsf_req) spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags); } +/** + * zfcp_hba_dbf_event_fsf_unsol - trace event for an unsolicited status buffer + * @tag: tag indicating which kind of unsolicited status has been received + * @adapter: adapter that has issued the unsolicited status buffer + * @status_buffer: buffer containing payload of unsolicited status + */ void zfcp_hba_dbf_event_fsf_unsol(const char *tag, struct zfcp_adapter *adapter, struct fsf_status_read_buffer *status_buffer) { @@ -299,6 +309,15 @@ void zfcp_hba_dbf_event_fsf_unsol(const char *tag, struct zfcp_adapter *adapter, spin_unlock_irqrestore(&adapter->hba_dbf_lock, flags); } +/** + * zfcp_hba_dbf_event_qdio - trace event for QDIO related failure + * @adapter: adapter affected by this QDIO related event + * @status: as passed by qdio module + * @qdio_error: as passed by qdio module + * @siga_error: as passed by qdio module + * @sbal_index: first buffer with error condition, as passed by qdio module + * @sbal_count: number of buffers affected, as passed by qdio module + */ void zfcp_hba_dbf_event_qdio(struct zfcp_adapter *adapter, unsigned int status, unsigned int qdio_error, unsigned int siga_error, int sbal_index, int sbal_count) @@ -810,6 +829,10 @@ void zfcp_rec_dbf_event_action(u8 id2, struct zfcp_erp_action *erp_action) spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); } +/** + * zfcp_san_dbf_event_ct_request - trace event for issued CT request + * @fsf_req: request containing issued CT data + */ void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req) { struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; @@ -840,6 +863,10 @@ void zfcp_san_dbf_event_ct_request(struct zfcp_fsf_req *fsf_req) spin_unlock_irqrestore(&adapter->san_dbf_lock, flags); } +/** + * zfcp_san_dbf_event_ct_response - trace event for completion of CT request + * @fsf_req: request containing CT response + */ void zfcp_san_dbf_event_ct_response(struct zfcp_fsf_req *fsf_req) { struct zfcp_send_ct *ct = (struct zfcp_send_ct *)fsf_req->data; @@ -892,6 +919,10 @@ static void zfcp_san_dbf_event_els(const char *tag, int level, spin_unlock_irqrestore(&adapter->san_dbf_lock, flags); } +/** + * zfcp_san_dbf_event_els_request - trace event for issued ELS + * @fsf_req: request containing issued ELS + */ void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *fsf_req) { struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data; @@ -902,6 +933,10 @@ void zfcp_san_dbf_event_els_request(struct zfcp_fsf_req *fsf_req) zfcp_sg_to_address(els->req), els->req->length); } +/** + * zfcp_san_dbf_event_els_response - trace event for completed ELS + * @fsf_req: request containing ELS response + */ void zfcp_san_dbf_event_els_response(struct zfcp_fsf_req *fsf_req) { struct zfcp_send_els *els = (struct zfcp_send_els *)fsf_req->data; @@ -913,6 +948,10 @@ void zfcp_san_dbf_event_els_response(struct zfcp_fsf_req *fsf_req) els->resp->length); } +/** + * zfcp_san_dbf_event_incoming_els - trace event for incomig ELS + * @fsf_req: request containing unsolicited status buffer with incoming ELS + */ void zfcp_san_dbf_event_incoming_els(struct zfcp_fsf_req *fsf_req) { struct zfcp_adapter *adapter = fsf_req->adapter; @@ -1069,6 +1108,14 @@ static void zfcp_scsi_dbf_event(const char *tag, const char *tag2, int level, spin_unlock_irqrestore(&adapter->scsi_dbf_lock, flags); } +/** + * zfcp_scsi_dbf_event_result - trace event for SCSI command completion + * @tag: tag indicating success or failure of SCSI command + * @level: trace level applicable for this event + * @adapter: adapter that has been used to issue the SCSI command + * @scsi_cmnd: SCSI command pointer + * @fsf_req: request used to issue SCSI command (might be NULL) + */ void zfcp_scsi_dbf_event_result(const char *tag, int level, struct zfcp_adapter *adapter, struct scsi_cmnd *scsi_cmnd, @@ -1077,6 +1124,14 @@ void zfcp_scsi_dbf_event_result(const char *tag, int level, zfcp_scsi_dbf_event("rslt", tag, level, adapter, scsi_cmnd, fsf_req, 0); } +/** + * zfcp_scsi_dbf_event_abort - trace event for SCSI command abort + * @tag: tag indicating success or failure of abort operation + * @adapter: adapter thas has been used to issue SCSI command to be aborted + * @scsi_cmnd: SCSI command to be aborted + * @new_fsf_req: request containing abort (might be NULL) + * @old_req_id: identifier of request containg SCSI command to be aborted + */ void zfcp_scsi_dbf_event_abort(const char *tag, struct zfcp_adapter *adapter, struct scsi_cmnd *scsi_cmnd, struct zfcp_fsf_req *new_fsf_req, @@ -1086,6 +1141,13 @@ void zfcp_scsi_dbf_event_abort(const char *tag, struct zfcp_adapter *adapter, old_req_id); } +/** + * zfcp_scsi_dbf_event_devreset - trace event for Logical Unit or Target Reset + * @tag: tag indicating success or failure of reset operation + * @flag: indicates type of reset (Target Reset, Logical Unit Reset) + * @unit: unit that needs reset + * @scsi_cmnd: SCSI command which caused this error recovery + */ void zfcp_scsi_dbf_event_devreset(const char *tag, u8 flag, struct zfcp_unit *unit, struct scsi_cmnd *scsi_cmnd) -- cgit v1.2.3 From ee95a16d3950367d32beb6ffed287666631dbda9 Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Thu, 17 Apr 2008 00:08:03 +0200 Subject: [SCSI] zfcp: fix compiler warning caused by poking inside new semaphore (linux-next) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit as seen in linux-next tree: drivers/s390/scsi/zfcp_dbf.c: In function ‘zfcp_rec_dbf_event_thread’: drivers/s390/scsi/zfcp_dbf.c:697: warning: passing argument 1 of ‘atomic_read’ from incompatible pointer type Caused by recent git commit: commit 348447e85749120ad600a5c8e23b6bb7058b931d Author: Martin Peschke Date: Thu Mar 27 14:22:01 2008 +0100 [SCSI] zfcp: Add trace records for recovery thread and its queues We are not supposed to poke inside semaphore. Signed-off-by: Martin Peschke Acked-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_dbf.c | 2 -- drivers/s390/scsi/zfcp_dbf.h | 1 - 2 files changed, 3 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index 85ba4cc4190..c34a874482a 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -623,7 +623,6 @@ static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, zfcp_dbf_out(&p, "id", "%d", r->id2); switch (r->id) { case ZFCP_REC_DBF_ID_THREAD: - zfcp_dbf_out(&p, "sema", "%d", r->u.thread.sema); zfcp_dbf_out(&p, "total", "%d", r->u.thread.total); zfcp_dbf_out(&p, "ready", "%d", r->u.thread.ready); zfcp_dbf_out(&p, "running", "%d", r->u.thread.running); @@ -694,7 +693,6 @@ void zfcp_rec_dbf_event_thread(u8 id2, struct zfcp_adapter *adapter, int lock) memset(r, 0, sizeof(*r)); r->id = ZFCP_REC_DBF_ID_THREAD; r->id2 = id2; - r->u.thread.sema = atomic_read(&adapter->erp_ready_sem.count); r->u.thread.total = total; r->u.thread.ready = ready; r->u.thread.running = running; diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h index 732a5ba1bea..54c34e48345 100644 --- a/drivers/s390/scsi/zfcp_dbf.h +++ b/drivers/s390/scsi/zfcp_dbf.h @@ -35,7 +35,6 @@ struct zfcp_dbf_dump { } __attribute__ ((packed)); struct zfcp_rec_dbf_record_thread { - u32 sema; u32 total; u32 ready; u32 running; -- cgit v1.2.3 From 1f6f7129ebac007629b28764bfa5147817682692 Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Fri, 18 Apr 2008 12:51:55 +0200 Subject: [SCSI] zfcp: fix 31 bit compile warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit drivers/s390/scsi/zfcp_aux.c: In function ‘zfcp_fsf_incoming_els_rscn’: drivers/s390/scsi/zfcp_aux.c:1379: warning: cast from pointer to integer of different size drivers/s390/scsi/zfcp_aux.c: In function ‘zfcp_fsf_incoming_els_plogi’: drivers/s390/scsi/zfcp_aux.c:1432: warning: cast from pointer to integer of different size drivers/s390/scsi/zfcp_aux.c: In function ‘zfcp_fsf_incoming_els_logo’: drivers/s390/scsi/zfcp_aux.c:1457: warning: cast from pointer to integer of different size .. Just passing pointers rids us of these warnings and improves readability. Signed-off-by: Martin Peschke Signed-off-by: Christof Schmitt Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_aux.c | 6 +- drivers/s390/scsi/zfcp_ccw.c | 19 +++-- drivers/s390/scsi/zfcp_dbf.c | 22 ++--- drivers/s390/scsi/zfcp_erp.c | 140 ++++++++++++++++--------------- drivers/s390/scsi/zfcp_ext.h | 60 ++++++------- drivers/s390/scsi/zfcp_fsf.c | 149 +++++++++++++++------------------ drivers/s390/scsi/zfcp_qdio.c | 3 +- drivers/s390/scsi/zfcp_scsi.c | 4 +- drivers/s390/scsi/zfcp_sysfs_adapter.c | 9 +- drivers/s390/scsi/zfcp_sysfs_port.c | 8 +- drivers/s390/scsi/zfcp_sysfs_unit.c | 4 +- 11 files changed, 211 insertions(+), 213 deletions(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 05a33c247c6..8c7e2b778ef 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -1376,7 +1376,7 @@ static void zfcp_fsf_incoming_els_rscn(struct zfcp_fsf_req *fsf_req) "port 0x%016Lx\n", port->wwpn); zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, - 82, (u64)fsf_req); + 82, fsf_req); continue; } @@ -1429,7 +1429,7 @@ static void zfcp_fsf_incoming_els_plogi(struct zfcp_fsf_req *fsf_req) status_buffer->d_id, zfcp_get_busid_by_adapter(adapter)); } else { - zfcp_erp_port_forced_reopen(port, 0, 83, (u64)fsf_req); + zfcp_erp_port_forced_reopen(port, 0, 83, fsf_req); } } @@ -1454,7 +1454,7 @@ static void zfcp_fsf_incoming_els_logo(struct zfcp_fsf_req *fsf_req) status_buffer->d_id, zfcp_get_busid_by_adapter(adapter)); } else { - zfcp_erp_port_forced_reopen(port, 0, 84, (u64)fsf_req); + zfcp_erp_port_forced_reopen(port, 0, 84, fsf_req); } } diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index db9f538362a..66d3b88844b 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c @@ -170,9 +170,10 @@ zfcp_ccw_set_online(struct ccw_device *ccw_device) BUG_ON(!zfcp_reqlist_isempty(adapter)); adapter->req_no = 0; - zfcp_erp_modify_adapter_status(adapter, 10, 0, + zfcp_erp_modify_adapter_status(adapter, 10, NULL, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); - zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 85, 0); + zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 85, + NULL); zfcp_erp_wait(adapter); goto out; @@ -197,7 +198,7 @@ zfcp_ccw_set_offline(struct ccw_device *ccw_device) down(&zfcp_data.config_sema); adapter = dev_get_drvdata(&ccw_device->dev); - zfcp_erp_adapter_shutdown(adapter, 0, 86, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 86, NULL); zfcp_erp_wait(adapter); zfcp_erp_thread_kill(adapter); up(&zfcp_data.config_sema); @@ -223,21 +224,21 @@ zfcp_ccw_notify(struct ccw_device *ccw_device, int event) case CIO_GONE: ZFCP_LOG_NORMAL("adapter %s: device gone\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_shutdown(adapter, 0, 87, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 87, NULL); break; case CIO_NO_PATH: ZFCP_LOG_NORMAL("adapter %s: no path\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_shutdown(adapter, 0, 88, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 88, NULL); break; case CIO_OPER: ZFCP_LOG_NORMAL("adapter %s: operational again\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_modify_adapter_status(adapter, 11, 0, + zfcp_erp_modify_adapter_status(adapter, 11, NULL, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); - zfcp_erp_adapter_reopen(adapter, - ZFCP_STATUS_COMMON_ERP_FAILED, 89, 0); + zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, + 89, NULL); break; } zfcp_erp_wait(adapter); @@ -269,7 +270,7 @@ zfcp_ccw_shutdown(struct ccw_device *cdev) down(&zfcp_data.config_sema); adapter = dev_get_drvdata(&cdev->dev); - zfcp_erp_adapter_shutdown(adapter, 0, 90, 0); + zfcp_erp_adapter_shutdown(adapter, 0, 90, NULL); zfcp_erp_wait(adapter); up(&zfcp_data.config_sema); } diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index c34a874482a..37b85c67b11 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -700,7 +700,7 @@ void zfcp_rec_dbf_event_thread(u8 id2, struct zfcp_adapter *adapter, int lock) spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); } -static void zfcp_rec_dbf_event_target(u8 id2, u64 ref, +static void zfcp_rec_dbf_event_target(u8 id2, void *ref, struct zfcp_adapter *adapter, atomic_t *status, atomic_t *erp_count, u64 wwpn, u32 d_id, u64 fcp_lun) @@ -712,7 +712,7 @@ static void zfcp_rec_dbf_event_target(u8 id2, u64 ref, memset(r, 0, sizeof(*r)); r->id = ZFCP_REC_DBF_ID_TARGET; r->id2 = id2; - r->u.target.ref = ref; + r->u.target.ref = (unsigned long)ref; r->u.target.status = atomic_read(status); r->u.target.wwpn = wwpn; r->u.target.d_id = d_id; @@ -728,7 +728,7 @@ static void zfcp_rec_dbf_event_target(u8 id2, u64 ref, * @ref: additional reference (e.g. request) * @adapter: adapter */ -void zfcp_rec_dbf_event_adapter(u8 id, u64 ref, struct zfcp_adapter *adapter) +void zfcp_rec_dbf_event_adapter(u8 id, void *ref, struct zfcp_adapter *adapter) { zfcp_rec_dbf_event_target(id, ref, adapter, &adapter->status, &adapter->erp_counter, 0, 0, 0); @@ -740,7 +740,7 @@ void zfcp_rec_dbf_event_adapter(u8 id, u64 ref, struct zfcp_adapter *adapter) * @ref: additional reference (e.g. request) * @port: port */ -void zfcp_rec_dbf_event_port(u8 id, u64 ref, struct zfcp_port *port) +void zfcp_rec_dbf_event_port(u8 id, void *ref, struct zfcp_port *port) { struct zfcp_adapter *adapter = port->adapter; @@ -755,7 +755,7 @@ void zfcp_rec_dbf_event_port(u8 id, u64 ref, struct zfcp_port *port) * @ref: additional reference (e.g. request) * @unit: unit */ -void zfcp_rec_dbf_event_unit(u8 id, u64 ref, struct zfcp_unit *unit) +void zfcp_rec_dbf_event_unit(u8 id, void *ref, struct zfcp_unit *unit) { struct zfcp_port *port = unit->port; struct zfcp_adapter *adapter = port->adapter; @@ -776,8 +776,8 @@ void zfcp_rec_dbf_event_unit(u8 id, u64 ref, struct zfcp_unit *unit) * @port: port * @unit: unit */ -void zfcp_rec_dbf_event_trigger(u8 id2, u64 ref, u8 want, u8 need, u64 action, - struct zfcp_adapter *adapter, +void zfcp_rec_dbf_event_trigger(u8 id2, void *ref, u8 want, u8 need, + void *action, struct zfcp_adapter *adapter, struct zfcp_port *port, struct zfcp_unit *unit) { struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf; @@ -787,10 +787,10 @@ void zfcp_rec_dbf_event_trigger(u8 id2, u64 ref, u8 want, u8 need, u64 action, memset(r, 0, sizeof(*r)); r->id = ZFCP_REC_DBF_ID_TRIGGER; r->id2 = id2; - r->u.trigger.ref = ref; + r->u.trigger.ref = (unsigned long)ref; r->u.trigger.want = want; r->u.trigger.need = need; - r->u.trigger.action = action; + r->u.trigger.action = (unsigned long)action; r->u.trigger.as = atomic_read(&adapter->status); if (port) { r->u.trigger.ps = atomic_read(&port->status); @@ -819,10 +819,10 @@ void zfcp_rec_dbf_event_action(u8 id2, struct zfcp_erp_action *erp_action) memset(r, 0, sizeof(*r)); r->id = ZFCP_REC_DBF_ID_ACTION; r->id2 = id2; - r->u.action.action = (u64)erp_action; + r->u.action.action = (unsigned long)erp_action; r->u.action.status = erp_action->status; r->u.action.step = erp_action->step; - r->u.action.fsf_req = (u64)erp_action->fsf_req; + r->u.action.fsf_req = (unsigned long)erp_action->fsf_req; debug_event(adapter->rec_dbf, 4, r, sizeof(*r)); spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); } diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index feb1fda33d2..805484658dd 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -27,15 +27,16 @@ static int zfcp_erp_adisc(struct zfcp_port *); static void zfcp_erp_adisc_handler(unsigned long); static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *, int, u8, - u64); + void *); static int zfcp_erp_port_forced_reopen_internal(struct zfcp_port *, int, u8, - u64); -static int zfcp_erp_port_reopen_internal(struct zfcp_port *, int, u8, u64); -static int zfcp_erp_unit_reopen_internal(struct zfcp_unit *, int, u8, u64); + void *); +static int zfcp_erp_port_reopen_internal(struct zfcp_port *, int, u8, void *); +static int zfcp_erp_unit_reopen_internal(struct zfcp_unit *, int, u8, void *); static int zfcp_erp_port_reopen_all_internal(struct zfcp_adapter *, int, u8, - u64); -static int zfcp_erp_unit_reopen_all_internal(struct zfcp_port *, int, u8, u64); + void *); +static int zfcp_erp_unit_reopen_all_internal(struct zfcp_port *, int, u8, + void *); static void zfcp_erp_adapter_block(struct zfcp_adapter *, int); static void zfcp_erp_adapter_unblock(struct zfcp_adapter *); @@ -101,7 +102,7 @@ static void zfcp_erp_action_dismiss(struct zfcp_erp_action *); static int zfcp_erp_action_enqueue(int, struct zfcp_adapter *, struct zfcp_port *, struct zfcp_unit *, - u8 id, u64 ref); + u8 id, void *ref); static int zfcp_erp_action_dequeue(struct zfcp_erp_action *); static void zfcp_erp_action_cleanup(int, struct zfcp_adapter *, struct zfcp_port *, struct zfcp_unit *, @@ -165,7 +166,7 @@ static void zfcp_close_fsf(struct zfcp_adapter *adapter) /* reset FSF request sequence number */ adapter->fsf_req_seq_no = 0; /* all ports and units are closed */ - zfcp_erp_modify_adapter_status(adapter, 24, 0, + zfcp_erp_modify_adapter_status(adapter, 24, NULL, ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); } @@ -181,7 +182,8 @@ static void zfcp_close_fsf(struct zfcp_adapter *adapter) static void zfcp_fsf_request_timeout_handler(unsigned long data) { struct zfcp_adapter *adapter = (struct zfcp_adapter *) data; - zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 62, 0); + zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 62, + NULL); } void zfcp_fsf_start_timer(struct zfcp_fsf_req *fsf_req, unsigned long timeout) @@ -203,7 +205,7 @@ void zfcp_fsf_start_timer(struct zfcp_fsf_req *fsf_req, unsigned long timeout) * <0 - failed to initiate action */ static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter, - int clear_mask, u8 id, u64 ref) + int clear_mask, u8 id, void *ref) { int retval; @@ -216,7 +218,7 @@ static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter, ZFCP_LOG_DEBUG("skipped reopen of failed adapter %s\n", zfcp_get_busid_by_adapter(adapter)); /* ensure propagation of failed status to new devices */ - zfcp_erp_adapter_failed(adapter, 13, 0); + zfcp_erp_adapter_failed(adapter, 13, NULL); retval = -EIO; goto out; } @@ -237,7 +239,7 @@ static int zfcp_erp_adapter_reopen_internal(struct zfcp_adapter *adapter, * <0 - failed to initiate action */ int zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, int clear_mask, - u8 id, u64 ref) + u8 id, void *ref) { int retval; unsigned long flags; @@ -252,7 +254,7 @@ int zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, int clear_mask, } int zfcp_erp_adapter_shutdown(struct zfcp_adapter *adapter, int clear_mask, - u8 id, u64 ref) + u8 id, void *ref) { int retval; @@ -265,7 +267,7 @@ int zfcp_erp_adapter_shutdown(struct zfcp_adapter *adapter, int clear_mask, } int zfcp_erp_port_shutdown(struct zfcp_port *port, int clear_mask, u8 id, - u64 ref) + void *ref) { int retval; @@ -278,7 +280,7 @@ int zfcp_erp_port_shutdown(struct zfcp_port *port, int clear_mask, u8 id, } int zfcp_erp_unit_shutdown(struct zfcp_unit *unit, int clear_mask, u8 id, - u64 ref) + void *ref) { int retval; @@ -399,7 +401,7 @@ zfcp_erp_adisc_handler(unsigned long data) "force physical port reopen " "(adapter %s, port d_id=0x%06x)\n", zfcp_get_busid_by_adapter(adapter), d_id); - if (zfcp_erp_port_forced_reopen(port, 0, 63, 0)) + if (zfcp_erp_port_forced_reopen(port, 0, 63, NULL)) ZFCP_LOG_NORMAL("failed reopen of port " "(adapter %s, wwpn=0x%016Lx)\n", zfcp_get_busid_by_port(port), @@ -426,7 +428,7 @@ zfcp_erp_adisc_handler(unsigned long data) "adisc_resp_wwpn=0x%016Lx)\n", zfcp_get_busid_by_port(port), port->wwpn, (wwn_t) adisc->wwpn); - if (zfcp_erp_port_reopen(port, 0, 64, 0)) + if (zfcp_erp_port_reopen(port, 0, 64, NULL)) ZFCP_LOG_NORMAL("failed reopen of port " "(adapter %s, wwpn=0x%016Lx)\n", zfcp_get_busid_by_port(port), @@ -460,7 +462,7 @@ zfcp_test_link(struct zfcp_port *port) ZFCP_LOG_NORMAL("reopen needed for port 0x%016Lx " "on adapter %s\n ", port->wwpn, zfcp_get_busid_by_port(port)); - retval = zfcp_erp_port_forced_reopen(port, 0, 65, 0); + retval = zfcp_erp_port_forced_reopen(port, 0, 65, NULL); if (retval != 0) { ZFCP_LOG_NORMAL("reopen of remote port 0x%016Lx " "on adapter %s failed\n", port->wwpn, @@ -484,7 +486,8 @@ zfcp_test_link(struct zfcp_port *port) * <0 - failed to initiate action */ static int zfcp_erp_port_forced_reopen_internal(struct zfcp_port *port, - int clear_mask, u8 id, u64 ref) + int clear_mask, u8 id, + void *ref) { int retval; @@ -518,7 +521,7 @@ static int zfcp_erp_port_forced_reopen_internal(struct zfcp_port *port, * <0 - failed to initiate action */ int zfcp_erp_port_forced_reopen(struct zfcp_port *port, int clear_mask, u8 id, - u64 ref) + void *ref) { int retval; unsigned long flags; @@ -546,7 +549,7 @@ int zfcp_erp_port_forced_reopen(struct zfcp_port *port, int clear_mask, u8 id, * <0 - failed to initiate action */ static int zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask, - u8 id, u64 ref) + u8 id, void *ref) { int retval; @@ -560,7 +563,7 @@ static int zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask, "on adapter %s\n", port->wwpn, zfcp_get_busid_by_port(port)); /* ensure propagation of failed status to new devices */ - zfcp_erp_port_failed(port, 14, 0); + zfcp_erp_port_failed(port, 14, NULL); retval = -EIO; goto out; } @@ -582,7 +585,8 @@ static int zfcp_erp_port_reopen_internal(struct zfcp_port *port, int clear_mask, * correct locking. An error recovery task is initiated to do the reopen. * To wait for the completion of the reopen zfcp_erp_wait should be used. */ -int zfcp_erp_port_reopen(struct zfcp_port *port, int clear_mask, u8 id, u64 ref) +int zfcp_erp_port_reopen(struct zfcp_port *port, int clear_mask, u8 id, + void *ref) { int retval; unsigned long flags; @@ -608,7 +612,7 @@ int zfcp_erp_port_reopen(struct zfcp_port *port, int clear_mask, u8 id, u64 ref) * <0 - failed to initiate action */ static int zfcp_erp_unit_reopen_internal(struct zfcp_unit *unit, int clear_mask, - u8 id, u64 ref) + u8 id, void *ref) { int retval; struct zfcp_adapter *adapter = unit->port->adapter; @@ -644,7 +648,8 @@ static int zfcp_erp_unit_reopen_internal(struct zfcp_unit *unit, int clear_mask, * locking. An error recovery task is initiated to do the reopen. * To wait for the completion of the reopen zfcp_erp_wait should be used. */ -int zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear_mask, u8 id, u64 ref) +int zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear_mask, u8 id, + void *ref) { int retval; unsigned long flags; @@ -668,7 +673,7 @@ int zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear_mask, u8 id, u64 ref) */ static void zfcp_erp_adapter_block(struct zfcp_adapter *adapter, int clear_mask) { - zfcp_erp_modify_adapter_status(adapter, 15, 0, + zfcp_erp_modify_adapter_status(adapter, 15, NULL, ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, ZFCP_CLEAR); } @@ -704,7 +709,7 @@ static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter) { if (atomic_test_and_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status)) - zfcp_rec_dbf_event_adapter(16, 0, adapter); + zfcp_rec_dbf_event_adapter(16, NULL, adapter); } /* @@ -719,7 +724,7 @@ static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter) static void zfcp_erp_port_block(struct zfcp_port *port, int clear_mask) { - zfcp_erp_modify_port_status(port, 17, 0, + zfcp_erp_modify_port_status(port, 17, NULL, ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, ZFCP_CLEAR); } @@ -736,7 +741,7 @@ zfcp_erp_port_unblock(struct zfcp_port *port) { if (atomic_test_and_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status)) - zfcp_rec_dbf_event_port(18, 0, port); + zfcp_rec_dbf_event_port(18, NULL, port); } /* @@ -751,7 +756,7 @@ zfcp_erp_port_unblock(struct zfcp_port *port) static void zfcp_erp_unit_block(struct zfcp_unit *unit, int clear_mask) { - zfcp_erp_modify_unit_status(unit, 19, 0, + zfcp_erp_modify_unit_status(unit, 19, NULL, ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, ZFCP_CLEAR); } @@ -768,7 +773,7 @@ zfcp_erp_unit_unblock(struct zfcp_unit *unit) { if (atomic_test_and_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status)) - zfcp_rec_dbf_event_unit(20, 0, unit); + zfcp_rec_dbf_event_unit(20, NULL, unit); } static void @@ -1140,7 +1145,7 @@ zfcp_erp_strategy(struct zfcp_erp_action *erp_action) "restarting I/O on adapter %s " "to free mempool\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_reopen_internal(adapter, 0, 66, 0); + zfcp_erp_adapter_reopen_internal(adapter, 0, 66, NULL); } else { retval = zfcp_erp_strategy_memwait(erp_action); } @@ -1295,7 +1300,7 @@ zfcp_erp_strategy_memwait(struct zfcp_erp_action *erp_action) * */ void -zfcp_erp_adapter_failed(struct zfcp_adapter *adapter, u8 id, u64 ref) +zfcp_erp_adapter_failed(struct zfcp_adapter *adapter, u8 id, void *ref) { zfcp_erp_modify_adapter_status(adapter, id, ref, ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); @@ -1310,7 +1315,7 @@ zfcp_erp_adapter_failed(struct zfcp_adapter *adapter, u8 id, u64 ref) * */ void -zfcp_erp_port_failed(struct zfcp_port *port, u8 id, u64 ref) +zfcp_erp_port_failed(struct zfcp_port *port, u8 id, void *ref) { zfcp_erp_modify_port_status(port, id, ref, ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); @@ -1331,7 +1336,7 @@ zfcp_erp_port_failed(struct zfcp_port *port, u8 id, u64 ref) * */ void -zfcp_erp_unit_failed(struct zfcp_unit *unit, u8 id, u64 ref) +zfcp_erp_unit_failed(struct zfcp_unit *unit, u8 id, void *ref) { zfcp_erp_modify_unit_status(unit, id, ref, ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); @@ -1395,7 +1400,7 @@ zfcp_erp_strategy_statechange(int action, status)) { zfcp_erp_adapter_reopen_internal(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, - 67, 0); + 67, NULL); retval = ZFCP_ERP_EXIT; } break; @@ -1406,7 +1411,7 @@ zfcp_erp_strategy_statechange(int action, status)) { zfcp_erp_port_reopen_internal(port, ZFCP_STATUS_COMMON_ERP_FAILED, - 68, 0); + 68, NULL); retval = ZFCP_ERP_EXIT; } break; @@ -1416,7 +1421,7 @@ zfcp_erp_strategy_statechange(int action, status)) { zfcp_erp_unit_reopen_internal(unit, ZFCP_STATUS_COMMON_ERP_FAILED, - 69, 0); + 69, NULL); retval = ZFCP_ERP_EXIT; } break; @@ -1448,7 +1453,7 @@ zfcp_erp_strategy_check_unit(struct zfcp_unit *unit, int result) case ZFCP_ERP_FAILED : atomic_inc(&unit->erp_counter); if (atomic_read(&unit->erp_counter) > ZFCP_MAX_ERPS) - zfcp_erp_unit_failed(unit, 21, 0); + zfcp_erp_unit_failed(unit, 21, NULL); break; case ZFCP_ERP_EXIT : /* nothing */ @@ -1474,7 +1479,7 @@ zfcp_erp_strategy_check_port(struct zfcp_port *port, int result) case ZFCP_ERP_FAILED : atomic_inc(&port->erp_counter); if (atomic_read(&port->erp_counter) > ZFCP_MAX_ERPS) - zfcp_erp_port_failed(port, 22, 0); + zfcp_erp_port_failed(port, 22, NULL); break; case ZFCP_ERP_EXIT : /* nothing */ @@ -1500,7 +1505,7 @@ zfcp_erp_strategy_check_adapter(struct zfcp_adapter *adapter, int result) case ZFCP_ERP_FAILED : atomic_inc(&adapter->erp_counter); if (atomic_read(&adapter->erp_counter) > ZFCP_MAX_ERPS) - zfcp_erp_adapter_failed(adapter, 23, 0); + zfcp_erp_adapter_failed(adapter, 23, NULL); break; case ZFCP_ERP_EXIT : /* nothing */ @@ -1588,29 +1593,29 @@ zfcp_erp_strategy_followup_actions(int action, case ZFCP_ERP_ACTION_REOPEN_ADAPTER: if (status == ZFCP_ERP_SUCCEEDED) - zfcp_erp_port_reopen_all_internal(adapter, 0, 70, 0); + zfcp_erp_port_reopen_all_internal(adapter, 0, 70, NULL); else - zfcp_erp_adapter_reopen_internal(adapter, 0, 71, 0); + zfcp_erp_adapter_reopen_internal(adapter, 0, 71, NULL); break; case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: if (status == ZFCP_ERP_SUCCEEDED) - zfcp_erp_port_reopen_internal(port, 0, 72, 0); + zfcp_erp_port_reopen_internal(port, 0, 72, NULL); else - zfcp_erp_adapter_reopen_internal(adapter, 0, 73, 0); + zfcp_erp_adapter_reopen_internal(adapter, 0, 73, NULL); break; case ZFCP_ERP_ACTION_REOPEN_PORT: if (status == ZFCP_ERP_SUCCEEDED) - zfcp_erp_unit_reopen_all_internal(port, 0, 74, 0); + zfcp_erp_unit_reopen_all_internal(port, 0, 74, NULL); else - zfcp_erp_port_forced_reopen_internal(port, 0, 75, 0); + zfcp_erp_port_forced_reopen_internal(port, 0, 75, NULL); break; case ZFCP_ERP_ACTION_REOPEN_UNIT: /* Nothing to do if status == ZFCP_ERP_SUCCEEDED */ if (status != ZFCP_ERP_SUCCEEDED) - zfcp_erp_port_reopen_internal(unit->port, 0, 76, 0); + zfcp_erp_port_reopen_internal(unit->port, 0, 76, NULL); break; } @@ -1654,7 +1659,7 @@ zfcp_erp_wait(struct zfcp_adapter *adapter) } void zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, u8 id, - u64 ref, u32 mask, int set_or_clear) + void *ref, u32 mask, int set_or_clear) { struct zfcp_port *port; u32 changed, common_mask = mask & ZFCP_COMMON_FLAGS; @@ -1682,7 +1687,7 @@ void zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, u8 id, * purpose: sets the port and all underlying devices to ERP_FAILED * */ -void zfcp_erp_modify_port_status(struct zfcp_port *port, u8 id, u64 ref, +void zfcp_erp_modify_port_status(struct zfcp_port *port, u8 id, void *ref, u32 mask, int set_or_clear) { struct zfcp_unit *unit; @@ -1711,7 +1716,7 @@ void zfcp_erp_modify_port_status(struct zfcp_port *port, u8 id, u64 ref, * purpose: sets the unit to ERP_FAILED * */ -void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, u8 id, u64 ref, +void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, u8 id, void *ref, u32 mask, int set_or_clear) { u32 changed; @@ -1738,7 +1743,7 @@ void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, u8 id, u64 ref, * <0 - failed to initiate action */ int zfcp_erp_port_reopen_all(struct zfcp_adapter *adapter, int clear_mask, - u8 id, u64 ref) + u8 id, void *ref) { int retval; unsigned long flags; @@ -1754,7 +1759,7 @@ int zfcp_erp_port_reopen_all(struct zfcp_adapter *adapter, int clear_mask, } static int zfcp_erp_port_reopen_all_internal(struct zfcp_adapter *adapter, - int clear_mask, u8 id, u64 ref) + int clear_mask, u8 id, void *ref) { int retval = 0; struct zfcp_port *port; @@ -1775,7 +1780,7 @@ static int zfcp_erp_port_reopen_all_internal(struct zfcp_adapter *adapter, * returns: FIXME */ static int zfcp_erp_unit_reopen_all_internal(struct zfcp_port *port, - int clear_mask, u8 id, u64 ref) + int clear_mask, u8 id, void *ref) { int retval = 0; struct zfcp_unit *unit; @@ -2291,7 +2296,7 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) port->wwpn, zfcp_get_busid_by_adapter(adapter), adapter->peer_wwpn); - zfcp_erp_port_failed(port, 25, 0); + zfcp_erp_port_failed(port, 25, NULL); retval = ZFCP_ERP_FAILED; break; } @@ -2318,7 +2323,7 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING, &adapter->nameserver_port->status); if (zfcp_erp_port_reopen(adapter->nameserver_port, 0, - 77, (u64)erp_action) >= 0) { + 77, erp_action) >= 0) { erp_action->step = ZFCP_ERP_STEP_NAMESERVER_OPEN; retval = ZFCP_ERP_CONTINUES; @@ -2349,7 +2354,7 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) "for port 0x%016Lx " "(misconfigured WWPN?)\n", port->wwpn); - zfcp_erp_port_failed(port, 26, 0); + zfcp_erp_port_failed(port, 26, NULL); retval = ZFCP_ERP_EXIT; } else { ZFCP_LOG_DEBUG("nameserver look-up failed for " @@ -2449,7 +2454,8 @@ zfcp_erp_port_strategy_open_nameserver_wakeup(struct zfcp_erp_action if (atomic_test_mask( ZFCP_STATUS_COMMON_ERP_FAILED, &adapter->nameserver_port->status)) - zfcp_erp_port_failed(erp_action->port, 27, 0); + zfcp_erp_port_failed(erp_action->port, 27, + NULL); zfcp_erp_action_ready(erp_action); } } @@ -2745,7 +2751,7 @@ void zfcp_erp_start_timer(struct zfcp_fsf_req *fsf_req) */ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, struct zfcp_port *port, - struct zfcp_unit *unit, u8 id, u64 ref) + struct zfcp_unit *unit, u8 id, void *ref) { int retval = 1, need = want; struct zfcp_erp_action *erp_action = NULL; @@ -2888,7 +2894,7 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, zfcp_rec_dbf_event_thread(1, adapter, 0); retval = 0; out: - zfcp_rec_dbf_event_trigger(id, ref, want, need, (u64)erp_action, + zfcp_rec_dbf_event_trigger(id, ref, want, need, erp_action, adapter, port, unit); return retval; } @@ -3048,7 +3054,7 @@ static void zfcp_erp_action_to_ready(struct zfcp_erp_action *erp_action) zfcp_rec_dbf_event_action(146, erp_action); } -void zfcp_erp_port_boxed(struct zfcp_port *port, u8 id, u64 ref) +void zfcp_erp_port_boxed(struct zfcp_port *port, u8 id, void *ref) { unsigned long flags; @@ -3059,14 +3065,14 @@ void zfcp_erp_port_boxed(struct zfcp_port *port, u8 id, u64 ref) zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, id, ref); } -void zfcp_erp_unit_boxed(struct zfcp_unit *unit, u8 id, u64 ref) +void zfcp_erp_unit_boxed(struct zfcp_unit *unit, u8 id, void *ref) { zfcp_erp_modify_unit_status(unit, id, ref, ZFCP_STATUS_COMMON_ACCESS_BOXED, ZFCP_SET); zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED, id, ref); } -void zfcp_erp_port_access_denied(struct zfcp_port *port, u8 id, u64 ref) +void zfcp_erp_port_access_denied(struct zfcp_port *port, u8 id, void *ref) { unsigned long flags; @@ -3077,7 +3083,7 @@ void zfcp_erp_port_access_denied(struct zfcp_port *port, u8 id, u64 ref) read_unlock_irqrestore(&zfcp_data.config_lock, flags); } -void zfcp_erp_unit_access_denied(struct zfcp_unit *unit, u8 id, u64 ref) +void zfcp_erp_unit_access_denied(struct zfcp_unit *unit, u8 id, void *ref) { zfcp_erp_modify_unit_status(unit, id, ref, ZFCP_STATUS_COMMON_ERP_FAILED | @@ -3085,7 +3091,7 @@ void zfcp_erp_unit_access_denied(struct zfcp_unit *unit, u8 id, u64 ref) } void zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter, u8 id, - u64 ref) + void *ref) { struct zfcp_port *port; unsigned long flags; @@ -3102,7 +3108,7 @@ void zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter, u8 id, read_unlock_irqrestore(&zfcp_data.config_lock, flags); } -void zfcp_erp_port_access_changed(struct zfcp_port *port, u8 id, u64 ref) +void zfcp_erp_port_access_changed(struct zfcp_port *port, u8 id, void *ref) { struct zfcp_adapter *adapter = port->adapter; struct zfcp_unit *unit; @@ -3126,7 +3132,7 @@ void zfcp_erp_port_access_changed(struct zfcp_port *port, u8 id, u64 ref) zfcp_get_busid_by_adapter(adapter), port->wwpn); } -void zfcp_erp_unit_access_changed(struct zfcp_unit *unit, u8 id, u64 ref) +void zfcp_erp_unit_access_changed(struct zfcp_unit *unit, u8 id, void *ref) { struct zfcp_adapter *adapter = unit->port->adapter; diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h index 6de0147d84d..6abf178fda5 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h @@ -131,23 +131,25 @@ extern int zfcp_scsi_command_sync(struct zfcp_unit *, struct scsi_cmnd *, int); extern struct fc_function_template zfcp_transport_functions; /******************************** ERP ****************************************/ -extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, u8, u64, u32, - int); -extern int zfcp_erp_adapter_reopen(struct zfcp_adapter *, int, u8, u64); -extern int zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int, u8, u64); -extern void zfcp_erp_adapter_failed(struct zfcp_adapter *, u8, u64); - -extern void zfcp_erp_modify_port_status(struct zfcp_port *, u8, u64, u32, int); -extern int zfcp_erp_port_reopen(struct zfcp_port *, int, u8, u64); -extern int zfcp_erp_port_shutdown(struct zfcp_port *, int, u8, u64); -extern int zfcp_erp_port_forced_reopen(struct zfcp_port *, int, u8, u64); -extern void zfcp_erp_port_failed(struct zfcp_port *, u8, u64); -extern int zfcp_erp_port_reopen_all(struct zfcp_adapter *, int, u8, u64); - -extern void zfcp_erp_modify_unit_status(struct zfcp_unit *, u8, u64, u32, int); -extern int zfcp_erp_unit_reopen(struct zfcp_unit *, int, u8, u64); -extern int zfcp_erp_unit_shutdown(struct zfcp_unit *, int, u8, u64); -extern void zfcp_erp_unit_failed(struct zfcp_unit *, u8, u64); +extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, u8, void *, + u32, int); +extern int zfcp_erp_adapter_reopen(struct zfcp_adapter *, int, u8, void *); +extern int zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int, u8, void *); +extern void zfcp_erp_adapter_failed(struct zfcp_adapter *, u8, void *); + +extern void zfcp_erp_modify_port_status(struct zfcp_port *, u8, void *, u32, + int); +extern int zfcp_erp_port_reopen(struct zfcp_port *, int, u8, void *); +extern int zfcp_erp_port_shutdown(struct zfcp_port *, int, u8, void *); +extern int zfcp_erp_port_forced_reopen(struct zfcp_port *, int, u8, void *); +extern void zfcp_erp_port_failed(struct zfcp_port *, u8, void *); +extern int zfcp_erp_port_reopen_all(struct zfcp_adapter *, int, u8, void *); + +extern void zfcp_erp_modify_unit_status(struct zfcp_unit *, u8, void *, u32, + int); +extern int zfcp_erp_unit_reopen(struct zfcp_unit *, int, u8, void *); +extern int zfcp_erp_unit_shutdown(struct zfcp_unit *, int, u8, void *); +extern void zfcp_erp_unit_failed(struct zfcp_unit *, u8, void *); extern int zfcp_erp_thread_setup(struct zfcp_adapter *); extern int zfcp_erp_thread_kill(struct zfcp_adapter *); @@ -156,22 +158,22 @@ extern void zfcp_erp_async_handler(struct zfcp_erp_action *, unsigned long); extern int zfcp_test_link(struct zfcp_port *); -extern void zfcp_erp_port_boxed(struct zfcp_port *, u8 id, u64 ref); -extern void zfcp_erp_unit_boxed(struct zfcp_unit *, u8 id, u64 ref); -extern void zfcp_erp_port_access_denied(struct zfcp_port *, u8 id, u64 ref); -extern void zfcp_erp_unit_access_denied(struct zfcp_unit *, u8 id, u64 ref); -extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *, u8, u64); -extern void zfcp_erp_port_access_changed(struct zfcp_port *, u8, u64); -extern void zfcp_erp_unit_access_changed(struct zfcp_unit *, u8, u64); +extern void zfcp_erp_port_boxed(struct zfcp_port *, u8 id, void *ref); +extern void zfcp_erp_unit_boxed(struct zfcp_unit *, u8 id, void *ref); +extern void zfcp_erp_port_access_denied(struct zfcp_port *, u8 id, void *ref); +extern void zfcp_erp_unit_access_denied(struct zfcp_unit *, u8 id, void *ref); +extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *, u8, void *); +extern void zfcp_erp_port_access_changed(struct zfcp_port *, u8, void *); +extern void zfcp_erp_unit_access_changed(struct zfcp_unit *, u8, void *); /******************************** AUX ****************************************/ extern void zfcp_rec_dbf_event_thread(u8 id, struct zfcp_adapter *adapter, int lock); -extern void zfcp_rec_dbf_event_adapter(u8 id, u64 ref, struct zfcp_adapter *); -extern void zfcp_rec_dbf_event_port(u8 id, u64 ref, struct zfcp_port *port); -extern void zfcp_rec_dbf_event_unit(u8 id, u64 ref, struct zfcp_unit *unit); -extern void zfcp_rec_dbf_event_trigger(u8 id, u64 ref, u8 want, u8 need, - u64 action, struct zfcp_adapter *, +extern void zfcp_rec_dbf_event_adapter(u8 id, void *ref, struct zfcp_adapter *); +extern void zfcp_rec_dbf_event_port(u8 id, void *ref, struct zfcp_port *port); +extern void zfcp_rec_dbf_event_unit(u8 id, void *ref, struct zfcp_unit *unit); +extern void zfcp_rec_dbf_event_trigger(u8 id, void *ref, u8 want, u8 need, + void *action, struct zfcp_adapter *, struct zfcp_port *, struct zfcp_unit *); extern void zfcp_rec_dbf_event_action(u8 id, struct zfcp_erp_action *); diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index b7aa9696ba6..3211dcc5954 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -298,7 +298,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_adapter(adapter), prot_status_qual->version_error.fsf_version, ZFCP_QTCB_VERSION); - zfcp_erp_adapter_shutdown(adapter, 0, 117, (u64)fsf_req); + zfcp_erp_adapter_shutdown(adapter, 0, 117, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -309,7 +309,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) qtcb->prefix.req_seq_no, zfcp_get_busid_by_adapter(adapter), prot_status_qual->sequence_error.exp_req_seq_no); - zfcp_erp_adapter_reopen(adapter, 0, 98, (u64)fsf_req); + zfcp_erp_adapter_reopen(adapter, 0, 98, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_RETRY; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -320,7 +320,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) "that used on adapter %s. " "Stopping all operations on this adapter.\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_shutdown(adapter, 0, 118, (u64)fsf_req); + zfcp_erp_adapter_shutdown(adapter, 0, 118, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -337,7 +337,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) *(unsigned long long*) (&qtcb->bottom.support.req_handle), zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_shutdown(adapter, 0, 78, (u64)fsf_req); + zfcp_erp_adapter_shutdown(adapter, 0, 78, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -345,7 +345,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) zfcp_fsf_link_down_info_eval(fsf_req, 37, &prot_status_qual->link_down_info); /* FIXME: reopening adapter now? better wait for link up */ - zfcp_erp_adapter_reopen(adapter, 0, 79, (u64)fsf_req); + zfcp_erp_adapter_reopen(adapter, 0, 79, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -355,13 +355,13 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) "Re-starting operations on this adapter.\n", zfcp_get_busid_by_adapter(adapter)); /* All ports should be marked as ready to run again */ - zfcp_erp_modify_adapter_status(adapter, 28, - 0, ZFCP_STATUS_COMMON_RUNNING, + zfcp_erp_modify_adapter_status(adapter, 28, NULL, + ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED | ZFCP_STATUS_COMMON_ERP_FAILED, - 99, (u64)fsf_req); + 99, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -371,7 +371,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) "Restarting all operations on this " "adapter.\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_reopen(adapter, 0, 100, (u64)fsf_req); + zfcp_erp_adapter_reopen(adapter, 0, 100, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_RETRY; fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -384,7 +384,7 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) "(debug info 0x%x).\n", zfcp_get_busid_by_adapter(adapter), qtcb->prefix.prot_status); - zfcp_erp_adapter_shutdown(adapter, 0, 119, (u64)fsf_req); + zfcp_erp_adapter_shutdown(adapter, 0, 119, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; } @@ -423,8 +423,7 @@ zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *fsf_req) "(debug info 0x%x).\n", zfcp_get_busid_by_adapter(fsf_req->adapter), fsf_req->qtcb->header.fsf_command); - zfcp_erp_adapter_shutdown(fsf_req->adapter, 0, 120, - (u64)fsf_req); + zfcp_erp_adapter_shutdown(fsf_req->adapter, 0, 120, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -478,8 +477,7 @@ zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *fsf_req) "problem on the adapter %s " "Stopping all operations on this adapter. ", zfcp_get_busid_by_adapter(fsf_req->adapter)); - zfcp_erp_adapter_shutdown(fsf_req->adapter, 0, 121, - (u64)fsf_req); + zfcp_erp_adapter_shutdown(fsf_req->adapter, 0, 121, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SQ_ULP_PROGRAMMING_ERROR: @@ -605,7 +603,7 @@ zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *fsf_req, u8 id, link_down->vendor_specific_code); out: - zfcp_erp_adapter_failed(adapter, id, (u64)fsf_req); + zfcp_erp_adapter_failed(adapter, id, fsf_req); } /* @@ -799,11 +797,11 @@ zfcp_fsf_status_read_port_closed(struct zfcp_fsf_req *fsf_req) switch (status_buffer->status_subtype) { case FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT: - zfcp_erp_port_reopen(port, 0, 101, (u64)fsf_req); + zfcp_erp_port_reopen(port, 0, 101, fsf_req); break; case FSF_STATUS_READ_SUB_ERROR_PORT: - zfcp_erp_port_shutdown(port, 0, 122, (u64)fsf_req); + zfcp_erp_port_shutdown(port, 0, 122, fsf_req); break; default: @@ -929,13 +927,13 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) "Restarting operations on this adapter\n", zfcp_get_busid_by_adapter(adapter)); /* All ports should be marked as ready to run again */ - zfcp_erp_modify_adapter_status(adapter, 30, 0, + zfcp_erp_modify_adapter_status(adapter, 30, NULL, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED | ZFCP_STATUS_COMMON_ERP_FAILED, - 102, (u64)fsf_req); + 102, fsf_req); break; case FSF_STATUS_READ_NOTIFICATION_LOST: @@ -969,14 +967,13 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) if (status_buffer->status_subtype & FSF_STATUS_READ_SUB_ACT_UPDATED) - zfcp_erp_adapter_access_changed(adapter, 135, - (u64)fsf_req); + zfcp_erp_adapter_access_changed(adapter, 135, fsf_req); break; case FSF_STATUS_READ_CFDC_UPDATED: ZFCP_LOG_NORMAL("CFDC has been updated on the adapter %s\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_access_changed(adapter, 136, (u64)fsf_req); + zfcp_erp_adapter_access_changed(adapter, 136, fsf_req); break; case FSF_STATUS_READ_CFDC_HARDENED: @@ -1044,7 +1041,7 @@ zfcp_fsf_status_read_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_INFO("restart adapter %s due to status read " "buffer shortage\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_reopen(adapter, 0, 103, (u64)fsf_req); + zfcp_erp_adapter_reopen(adapter, 0, 103, fsf_req); } } out: @@ -1164,7 +1161,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) sizeof (union fsf_status_qual)); /* Let's hope this sorts out the mess */ zfcp_erp_adapter_reopen(unit->port->adapter, 0, 104, - (u64)new_fsf_req); + new_fsf_req); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; } break; @@ -1192,8 +1189,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) fsf_status_qual, sizeof (union fsf_status_qual)); /* Let's hope this sorts out the mess */ - zfcp_erp_port_reopen(unit->port, 0, 105, - (u64)new_fsf_req); + zfcp_erp_port_reopen(unit->port, 0, 105, new_fsf_req); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; } break; @@ -1207,7 +1203,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) ZFCP_LOG_INFO("Remote port 0x%016Lx on adapter %s needs to " "be reopened\n", unit->port->wwpn, zfcp_get_busid_by_unit(unit)); - zfcp_erp_port_boxed(unit->port, 47, (u64)new_fsf_req); + zfcp_erp_port_boxed(unit->port, 47, new_fsf_req); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -1218,7 +1214,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) "to be reopened\n", unit->fcp_lun, unit->port->wwpn, zfcp_get_busid_by_unit(unit)); - zfcp_erp_unit_boxed(unit, 48, (u64)new_fsf_req); + zfcp_erp_unit_boxed(unit, 48, new_fsf_req); new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -1452,7 +1448,7 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_port(port), ZFCP_FC_SERVICE_CLASS_DEFAULT); /* stop operation for this adapter */ - zfcp_erp_adapter_shutdown(adapter, 0, 123, (u64)fsf_req); + zfcp_erp_adapter_shutdown(adapter, 0, 123, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -1492,7 +1488,7 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) break; } } - zfcp_erp_port_access_denied(port, 55, (u64)fsf_req); + zfcp_erp_port_access_denied(port, 55, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -1516,7 +1512,7 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_INFO, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - zfcp_erp_adapter_reopen(adapter, 0, 106, (u64)fsf_req); + zfcp_erp_adapter_reopen(adapter, 0, 106, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -1524,7 +1520,7 @@ zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_INFO("port needs to be reopened " "(adapter %s, port d_id=0x%06x)\n", zfcp_get_busid_by_port(port), port->d_id); - zfcp_erp_port_boxed(port, 49, (u64)fsf_req); + zfcp_erp_port_boxed(port, 49, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -1746,7 +1742,7 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_adapter(adapter), ZFCP_FC_SERVICE_CLASS_DEFAULT); /* stop operation for this adapter */ - zfcp_erp_adapter_shutdown(adapter, 0, 124, (u64)fsf_req); + zfcp_erp_adapter_shutdown(adapter, 0, 124, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -1842,7 +1838,7 @@ static int zfcp_fsf_send_els_handler(struct zfcp_fsf_req *fsf_req) } } if (port != NULL) - zfcp_erp_port_access_denied(port, 56, (u64)fsf_req); + zfcp_erp_port_access_denied(port, 56, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2060,7 +2056,7 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) "versions in comparison to this device " "driver (try updated device driver)\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_shutdown(adapter, 0, 125, (u64)fsf_req); + zfcp_erp_adapter_shutdown(adapter, 0, 125, fsf_req); return -EIO; } if (ZFCP_QTCB_VERSION > bottom->high_qtcb_version) { @@ -2069,7 +2065,7 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) "versions than this device driver uses" "(consider a microcode upgrade)\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_shutdown(adapter, 0, 126, (u64)fsf_req); + zfcp_erp_adapter_shutdown(adapter, 0, 126, fsf_req); return -EIO; } return 0; @@ -2115,7 +2111,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) "topology detected at adapter %s " "unsupported, shutting down adapter\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_shutdown(adapter, 0, 127, (u64)fsf_req); + zfcp_erp_adapter_shutdown(adapter, 0, 127, fsf_req); return -EIO; case FC_PORTTYPE_NPORT: ZFCP_LOG_NORMAL("Switched fabric fibrechannel " @@ -2130,7 +2126,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) "of a type known to the zfcp " "driver, shutting down adapter\n", zfcp_get_busid_by_adapter(adapter)); - zfcp_erp_adapter_shutdown(adapter, 0, 128, (u64)fsf_req); + zfcp_erp_adapter_shutdown(adapter, 0, 128, fsf_req); return -EIO; } bottom = &qtcb->bottom.config; @@ -2142,7 +2138,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) bottom->max_qtcb_size, zfcp_get_busid_by_adapter(adapter), sizeof(struct fsf_qtcb)); - zfcp_erp_adapter_shutdown(adapter, 0, 129, (u64)fsf_req); + zfcp_erp_adapter_shutdown(adapter, 0, 129, fsf_req); return -EIO; } atomic_set_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, @@ -2159,7 +2155,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) &qtcb->header.fsf_status_qual.link_down_info); break; default: - zfcp_erp_adapter_shutdown(adapter, 0, 130, (u64)fsf_req); + zfcp_erp_adapter_shutdown(adapter, 0, 130, fsf_req); return -EIO; } return 0; @@ -2458,7 +2454,7 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) break; } } - zfcp_erp_port_access_denied(port, 57, (u64)fsf_req); + zfcp_erp_port_access_denied(port, 57, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2467,7 +2463,7 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) "The remote port 0x%016Lx on adapter %s " "could not be opened. Disabling it.\n", port->wwpn, zfcp_get_busid_by_port(port)); - zfcp_erp_port_failed(port, 31, (u64)fsf_req); + zfcp_erp_port_failed(port, 31, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2487,7 +2483,7 @@ zfcp_fsf_open_port_handler(struct zfcp_fsf_req *fsf_req) "Disabling it.\n", port->wwpn, zfcp_get_busid_by_port(port)); - zfcp_erp_port_failed(port, 32, (u64)fsf_req); + zfcp_erp_port_failed(port, 32, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; default: @@ -2669,7 +2665,7 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &fsf_req->qtcb->header.fsf_status_qual, sizeof (union fsf_status_qual)); - zfcp_erp_adapter_reopen(port->adapter, 0, 107, (u64)fsf_req); + zfcp_erp_adapter_reopen(port->adapter, 0, 107, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2684,7 +2680,7 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_TRACE("remote port 0x016%Lx on adapter %s closed, " "port handle 0x%x\n", port->wwpn, zfcp_get_busid_by_port(port), port->handle); - zfcp_erp_modify_port_status(port, 33, (u64)fsf_req, + zfcp_erp_modify_port_status(port, 33, fsf_req, ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); retval = 0; @@ -2806,7 +2802,7 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - zfcp_erp_adapter_reopen(port->adapter, 0, 108, (u64)fsf_req); + zfcp_erp_adapter_reopen(port->adapter, 0, 108, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2827,7 +2823,7 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) break; } } - zfcp_erp_port_access_denied(port, 58, (u64)fsf_req); + zfcp_erp_port_access_denied(port, 58, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -2837,7 +2833,7 @@ zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *fsf_req) "to close it physically.\n", port->wwpn, zfcp_get_busid_by_port(port)); - zfcp_erp_port_boxed(port, 50, (u64)fsf_req); + zfcp_erp_port_boxed(port, 50, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; @@ -3016,8 +3012,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - zfcp_erp_adapter_reopen(unit->port->adapter, 0, 109, - (u64)fsf_req); + zfcp_erp_adapter_reopen(unit->port->adapter, 0, 109, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3047,7 +3042,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) break; } } - zfcp_erp_unit_access_denied(unit, 59, (u64)fsf_req); + zfcp_erp_unit_access_denied(unit, 59, fsf_req); atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status); atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -3057,7 +3052,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s " "needs to be reopened\n", unit->port->wwpn, zfcp_get_busid_by_unit(unit)); - zfcp_erp_port_boxed(unit->port, 51, (u64)fsf_req); + zfcp_erp_port_boxed(unit->port, 51, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -3097,7 +3092,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - zfcp_erp_unit_access_denied(unit, 60, (u64)fsf_req); + zfcp_erp_unit_access_denied(unit, 60, fsf_req); atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status); atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -3111,7 +3106,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) unit->fcp_lun, unit->port->wwpn, zfcp_get_busid_by_unit(unit)); - zfcp_erp_unit_failed(unit, 34, (u64)fsf_req); + zfcp_erp_unit_failed(unit, 34, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3181,17 +3176,15 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req) if (exclusive && !readwrite) { ZFCP_LOG_NORMAL("exclusive access of read-only " "unit not supported\n"); - zfcp_erp_unit_failed(unit, 35, (u64)fsf_req); + zfcp_erp_unit_failed(unit, 35, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; - zfcp_erp_unit_shutdown(unit, 0, 80, - (u64)fsf_req); + zfcp_erp_unit_shutdown(unit, 0, 80, fsf_req); } else if (!exclusive && readwrite) { ZFCP_LOG_NORMAL("shared access of read-write " "unit not supported\n"); - zfcp_erp_unit_failed(unit, 36, (u64)fsf_req); + zfcp_erp_unit_failed(unit, 36, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; - zfcp_erp_unit_shutdown(unit, 0, 81, - (u64)fsf_req); + zfcp_erp_unit_shutdown(unit, 0, 81, fsf_req); } } @@ -3314,8 +3307,7 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &fsf_req->qtcb->header.fsf_status_qual, sizeof (union fsf_status_qual)); - zfcp_erp_adapter_reopen(unit->port->adapter, 0, 110, - (u64)fsf_req); + zfcp_erp_adapter_reopen(unit->port->adapter, 0, 110, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3331,7 +3323,7 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &fsf_req->qtcb->header.fsf_status_qual, sizeof (union fsf_status_qual)); - zfcp_erp_port_reopen(unit->port, 0, 111, (u64)fsf_req); + zfcp_erp_port_reopen(unit->port, 0, 111, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3340,7 +3332,7 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req) "needs to be reopened\n", unit->port->wwpn, zfcp_get_busid_by_unit(unit)); - zfcp_erp_port_boxed(unit->port, 52, (u64)fsf_req); + zfcp_erp_port_boxed(unit->port, 52, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -3534,7 +3526,7 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter, zfcp_get_busid_by_unit(unit), unit->port->wwpn, unit->fcp_lun); - zfcp_erp_unit_shutdown(unit, 0, 131, (u64)fsf_req); + zfcp_erp_unit_shutdown(unit, 0, 131, fsf_req); retval = -EINVAL; } goto no_fit; @@ -3692,8 +3684,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - zfcp_erp_adapter_reopen(unit->port->adapter, 0, 112, - (u64)fsf_req); + zfcp_erp_adapter_reopen(unit->port->adapter, 0, 112, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3709,7 +3700,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - zfcp_erp_port_reopen(unit->port, 0, 113, (u64)fsf_req); + zfcp_erp_port_reopen(unit->port, 0, 113, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3725,8 +3716,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - zfcp_erp_adapter_reopen(unit->port->adapter, 0, 114, - (u64)fsf_req); + zfcp_erp_adapter_reopen(unit->port->adapter, 0, 114, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3736,8 +3726,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_unit(unit), ZFCP_FC_SERVICE_CLASS_DEFAULT); /* stop operation for this adapter */ - zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 132, - (u64)fsf_req); + zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 132, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3753,7 +3742,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, (char *) &header->fsf_status_qual, sizeof (union fsf_status_qual)); - zfcp_erp_port_reopen(unit->port, 0, 115, (u64)fsf_req); + zfcp_erp_port_reopen(unit->port, 0, 115, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3775,7 +3764,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) break; } } - zfcp_erp_unit_access_denied(unit, 61, (u64)fsf_req); + zfcp_erp_unit_access_denied(unit, 61, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3788,8 +3777,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_unit(unit), fsf_req->qtcb->bottom.io.data_direction); /* stop operation for this adapter */ - zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 133, - (u64)fsf_req); + zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 133, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3802,8 +3790,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) zfcp_get_busid_by_unit(unit), fsf_req->qtcb->bottom.io.fcp_cmnd_length); /* stop operation for this adapter */ - zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 134, - (u64)fsf_req); + zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 134, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; @@ -3811,7 +3798,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) ZFCP_LOG_DEBUG("The remote port 0x%016Lx on adapter %s " "needs to be reopened\n", unit->port->wwpn, zfcp_get_busid_by_unit(unit)); - zfcp_erp_port_boxed(unit->port, 53, (u64)fsf_req); + zfcp_erp_port_boxed(unit->port, 53, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -3821,7 +3808,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req) "wwpn=0x%016Lx, fcp_lun=0x%016Lx)\n", zfcp_get_busid_by_unit(unit), unit->port->wwpn, unit->fcp_lun); - zfcp_erp_unit_boxed(unit, 54, (u64)fsf_req); + zfcp_erp_unit_boxed(unit, 54, fsf_req); fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -4681,7 +4668,7 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req) req_queue->free_index -= fsf_req->sbal_number; req_queue->free_index += QDIO_MAX_BUFFERS_PER_Q; req_queue->free_index %= QDIO_MAX_BUFFERS_PER_Q; /* wrap */ - zfcp_erp_adapter_reopen(adapter, 0, 116, (u64)fsf_req); + zfcp_erp_adapter_reopen(adapter, 0, 116, fsf_req); } else { req_queue->distance_from_int = new_distance_from_int; /* diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c index 5d60a4116af..8ca5f074c68 100644 --- a/drivers/s390/scsi/zfcp_qdio.c +++ b/drivers/s390/scsi/zfcp_qdio.c @@ -176,7 +176,8 @@ zfcp_qdio_handler_error_check(struct zfcp_adapter *adapter, unsigned int status, */ zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED | - ZFCP_STATUS_COMMON_ERP_FAILED, 140, 0); + ZFCP_STATUS_COMMON_ERP_FAILED, 140, + NULL); } return retval; } diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index cd844b2ad7a..3c9880e46e8 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -185,7 +185,7 @@ static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status); sdpnt->hostdata = NULL; unit->device = NULL; - zfcp_erp_unit_failed(unit, 12, 0); + zfcp_erp_unit_failed(unit, 12, NULL); zfcp_unit_put(unit); } else ZFCP_LOG_NORMAL("bug: no unit associated with SCSI device at " @@ -529,7 +529,7 @@ static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt) unit->fcp_lun, unit->port->wwpn, zfcp_get_busid_by_adapter(unit->port->adapter)); - zfcp_erp_adapter_reopen(adapter, 0, 141, (u64)scpnt); + zfcp_erp_adapter_reopen(adapter, 0, 141, scpnt); zfcp_erp_wait(adapter); return SUCCESS; diff --git a/drivers/s390/scsi/zfcp_sysfs_adapter.c b/drivers/s390/scsi/zfcp_sysfs_adapter.c index e0bbcc440a5..ccbba4dd3a7 100644 --- a/drivers/s390/scsi/zfcp_sysfs_adapter.c +++ b/drivers/s390/scsi/zfcp_sysfs_adapter.c @@ -89,7 +89,7 @@ zfcp_sysfs_port_add_store(struct device *dev, struct device_attribute *attr, con retval = 0; - zfcp_erp_port_reopen(port, 0, 91, 0); + zfcp_erp_port_reopen(port, 0, 91, NULL); zfcp_erp_wait(port->adapter); zfcp_port_put(port); out: @@ -147,7 +147,7 @@ zfcp_sysfs_port_remove_store(struct device *dev, struct device_attribute *attr, goto out; } - zfcp_erp_port_shutdown(port, 0, 92, 0); + zfcp_erp_port_shutdown(port, 0, 92, NULL); zfcp_erp_wait(adapter); zfcp_port_put(port); zfcp_port_dequeue(port); @@ -191,9 +191,10 @@ zfcp_sysfs_adapter_failed_store(struct device *dev, struct device_attribute *att goto out; } - zfcp_erp_modify_adapter_status(adapter, 44, 0, + zfcp_erp_modify_adapter_status(adapter, 44, NULL, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); - zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 93, 0); + zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 93, + NULL); zfcp_erp_wait(adapter); out: up(&zfcp_data.config_sema); diff --git a/drivers/s390/scsi/zfcp_sysfs_port.c b/drivers/s390/scsi/zfcp_sysfs_port.c index 538195034c6..703c1b5cb60 100644 --- a/drivers/s390/scsi/zfcp_sysfs_port.c +++ b/drivers/s390/scsi/zfcp_sysfs_port.c @@ -94,7 +94,7 @@ zfcp_sysfs_unit_add_store(struct device *dev, struct device_attribute *attr, con retval = 0; - zfcp_erp_unit_reopen(unit, 0, 94, 0); + zfcp_erp_unit_reopen(unit, 0, 94, NULL); zfcp_erp_wait(unit->port->adapter); zfcp_unit_put(unit); out: @@ -150,7 +150,7 @@ zfcp_sysfs_unit_remove_store(struct device *dev, struct device_attribute *attr, goto out; } - zfcp_erp_unit_shutdown(unit, 0, 95, 0); + zfcp_erp_unit_shutdown(unit, 0, 95, NULL); zfcp_erp_wait(unit->port->adapter); zfcp_unit_put(unit); zfcp_unit_dequeue(unit); @@ -193,9 +193,9 @@ zfcp_sysfs_port_failed_store(struct device *dev, struct device_attribute *attr, goto out; } - zfcp_erp_modify_port_status(port, 45, 0, + zfcp_erp_modify_port_status(port, 45, NULL, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); - zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, 96, 0); + zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, 96, NULL); zfcp_erp_wait(port->adapter); out: up(&zfcp_data.config_sema); diff --git a/drivers/s390/scsi/zfcp_sysfs_unit.c b/drivers/s390/scsi/zfcp_sysfs_unit.c index fd73568b44b..80fb2c2cf48 100644 --- a/drivers/s390/scsi/zfcp_sysfs_unit.c +++ b/drivers/s390/scsi/zfcp_sysfs_unit.c @@ -94,9 +94,9 @@ zfcp_sysfs_unit_failed_store(struct device *dev, struct device_attribute *attr, goto out; } - zfcp_erp_modify_unit_status(unit, 46, 0, + zfcp_erp_modify_unit_status(unit, 46, NULL, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); - zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED, 97, 0); + zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED, 97, NULL); zfcp_erp_wait(unit->port->adapter); out: up(&zfcp_data.config_sema); -- cgit v1.2.3 From 6071d7ec36054e78f02f7d5a66c3784aeb65ce92 Mon Sep 17 00:00:00 2001 From: Christof Schmitt Date: Fri, 18 Apr 2008 12:51:56 +0200 Subject: [SCSI] zfcp: Remove zfcp_erp_wait from slave destory handler to fix deadlock The testcase # chchp -v 0 0.da && sleep 59 && chchp -v 1 0.da results in this deadlock situation: STACK TRACE FOR TASK: 0x7e9a2048 (zfcperp0.0.c613) 0 schedule+816 [0x356b3c] 1 schedule_timeout+172 [0x357340] 2 wait_for_common+192 [0x3565fc] 3 flush_cpu_workqueue+116 [0x52af0] 4 flush_workqueue+116 [0x533b8] 5 fc_remote_port_add+64 [0x1c83ec] 6 zfcp_erp_thread+4534 [0x26585a] 7 kernel_thread_starter+6 [0x195d2] STACK TRACE FOR TASK: 0x7f8ec048 (fc_wq_0) 0 schedule+816 [0x356b3c] 1 zfcp_erp_wait+104 [0x264568] 2 zfcp_scsi_slave_destroy+64 [0x261b24] 3 __scsi_remove_device+154 [0x1c24ba] 4 scsi_remove_device+62 [0x1c2512] 5 __scsi_remove_target+198 [0x1c25ea] 6 __remove_child+58 [0x1c26d6] 7 device_for_each_child+66 [0x1ab566] 8 scsi_remove_target+98 [0x1c268a] 9 run_workqueue+200 [0x5272c] 10 worker_thread+146 [0x52882] 11 kthread+140 [0x58360] 12 kernel_thread_starter+6 [0x195d2] Remove the zfcp_erp_wait call that is not required here to prevent the deadlock situation. Signed-off-by: Christof Schmitt Signed-off-by: Martin Peschke Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_scsi.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 3c9880e46e8..f81850624ee 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c @@ -181,7 +181,6 @@ static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; if (unit) { - zfcp_erp_wait(unit->port->adapter); atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status); sdpnt->hostdata = NULL; unit->device = NULL; -- cgit v1.2.3 From 57b7658aed76f1763416878ead9be4ffa288b7a3 Mon Sep 17 00:00:00 2001 From: Christof Schmitt Date: Fri, 18 Apr 2008 12:51:57 +0200 Subject: [SCSI] zfcp: Fix error handling for blocked unit for send FCP command In the case the unit is blocked, zfcp_unit_get has not been called yet, so the error handling path should not call zfcp_unit_put. Signed-off-by: Christof Schmitt Signed-off-by: Martin Peschke Signed-off-by: James Bottomley --- drivers/s390/scsi/zfcp_fsf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/s390') diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 3211dcc5954..7c3f02816e9 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -3562,8 +3562,8 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter, send_failed: no_fit: failed_scsi_cmnd: - unit_blocked: zfcp_unit_put(unit); + unit_blocked: zfcp_fsf_req_free(fsf_req); fsf_req = NULL; scsi_cmnd->host_scribble = NULL; -- cgit v1.2.3