* [patch 00/18] zfcp updates for 2.6.30
@ 2009-03-02 12:08 Christof Schmitt
2009-03-02 12:08 ` [patch 01/18] [PATCH] zfcp: Remove some port flags Christof Schmitt
` (17 more replies)
0 siblings, 18 replies; 19+ messages in thread
From: Christof Schmitt @ 2009-03-02 12:08 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens
James,
here is the series of zfcp updates for the 2.6.30 merge window. The
patches are based on the current linux-2.6 tree.
--
Christof Schmitt
^ permalink raw reply [flat|nested] 19+ messages in thread* [patch 01/18] [PATCH] zfcp: Remove some port flags 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt @ 2009-03-02 12:08 ` Christof Schmitt 2009-03-02 12:08 ` [patch 02/18] [PATCH] zfcp: Remove UNIT_REGISTERED status flag Christof Schmitt ` (16 subsequent siblings) 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:08 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: 700-zfcp-port-flags.diff --] [-- Type: text/plain, Size: 6014 bytes --] From: Christof Schmitt <christof.schmitt@de.ibm.com> PORT_PHYS_CLOSING is only set and cleared, but not actually used for status checking. PORT_INVALID_WWPN is set when the GID_PN request does not return a d_id for a remote port, e.g. when a remote port has been unplugged. For this case, the d_id is zero. In the erp we can check the d_id and use the normal escalation procedure that gives up after three retries and remove the special case. PORT_NO_WWPN is unused: Each port in the remote port list has a valid wwpn. The WKA ports are now tracked outside the port list. Remove the PORT_NO_WWPN flag, since this is no longer set for any port. Acked-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_aux.c | 13 ++++++------- drivers/s390/scsi/zfcp_def.h | 3 --- drivers/s390/scsi/zfcp_erp.c | 16 ++-------------- drivers/s390/scsi/zfcp_fc.c | 5 ++--- drivers/s390/scsi/zfcp_fsf.c | 6 +----- 5 files changed, 11 insertions(+), 32 deletions(-) diff -urpN linux-2.6/drivers/s390/scsi/zfcp_aux.c linux-2.6-patched/drivers/s390/scsi/zfcp_aux.c --- linux-2.6/drivers/s390/scsi/zfcp_aux.c 2009-03-01 16:41:01.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_aux.c 2009-03-01 16:41:29.000000000 +0100 @@ -249,8 +249,8 @@ struct zfcp_port *zfcp_get_port_by_wwpn( struct zfcp_port *port; list_for_each_entry(port, &adapter->port_list_head, list) - if ((port->wwpn == wwpn) && !(atomic_read(&port->status) & - (ZFCP_STATUS_PORT_NO_WWPN | ZFCP_STATUS_COMMON_REMOVE))) + if ((port->wwpn == wwpn) && + !(atomic_read(&port->status) & ZFCP_STATUS_COMMON_REMOVE)) return port; return NULL; } @@ -620,11 +620,10 @@ struct zfcp_port *zfcp_port_enqueue(stru dev_set_drvdata(&port->sysfs_device, port); read_lock_irq(&zfcp_data.config_lock); - if (!(status & ZFCP_STATUS_PORT_NO_WWPN)) - if (zfcp_get_port_by_wwpn(adapter, wwpn)) { - read_unlock_irq(&zfcp_data.config_lock); - goto err_out_free; - } + if (zfcp_get_port_by_wwpn(adapter, wwpn)) { + read_unlock_irq(&zfcp_data.config_lock); + goto err_out_free; + } read_unlock_irq(&zfcp_data.config_lock); if (device_register(&port->sysfs_device)) diff -urpN linux-2.6/drivers/s390/scsi/zfcp_def.h linux-2.6-patched/drivers/s390/scsi/zfcp_def.h --- linux-2.6/drivers/s390/scsi/zfcp_def.h 2009-03-01 16:41:01.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_def.h 2009-03-01 16:41:29.000000000 +0100 @@ -243,9 +243,6 @@ struct zfcp_ls_adisc { /* remote port status */ #define ZFCP_STATUS_PORT_PHYS_OPEN 0x00000001 -#define ZFCP_STATUS_PORT_PHYS_CLOSING 0x00000004 -#define ZFCP_STATUS_PORT_NO_WWPN 0x00000008 -#define ZFCP_STATUS_PORT_INVALID_WWPN 0x00000020 /* well known address (WKA) port status*/ enum zfcp_wka_status { diff -urpN linux-2.6/drivers/s390/scsi/zfcp_erp.c linux-2.6-patched/drivers/s390/scsi/zfcp_erp.c --- linux-2.6/drivers/s390/scsi/zfcp_erp.c 2009-03-01 16:41:01.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_erp.c 2009-03-01 16:41:29.000000000 +0100 @@ -777,10 +777,7 @@ static int zfcp_erp_port_forced_strategy static void zfcp_erp_port_strategy_clearstati(struct zfcp_port *port) { - atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED | - ZFCP_STATUS_PORT_PHYS_CLOSING | - ZFCP_STATUS_PORT_INVALID_WWPN, - &port->status); + atomic_clear_mask(ZFCP_STATUS_COMMON_ACCESS_DENIED, &port->status); } static int zfcp_erp_port_forced_strategy(struct zfcp_erp_action *erp_action) @@ -875,13 +872,8 @@ static int zfcp_erp_port_strategy_open_c return ZFCP_ERP_CONTINUES; } case ZFCP_ERP_STEP_NAMESERVER_LOOKUP: - if (!port->d_id) { - if (p_status & (ZFCP_STATUS_PORT_INVALID_WWPN)) { - zfcp_erp_port_failed(port, 26, NULL); - return ZFCP_ERP_EXIT; - } + if (!port->d_id) return ZFCP_ERP_FAILED; - } return zfcp_erp_port_strategy_open_port(act); case ZFCP_ERP_STEP_PORT_OPENING: @@ -1269,10 +1261,6 @@ static void zfcp_erp_action_cleanup(stru case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: case ZFCP_ERP_ACTION_REOPEN_PORT: - if (atomic_read(&port->status) & ZFCP_STATUS_PORT_NO_WWPN) { - zfcp_port_put(port); - return; - } if ((result == ZFCP_ERP_SUCCEEDED) && !port->rport) zfcp_erp_rport_register(port); if ((result != ZFCP_ERP_SUCCEEDED) && port->rport) { diff -urpN linux-2.6/drivers/s390/scsi/zfcp_fc.c linux-2.6-patched/drivers/s390/scsi/zfcp_fc.c --- linux-2.6/drivers/s390/scsi/zfcp_fc.c 2009-03-01 16:41:01.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_fc.c 2009-03-01 16:41:29.000000000 +0100 @@ -259,10 +259,9 @@ static void zfcp_fc_ns_gid_pn_eval(unsig if (ct->status) return; - if (ct_iu_resp->header.cmd_rsp_code != ZFCP_CT_ACCEPT) { - atomic_set_mask(ZFCP_STATUS_PORT_INVALID_WWPN, &port->status); + if (ct_iu_resp->header.cmd_rsp_code != ZFCP_CT_ACCEPT) return; - } + /* paranoia */ if (ct_iu_req->wwpn != port->wwpn) return; diff -urpN linux-2.6/drivers/s390/scsi/zfcp_fsf.c linux-2.6-patched/drivers/s390/scsi/zfcp_fsf.c --- linux-2.6/drivers/s390/scsi/zfcp_fsf.c 2009-03-01 16:41:01.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_fsf.c 2009-03-01 16:41:29.000000000 +0100 @@ -1712,7 +1712,7 @@ static void zfcp_fsf_close_physical_port struct zfcp_unit *unit; if (req->status & ZFCP_STATUS_FSFREQ_ERROR) - goto skip_fsfstatus; + return; switch (header->fsf_status) { case FSF_PORT_HANDLE_NOT_VALID: @@ -1752,8 +1752,6 @@ static void zfcp_fsf_close_physical_port &unit->status); break; } -skip_fsfstatus: - atomic_clear_mask(ZFCP_STATUS_PORT_PHYS_CLOSING, &port->status); } /** @@ -1789,8 +1787,6 @@ int zfcp_fsf_close_physical_port(struct req->erp_action = erp_action; req->handler = zfcp_fsf_close_physical_port_handler; erp_action->fsf_req = req; - atomic_set_mask(ZFCP_STATUS_PORT_PHYS_CLOSING, - &erp_action->port->status); zfcp_fsf_start_erp_timer(req); retval = zfcp_fsf_req_send(req); ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 02/18] [PATCH] zfcp: Remove UNIT_REGISTERED status flag 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt 2009-03-02 12:08 ` [patch 01/18] [PATCH] zfcp: Remove some port flags Christof Schmitt @ 2009-03-02 12:08 ` Christof Schmitt 2009-03-02 12:08 ` [patch 03/18] [Patch] zfcp: add measurement data for average qdio queue utilisation Christof Schmitt ` (15 subsequent siblings) 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:08 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: 701-zfcp-unit-registered.diff --] [-- Type: text/plain, Size: 3369 bytes --] From: Christof Schmitt <christof.schmitt@de.ibm.com> Use the device pointer in zfcp_unit for tracking if we have a registered SCSI device. With this approach, the flag ZFCP_STATUS_UNIT_REGISTERED is only redundant and can be removed. Acked-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_ccw.c | 3 +-- drivers/s390/scsi/zfcp_def.h | 1 - drivers/s390/scsi/zfcp_erp.c | 2 -- drivers/s390/scsi/zfcp_scsi.c | 4 +--- 4 files changed, 2 insertions(+), 8 deletions(-) diff -urpN linux-2.6/drivers/s390/scsi/zfcp_ccw.c linux-2.6-patched/drivers/s390/scsi/zfcp_ccw.c --- linux-2.6/drivers/s390/scsi/zfcp_ccw.c 2009-03-01 16:41:01.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_ccw.c 2009-03-01 16:41:30.000000000 +0100 @@ -72,8 +72,7 @@ static void zfcp_ccw_remove(struct ccw_d list_for_each_entry_safe(port, p, &port_remove_lh, list) { list_for_each_entry_safe(unit, u, &unit_remove_lh, list) { - if (atomic_read(&unit->status) & - ZFCP_STATUS_UNIT_REGISTERED) + if (unit->device) scsi_remove_device(unit->device); zfcp_unit_dequeue(unit); } diff -urpN linux-2.6/drivers/s390/scsi/zfcp_def.h linux-2.6-patched/drivers/s390/scsi/zfcp_def.h --- linux-2.6/drivers/s390/scsi/zfcp_def.h 2009-03-01 16:41:30.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_def.h 2009-03-01 16:41:30.000000000 +0100 @@ -255,7 +255,6 @@ enum zfcp_wka_status { /* logical unit status */ #define ZFCP_STATUS_UNIT_SHARED 0x00000004 #define ZFCP_STATUS_UNIT_READONLY 0x00000008 -#define ZFCP_STATUS_UNIT_REGISTERED 0x00000010 #define ZFCP_STATUS_UNIT_SCSI_WORK_PENDING 0x00000020 /* FSF request status (this does not have a common part) */ diff -urpN linux-2.6/drivers/s390/scsi/zfcp_erp.c linux-2.6-patched/drivers/s390/scsi/zfcp_erp.c --- linux-2.6/drivers/s390/scsi/zfcp_erp.c 2009-03-01 16:41:30.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_erp.c 2009-03-01 16:41:30.000000000 +0100 @@ -1250,8 +1250,6 @@ static void zfcp_erp_action_cleanup(stru case ZFCP_ERP_ACTION_REOPEN_UNIT: if ((result == ZFCP_ERP_SUCCEEDED) && !unit->device && port->rport) { - atomic_set_mask(ZFCP_STATUS_UNIT_REGISTERED, - &unit->status); if (!(atomic_read(&unit->status) & ZFCP_STATUS_UNIT_SCSI_WORK_PENDING)) zfcp_erp_schedule_work(unit); diff -urpN linux-2.6/drivers/s390/scsi/zfcp_scsi.c linux-2.6-patched/drivers/s390/scsi/zfcp_scsi.c --- linux-2.6/drivers/s390/scsi/zfcp_scsi.c 2009-03-01 16:41:01.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_scsi.c 2009-03-01 16:41:30.000000000 +0100 @@ -27,7 +27,6 @@ char *zfcp_get_fcp_sns_info_ptr(struct f static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) { struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; - atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status); unit->device = NULL; zfcp_erp_unit_failed(unit, 12, NULL); zfcp_unit_put(unit); @@ -133,8 +132,7 @@ static int zfcp_scsi_slave_alloc(struct read_lock_irqsave(&zfcp_data.config_lock, flags); unit = zfcp_unit_lookup(adapter, sdp->channel, sdp->id, sdp->lun); - if (unit && - (atomic_read(&unit->status) & ZFCP_STATUS_UNIT_REGISTERED)) { + if (unit) { sdp->hostdata = unit; unit->device = sdp; zfcp_unit_get(unit); ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 03/18] [Patch] zfcp: add measurement data for average qdio queue utilisation 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt 2009-03-02 12:08 ` [patch 01/18] [PATCH] zfcp: Remove some port flags Christof Schmitt 2009-03-02 12:08 ` [patch 02/18] [PATCH] zfcp: Remove UNIT_REGISTERED status flag Christof Schmitt @ 2009-03-02 12:08 ` Christof Schmitt 2009-03-02 12:08 ` [patch 04/18] [PATCH] zfcp: Simplify latency lock handling Christof Schmitt ` (14 subsequent siblings) 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:08 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Martin Peschke, Christof Schmitt [-- Attachment #1: 702-zfcp-queue-lock.diff --] [-- Type: text/plain, Size: 4343 bytes --] From: Martin Peschke <mpeschke@linux.vnet.ibm.com> Provide measurement data for the utilisation of the QDIO outbound queue. The additional value allows to calculate an average queue utilisation by looking at the deltas per time unit. Needed for capacity planning. It is up to user space to handle wrap-arounds of the 64 bit value. The new counter neatly complements the existing counter for queue full conditions. That is why, both statistics counter have been integrated. Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_aux.c | 1 + drivers/s390/scsi/zfcp_def.h | 3 +++ drivers/s390/scsi/zfcp_qdio.c | 20 ++++++++++++++++++++ drivers/s390/scsi/zfcp_sysfs.c | 3 ++- 4 files changed, 26 insertions(+), 1 deletion(-) diff -urpN linux-2.6/drivers/s390/scsi/zfcp_aux.c linux-2.6-patched/drivers/s390/scsi/zfcp_aux.c --- linux-2.6/drivers/s390/scsi/zfcp_aux.c 2009-03-01 16:41:30.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_aux.c 2009-03-01 16:41:30.000000000 +0100 @@ -501,6 +501,7 @@ int zfcp_adapter_enqueue(struct ccw_devi spin_lock_init(&adapter->scsi_dbf_lock); spin_lock_init(&adapter->rec_dbf_lock); spin_lock_init(&adapter->req_q_lock); + spin_lock_init(&adapter->qdio_stat_lock); rwlock_init(&adapter->erp_lock); rwlock_init(&adapter->abort_lock); diff -urpN linux-2.6/drivers/s390/scsi/zfcp_def.h linux-2.6-patched/drivers/s390/scsi/zfcp_def.h --- linux-2.6/drivers/s390/scsi/zfcp_def.h 2009-03-01 16:41:30.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_def.h 2009-03-01 16:41:30.000000000 +0100 @@ -445,6 +445,9 @@ struct zfcp_adapter { spinlock_t req_q_lock; /* for operations on queue */ int req_q_pci_batch; /* SBALs since PCI indication was last set */ + ktime_t req_q_time; /* time of last fill level change */ + u64 req_q_util; /* for accounting */ + spinlock_t qdio_stat_lock; u32 fsf_req_seq_no; /* FSF cmnd seq number */ wait_queue_head_t request_wq; /* can be used to wait for more avaliable SBALs */ diff -urpN linux-2.6/drivers/s390/scsi/zfcp_qdio.c linux-2.6-patched/drivers/s390/scsi/zfcp_qdio.c --- linux-2.6/drivers/s390/scsi/zfcp_qdio.c 2009-03-01 16:41:01.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_qdio.c 2009-03-01 16:41:30.000000000 +0100 @@ -77,6 +77,23 @@ static void zfcp_qdio_zero_sbals(struct } } +/* this needs to be called prior to updating the queue fill level */ +static void zfcp_qdio_account(struct zfcp_adapter *adapter) +{ + ktime_t now; + s64 span; + int free, used; + + spin_lock(&adapter->qdio_stat_lock); + now = ktime_get(); + span = ktime_us_delta(now, adapter->req_q_time); + free = max(0, atomic_read(&adapter->req_q.count)); + used = QDIO_MAX_BUFFERS_PER_Q - free; + adapter->req_q_util += used * span; + adapter->req_q_time = now; + spin_unlock(&adapter->qdio_stat_lock); +} + static void zfcp_qdio_int_req(struct ccw_device *cdev, unsigned int qdio_err, int queue_no, int first, int count, unsigned long parm) @@ -93,6 +110,7 @@ static void zfcp_qdio_int_req(struct ccw /* cleanup all SBALs being program-owned now */ zfcp_qdio_zero_sbals(queue->sbal, first, count); + zfcp_qdio_account(adapter); atomic_add(count, &queue->count); wake_up(&adapter->request_wq); } @@ -359,6 +377,8 @@ int zfcp_qdio_send(struct zfcp_fsf_req * sbale->flags |= SBAL_FLAGS0_PCI; } + zfcp_qdio_account(adapter); + retval = do_QDIO(adapter->ccw_device, QDIO_FLAG_SYNC_OUTPUT, 0, first, count); if (unlikely(retval)) { diff -urpN linux-2.6/drivers/s390/scsi/zfcp_sysfs.c linux-2.6-patched/drivers/s390/scsi/zfcp_sysfs.c --- linux-2.6/drivers/s390/scsi/zfcp_sysfs.c 2009-03-01 16:41:01.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_sysfs.c 2009-03-01 16:41:30.000000000 +0100 @@ -487,7 +487,8 @@ static ssize_t zfcp_sysfs_adapter_q_full struct zfcp_adapter *adapter = (struct zfcp_adapter *) scsi_host->hostdata[0]; - return sprintf(buf, "%d\n", atomic_read(&adapter->qdio_outb_full)); + return sprintf(buf, "%d %llu\n", atomic_read(&adapter->qdio_outb_full), + (unsigned long long)adapter->req_q_util); } static DEVICE_ATTR(queue_full, S_IRUGO, zfcp_sysfs_adapter_q_full_show, NULL); ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 04/18] [PATCH] zfcp: Simplify latency lock handling 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt ` (2 preceding siblings ...) 2009-03-02 12:08 ` [patch 03/18] [Patch] zfcp: add measurement data for average qdio queue utilisation Christof Schmitt @ 2009-03-02 12:08 ` Christof Schmitt 2009-03-02 12:08 ` [patch 05/18] [PATCH] zfcp: Only increment req_id for successfully issued requests Christof Schmitt ` (13 subsequent siblings) 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:08 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: 703-zfcp-lat-lock.diff --] [-- Type: text/plain, Size: 2637 bytes --] From: Christof Schmitt <christof.schmitt@de.ibm.com> The lock only needs to protect the softirq context called from qdio against the userspace context called from sysfs. spin_lock and spin_lock_bh is enough. Acked-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_fsf.c | 5 ++--- drivers/s390/scsi/zfcp_sysfs.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff -urpN linux-2.6/drivers/s390/scsi/zfcp_fsf.c linux-2.6-patched/drivers/s390/scsi/zfcp_fsf.c --- linux-2.6/drivers/s390/scsi/zfcp_fsf.c 2009-03-01 16:41:30.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_fsf.c 2009-03-01 16:41:30.000000000 +0100 @@ -2069,7 +2069,6 @@ static void zfcp_fsf_req_latency(struct struct fsf_qual_latency_info *lat_inf; struct latency_cont *lat; struct zfcp_unit *unit = req->unit; - unsigned long flags; lat_inf = &req->qtcb->prefix.prot_status_qual.latency_info; @@ -2087,11 +2086,11 @@ static void zfcp_fsf_req_latency(struct return; } - spin_lock_irqsave(&unit->latencies.lock, flags); + spin_lock(&unit->latencies.lock); zfcp_fsf_update_lat(&lat->channel, lat_inf->channel_lat); zfcp_fsf_update_lat(&lat->fabric, lat_inf->fabric_lat); lat->counter++; - spin_unlock_irqrestore(&unit->latencies.lock, flags); + spin_unlock(&unit->latencies.lock); } #ifdef CONFIG_BLK_DEV_IO_TRACE diff -urpN linux-2.6/drivers/s390/scsi/zfcp_sysfs.c linux-2.6-patched/drivers/s390/scsi/zfcp_sysfs.c --- linux-2.6/drivers/s390/scsi/zfcp_sysfs.c 2009-03-01 16:41:30.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_sysfs.c 2009-03-01 16:41:30.000000000 +0100 @@ -318,10 +318,9 @@ zfcp_sysfs_unit_##_name##_latency_show(s struct zfcp_unit *unit = sdev->hostdata; \ struct zfcp_latencies *lat = &unit->latencies; \ struct zfcp_adapter *adapter = unit->port->adapter; \ - unsigned long flags; \ unsigned long long fsum, fmin, fmax, csum, cmin, cmax, cc; \ \ - spin_lock_irqsave(&lat->lock, flags); \ + spin_lock_bh(&lat->lock); \ fsum = lat->_name.fabric.sum * adapter->timer_ticks; \ fmin = lat->_name.fabric.min * adapter->timer_ticks; \ fmax = lat->_name.fabric.max * adapter->timer_ticks; \ @@ -329,7 +328,7 @@ zfcp_sysfs_unit_##_name##_latency_show(s cmin = lat->_name.channel.min * adapter->timer_ticks; \ cmax = lat->_name.channel.max * adapter->timer_ticks; \ cc = lat->_name.counter; \ - spin_unlock_irqrestore(&lat->lock, flags); \ + spin_unlock_bh(&lat->lock); \ \ do_div(fsum, 1000); \ do_div(fmin, 1000); \ ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 05/18] [PATCH] zfcp: Only increment req_id for successfully issued requests 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt ` (3 preceding siblings ...) 2009-03-02 12:08 ` [patch 04/18] [PATCH] zfcp: Simplify latency lock handling Christof Schmitt @ 2009-03-02 12:08 ` Christof Schmitt 2009-03-02 12:08 ` [patch 06/18] [PATCH] zfcp: Wait for free SBALs when possible Christof Schmitt ` (12 subsequent siblings) 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:08 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: 704-zfcp-req_id.diff --] [-- Type: text/plain, Size: 1113 bytes --] From: Christof Schmitt <christof.schmitt@de.ibm.com> Only increment the req_id for successfully issued requests. This avoids some confusion when debugging issued fsf requests. Acked-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_fsf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -urpN linux-2.6/drivers/s390/scsi/zfcp_fsf.c linux-2.6-patched/drivers/s390/scsi/zfcp_fsf.c --- linux-2.6/drivers/s390/scsi/zfcp_fsf.c 2009-03-01 16:41:31.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_fsf.c 2009-03-01 16:41:31.000000000 +0100 @@ -735,7 +735,7 @@ static struct zfcp_fsf_req *zfcp_fsf_req req->adapter = adapter; req->fsf_command = fsf_cmd; - req->req_id = adapter->req_no++; + req->req_id = adapter->req_no; req->sbal_number = 1; req->sbal_first = req_q->first; req->sbal_last = req_q->first; @@ -798,6 +798,7 @@ static int zfcp_fsf_req_send(struct zfcp /* Don't increase for unsolicited status */ if (req->qtcb) adapter->fsf_req_seq_no++; + adapter->req_no++; return 0; } ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 06/18] [PATCH] zfcp: Wait for free SBALs when possible 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt ` (4 preceding siblings ...) 2009-03-02 12:08 ` [patch 05/18] [PATCH] zfcp: Only increment req_id for successfully issued requests Christof Schmitt @ 2009-03-02 12:08 ` Christof Schmitt 2009-03-02 12:09 ` [patch 07/18] [PATCH] zfcp: Improve reliability of SCSI eh handlers in zfcp Christof Schmitt ` (11 subsequent siblings) 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:08 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: 705-zfcp-wait-sbal.diff --] [-- Type: text/plain, Size: 2624 bytes --] From: Christof Schmitt <christof.schmitt@de.ibm.com> For calls from zfcp erp, scsi_eh and sysfs switch the calls issuing FSF requests to zfcp_fsf_req_sbal_get to wait for free SBALs. Acked-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_fsf.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) --- a/drivers/s390/scsi/zfcp_fsf.c 2009-03-02 12:42:25.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_fsf.c 2009-03-02 12:42:26.000000000 +0100 @@ -929,8 +929,8 @@ struct zfcp_fsf_req *zfcp_fsf_abort_fcp_ struct qdio_buffer_element *sbale; struct zfcp_fsf_req *req = NULL; - spin_lock(&adapter->req_q_lock); - if (!zfcp_fsf_sbal_available(adapter)) + spin_lock_bh(&adapter->req_q_lock); + if (zfcp_fsf_req_sbal_get(adapter)) goto out; req = zfcp_fsf_req_create(adapter, FSF_QTCB_ABORT_FCP_CMND, req_flags, adapter->pool.fsf_req_abort); @@ -961,7 +961,7 @@ out_error_free: zfcp_fsf_req_free(req); req = NULL; out: - spin_unlock(&adapter->req_q_lock); + spin_unlock_bh(&adapter->req_q_lock); return req; } @@ -1225,7 +1225,7 @@ int zfcp_fsf_exchange_config_data(struct int retval = -EIO; spin_lock_bh(&adapter->req_q_lock); - if (!zfcp_fsf_sbal_available(adapter)) + if (zfcp_fsf_req_sbal_get(adapter)) goto out; req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_CONFIG_DATA, @@ -1321,7 +1321,7 @@ int zfcp_fsf_exchange_port_data(struct z return -EOPNOTSUPP; spin_lock_bh(&adapter->req_q_lock); - if (!zfcp_fsf_sbal_available(adapter)) + if (zfcp_fsf_req_sbal_get(adapter)) goto out; req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, ZFCP_REQ_AUTO_CLEANUP, @@ -1367,7 +1367,7 @@ int zfcp_fsf_exchange_port_data_sync(str return -EOPNOTSUPP; spin_lock_bh(&adapter->req_q_lock); - if (!zfcp_fsf_sbal_available(adapter)) + if (zfcp_fsf_req_sbal_get(adapter)) goto out; req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, 0, @@ -2453,8 +2453,8 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_c ZFCP_STATUS_COMMON_UNBLOCKED))) return NULL; - spin_lock(&adapter->req_q_lock); - if (!zfcp_fsf_sbal_available(adapter)) + spin_lock_bh(&adapter->req_q_lock); + if (zfcp_fsf_req_sbal_get(adapter)) goto out; req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, adapter->pool.fsf_req_scsi); @@ -2488,7 +2488,7 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_c zfcp_fsf_req_free(req); req = NULL; out: - spin_unlock(&adapter->req_q_lock); + spin_unlock_bh(&adapter->req_q_lock); return req; } ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 07/18] [PATCH] zfcp: Improve reliability of SCSI eh handlers in zfcp 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt ` (5 preceding siblings ...) 2009-03-02 12:08 ` [patch 06/18] [PATCH] zfcp: Wait for free SBALs when possible Christof Schmitt @ 2009-03-02 12:09 ` Christof Schmitt 2009-03-02 12:09 ` [patch 08/18] [PATCH] zfcp: Send ELS ADISC from workqueue Christof Schmitt ` (10 subsequent siblings) 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:09 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: 706-zfcp-reliability.diff --] [-- Type: text/plain, Size: 12691 bytes --] From: Christof Schmitt <christof.schmitt@de.ibm.com> When the SCSI midlayer is running error recovery, the low-level error recovery in zfcp could be running and preventing the SCSI midlayer to issue error recovery requests. To avoid unnecessary error recovery escalation, wait for the zfcp erp to finish and retry if necessary. While reworking the SCSI eh handlers, alsa cleanup the code and simplify the interface from zfcp_scsi to the fsf layer. Acked-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_def.h | 3 - drivers/s390/scsi/zfcp_ext.h | 11 +-- drivers/s390/scsi/zfcp_fsf.c | 39 ++++--------- drivers/s390/scsi/zfcp_scsi.c | 122 ++++++++++++++++++++---------------------- 4 files changed, 77 insertions(+), 98 deletions(-) --- a/drivers/s390/scsi/zfcp_def.h 2009-03-02 12:42:24.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_def.h 2009-03-02 12:42:30.000000000 +0100 @@ -586,9 +586,6 @@ struct zfcp_fsf_req_qtcb { /********************** ZFCP SPECIFIC DEFINES ********************************/ -#define ZFCP_REQ_AUTO_CLEANUP 0x00000002 -#define ZFCP_REQ_NO_QTCB 0x00000008 - #define ZFCP_SET 0x00000100 #define ZFCP_CLEAR 0x00000200 --- a/drivers/s390/scsi/zfcp_ext.h 2009-03-02 12:42:20.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_ext.h 2009-03-02 12:42:30.000000000 +0100 @@ -125,16 +125,13 @@ extern int zfcp_status_read_refill(struc extern int zfcp_fsf_send_ct(struct zfcp_send_ct *, mempool_t *, struct zfcp_erp_action *); extern int zfcp_fsf_send_els(struct zfcp_send_els *); -extern int zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *, - struct zfcp_unit *, - struct scsi_cmnd *, int, int); +extern int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *, + struct scsi_cmnd *); extern void zfcp_fsf_req_complete(struct zfcp_fsf_req *); extern void zfcp_fsf_req_free(struct zfcp_fsf_req *); -extern struct zfcp_fsf_req *zfcp_fsf_send_fcp_ctm(struct zfcp_adapter *, - struct zfcp_unit *, u8, int); +extern struct zfcp_fsf_req *zfcp_fsf_send_fcp_ctm(struct zfcp_unit *, u8); extern struct zfcp_fsf_req *zfcp_fsf_abort_fcp_command(unsigned long, - struct zfcp_adapter *, - struct zfcp_unit *, int); + struct zfcp_unit *); /* zfcp_qdio.c */ extern int zfcp_qdio_allocate(struct zfcp_adapter *); --- a/drivers/s390/scsi/zfcp_fsf.c 2009-03-02 12:42:26.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_fsf.c 2009-03-02 12:42:30.000000000 +0100 @@ -12,6 +12,9 @@ #include <linux/blktrace_api.h> #include "zfcp_ext.h" +#define ZFCP_REQ_AUTO_CLEANUP 0x00000002 +#define ZFCP_REQ_NO_QTCB 0x00000008 + static void zfcp_fsf_request_timeout_handler(unsigned long data) { struct zfcp_adapter *adapter = (struct zfcp_adapter *) data; @@ -913,27 +916,22 @@ static void zfcp_fsf_abort_fcp_command_h /** * zfcp_fsf_abort_fcp_command - abort running SCSI command * @old_req_id: unsigned long - * @adapter: pointer to struct zfcp_adapter * @unit: pointer to struct zfcp_unit - * @req_flags: integer specifying the request flags * Returns: pointer to struct zfcp_fsf_req - * - * FIXME(design): should be watched by a timeout !!! */ struct zfcp_fsf_req *zfcp_fsf_abort_fcp_command(unsigned long old_req_id, - struct zfcp_adapter *adapter, - struct zfcp_unit *unit, - int req_flags) + struct zfcp_unit *unit) { struct qdio_buffer_element *sbale; struct zfcp_fsf_req *req = NULL; + struct zfcp_adapter *adapter = unit->port->adapter; spin_lock_bh(&adapter->req_q_lock); if (zfcp_fsf_req_sbal_get(adapter)) goto out; req = zfcp_fsf_req_create(adapter, FSF_QTCB_ABORT_FCP_CMND, - req_flags, adapter->pool.fsf_req_abort); + 0, adapter->pool.fsf_req_abort); if (IS_ERR(req)) { req = NULL; goto out; @@ -2310,21 +2308,17 @@ static void zfcp_set_fcp_dl(struct fcp_c /** * zfcp_fsf_send_fcp_command_task - initiate an FCP command (for a SCSI command) - * @adapter: adapter where scsi command is issued * @unit: unit where command is sent to * @scsi_cmnd: scsi command to be sent - * @timer: timer to be started when request is initiated - * @req_flags: flags for fsf_request */ -int zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter, - struct zfcp_unit *unit, - struct scsi_cmnd *scsi_cmnd, - int use_timer, int req_flags) +int zfcp_fsf_send_fcp_command_task(struct zfcp_unit *unit, + struct scsi_cmnd *scsi_cmnd) { struct zfcp_fsf_req *req; struct fcp_cmnd_iu *fcp_cmnd_iu; unsigned int sbtype; int real_bytes, retval = -EIO; + struct zfcp_adapter *adapter = unit->port->adapter; if (unlikely(!(atomic_read(&unit->status) & ZFCP_STATUS_COMMON_UNBLOCKED))) @@ -2333,7 +2327,8 @@ int zfcp_fsf_send_fcp_command_task(struc spin_lock(&adapter->req_q_lock); if (!zfcp_fsf_sbal_available(adapter)) goto out; - req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, + req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, + ZFCP_REQ_AUTO_CLEANUP, adapter->pool.fsf_req_scsi); if (IS_ERR(req)) { retval = PTR_ERR(req); @@ -2415,9 +2410,6 @@ int zfcp_fsf_send_fcp_command_task(struc zfcp_set_fcp_dl(fcp_cmnd_iu, real_bytes); - if (use_timer) - zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); - retval = zfcp_fsf_req_send(req); if (unlikely(retval)) goto failed_scsi_cmnd; @@ -2435,19 +2427,16 @@ out: /** * zfcp_fsf_send_fcp_ctm - send SCSI task management command - * @adapter: pointer to struct zfcp-adapter * @unit: pointer to struct zfcp_unit * @tm_flags: unsigned byte for task management flags - * @req_flags: int request flags * Returns: on success pointer to struct fsf_req, NULL otherwise */ -struct zfcp_fsf_req *zfcp_fsf_send_fcp_ctm(struct zfcp_adapter *adapter, - struct zfcp_unit *unit, - u8 tm_flags, int req_flags) +struct zfcp_fsf_req *zfcp_fsf_send_fcp_ctm(struct zfcp_unit *unit, u8 tm_flags) { struct qdio_buffer_element *sbale; struct zfcp_fsf_req *req = NULL; struct fcp_cmnd_iu *fcp_cmnd_iu; + struct zfcp_adapter *adapter = unit->port->adapter; if (unlikely(!(atomic_read(&unit->status) & ZFCP_STATUS_COMMON_UNBLOCKED))) @@ -2456,7 +2445,7 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_c spin_lock_bh(&adapter->req_q_lock); if (zfcp_fsf_req_sbal_get(adapter)) goto out; - req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags, + req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, 0, adapter->pool.fsf_req_scsi); if (IS_ERR(req)) { req = NULL; --- a/drivers/s390/scsi/zfcp_scsi.c 2009-03-02 12:42:23.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_scsi.c 2009-03-02 12:42:30.000000000 +0100 @@ -87,8 +87,7 @@ static int zfcp_scsi_queuecommand(struct return 0;; } - ret = zfcp_fsf_send_fcp_command_task(adapter, unit, scpnt, 0, - ZFCP_REQ_AUTO_CLEANUP); + ret = zfcp_fsf_send_fcp_command_task(unit, scpnt); if (unlikely(ret == -EBUSY)) return SCSI_MLQUEUE_DEVICE_BUSY; else if (unlikely(ret < 0)) @@ -145,79 +144,91 @@ out: static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) { - struct Scsi_Host *scsi_host; - struct zfcp_adapter *adapter; - struct zfcp_unit *unit; - struct zfcp_fsf_req *fsf_req; + struct Scsi_Host *scsi_host = scpnt->device->host; + struct zfcp_adapter *adapter = + (struct zfcp_adapter *) scsi_host->hostdata[0]; + struct zfcp_unit *unit = scpnt->device->hostdata; + struct zfcp_fsf_req *old_req, *abrt_req; unsigned long flags; unsigned long old_req_id = (unsigned long) scpnt->host_scribble; int retval = SUCCESS; - - scsi_host = scpnt->device->host; - adapter = (struct zfcp_adapter *) scsi_host->hostdata[0]; - unit = scpnt->device->hostdata; + int retry = 3; /* avoid race condition between late normal completion and abort */ write_lock_irqsave(&adapter->abort_lock, flags); - /* Check whether corresponding fsf_req is still pending */ spin_lock(&adapter->req_list_lock); - fsf_req = zfcp_reqlist_find(adapter, old_req_id); + old_req = zfcp_reqlist_find(adapter, old_req_id); spin_unlock(&adapter->req_list_lock); - if (!fsf_req) { + if (!old_req) { write_unlock_irqrestore(&adapter->abort_lock, flags); - zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, NULL, 0); - return retval; + zfcp_scsi_dbf_event_abort("lte1", adapter, scpnt, NULL, + old_req_id); + return SUCCESS; } - fsf_req->data = NULL; + old_req->data = NULL; /* don't access old fsf_req after releasing the abort_lock */ write_unlock_irqrestore(&adapter->abort_lock, flags); - fsf_req = zfcp_fsf_abort_fcp_command(old_req_id, adapter, unit, 0); - if (!fsf_req) { - zfcp_scsi_dbf_event_abort("nres", adapter, scpnt, NULL, - old_req_id); - retval = FAILED; - return retval; + while (retry--) { + abrt_req = zfcp_fsf_abort_fcp_command(old_req_id, unit); + if (abrt_req) + break; + + zfcp_erp_wait(adapter); + if (!(atomic_read(&adapter->status) & + ZFCP_STATUS_COMMON_RUNNING)) { + zfcp_scsi_dbf_event_abort("nres", adapter, scpnt, NULL, + old_req_id); + return SUCCESS; + } } + if (!abrt_req) + return FAILED; - __wait_event(fsf_req->completion_wq, - fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); + wait_event(abrt_req->completion_wq, + abrt_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); - if (fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED) { - zfcp_scsi_dbf_event_abort("okay", adapter, scpnt, fsf_req, 0); - } else if (fsf_req->status & ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED) { - zfcp_scsi_dbf_event_abort("lte2", adapter, scpnt, fsf_req, 0); - } else { - zfcp_scsi_dbf_event_abort("fail", adapter, scpnt, fsf_req, 0); + if (abrt_req->status & ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED) + zfcp_scsi_dbf_event_abort("okay", adapter, scpnt, abrt_req, 0); + else if (abrt_req->status & ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED) + zfcp_scsi_dbf_event_abort("lte2", adapter, scpnt, abrt_req, 0); + else { + zfcp_scsi_dbf_event_abort("fail", adapter, scpnt, abrt_req, 0); retval = FAILED; } - zfcp_fsf_req_free(fsf_req); - + zfcp_fsf_req_free(abrt_req); return retval; } -static int zfcp_task_mgmt_function(struct zfcp_unit *unit, u8 tm_flags, - struct scsi_cmnd *scpnt) +static int zfcp_task_mgmt_function(struct scsi_cmnd *scpnt, u8 tm_flags) { + struct zfcp_unit *unit = scpnt->device->hostdata; struct zfcp_adapter *adapter = unit->port->adapter; struct zfcp_fsf_req *fsf_req; int retval = SUCCESS; + int retry = 3; - /* issue task management function */ - fsf_req = zfcp_fsf_send_fcp_ctm(adapter, unit, tm_flags, 0); - if (!fsf_req) { - zfcp_scsi_dbf_event_devreset("nres", tm_flags, unit, scpnt); - return FAILED; + while (retry--) { + fsf_req = zfcp_fsf_send_fcp_ctm(unit, tm_flags); + if (fsf_req) + break; + + zfcp_erp_wait(adapter); + if (!(atomic_read(&adapter->status) & + ZFCP_STATUS_COMMON_RUNNING)) { + zfcp_scsi_dbf_event_devreset("nres", tm_flags, unit, + scpnt); + return SUCCESS; + } } + if (!fsf_req) + return FAILED; - __wait_event(fsf_req->completion_wq, - fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); + wait_event(fsf_req->completion_wq, + fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); - /* - * check completion status of task management function - */ if (fsf_req->status & ZFCP_STATUS_FSFREQ_TMFUNCFAILED) { zfcp_scsi_dbf_event_devreset("fail", tm_flags, unit, scpnt); retval = FAILED; @@ -228,39 +239,24 @@ static int zfcp_task_mgmt_function(struc zfcp_scsi_dbf_event_devreset("okay", tm_flags, unit, scpnt); zfcp_fsf_req_free(fsf_req); - return retval; } static int zfcp_scsi_eh_device_reset_handler(struct scsi_cmnd *scpnt) { - struct zfcp_unit *unit = scpnt->device->hostdata; - - if (!unit) { - WARN_ON(1); - return SUCCESS; - } - return zfcp_task_mgmt_function(unit, FCP_LOGICAL_UNIT_RESET, scpnt); + return zfcp_task_mgmt_function(scpnt, FCP_LOGICAL_UNIT_RESET); } static int zfcp_scsi_eh_target_reset_handler(struct scsi_cmnd *scpnt) { - struct zfcp_unit *unit = scpnt->device->hostdata; - - if (!unit) { - WARN_ON(1); - return SUCCESS; - } - return zfcp_task_mgmt_function(unit, FCP_TARGET_RESET, scpnt); + return zfcp_task_mgmt_function(scpnt, FCP_TARGET_RESET); } static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt) { - struct zfcp_unit *unit; - struct zfcp_adapter *adapter; + struct zfcp_unit *unit = scpnt->device->hostdata; + struct zfcp_adapter *adapter = unit->port->adapter; - unit = scpnt->device->hostdata; - adapter = unit->port->adapter; zfcp_erp_adapter_reopen(adapter, 0, 141, scpnt); zfcp_erp_wait(adapter); ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 08/18] [PATCH] zfcp: Send ELS ADISC from workqueue 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt ` (6 preceding siblings ...) 2009-03-02 12:09 ` [patch 07/18] [PATCH] zfcp: Improve reliability of SCSI eh handlers in zfcp Christof Schmitt @ 2009-03-02 12:09 ` Christof Schmitt 2009-03-02 12:09 ` [patch 09/18] [PATCH] zfcp: remove undefined subtype for status read response Christof Schmitt ` (9 subsequent siblings) 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:09 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: 707-zfcp-els-adisc.diff --] [-- Type: text/plain, Size: 5180 bytes --] From: Christof Schmitt <christof.schmitt@de.ibm.com> Issue ELS ADISC requests from workqueue. This allows the link test request to be sent when the request queue is full due to I/O load for other remote ports. It also simplifies request queue locking, zfcp_fsf_send_fcp_command_task is now the only function that has interrupts disabled from the caller. This is also a prereq for the FC passthrough support that issues ELS requests from userspace. Acked-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_aux.c | 1 + drivers/s390/scsi/zfcp_def.h | 1 + drivers/s390/scsi/zfcp_ext.h | 1 + drivers/s390/scsi/zfcp_fc.c | 28 ++++++++++++++++++---------- drivers/s390/scsi/zfcp_fsf.c | 18 ++++++------------ 5 files changed, 27 insertions(+), 22 deletions(-) --- a/drivers/s390/scsi/zfcp_aux.c 2009-03-02 12:42:24.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_aux.c 2009-03-02 12:42:33.000000000 +0100 @@ -604,6 +604,7 @@ struct zfcp_port *zfcp_port_enqueue(stru init_waitqueue_head(&port->remove_wq); INIT_LIST_HEAD(&port->unit_list_head); INIT_WORK(&port->gid_pn_work, zfcp_erp_port_strategy_open_lookup); + INIT_WORK(&port->test_link_work, zfcp_fc_link_test_work); port->adapter = adapter; port->d_id = d_id; --- a/drivers/s390/scsi/zfcp_def.h 2009-03-02 12:42:30.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_def.h 2009-03-02 12:42:33.000000000 +0100 @@ -513,6 +513,7 @@ struct zfcp_port { u32 maxframe_size; u32 supported_classes; struct work_struct gid_pn_work; + struct work_struct test_link_work; }; struct zfcp_unit { --- a/drivers/s390/scsi/zfcp_ext.h 2009-03-02 12:42:30.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_ext.h 2009-03-02 12:42:33.000000000 +0100 @@ -101,6 +101,7 @@ extern void zfcp_fc_incoming_els(struct extern int zfcp_fc_ns_gid_pn(struct zfcp_erp_action *); extern void zfcp_fc_plogi_evaluate(struct zfcp_port *, struct fsf_plogi *); extern void zfcp_test_link(struct zfcp_port *); +extern void zfcp_fc_link_test_work(struct work_struct *); extern void zfcp_fc_nameserver_init(struct zfcp_adapter *); /* zfcp_fsf.c */ --- a/drivers/s390/scsi/zfcp_fc.c 2009-03-02 12:42:22.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_fc.c 2009-03-02 12:42:33.000000000 +0100 @@ -421,19 +421,12 @@ static int zfcp_fc_adisc(struct zfcp_por return zfcp_fsf_send_els(&adisc->els); } -/** - * zfcp_test_link - lightweight link test procedure - * @port: port to be tested - * - * Test status of a link to a remote port using the ELS command ADISC. - * If there is a problem with the remote port, error recovery steps - * will be triggered. - */ -void zfcp_test_link(struct zfcp_port *port) +void zfcp_fc_link_test_work(struct work_struct *work) { + struct zfcp_port *port = + container_of(work, struct zfcp_port, test_link_work); int retval; - zfcp_port_get(port); retval = zfcp_fc_adisc(port); if (retval == 0) return; @@ -444,6 +437,21 @@ void zfcp_test_link(struct zfcp_port *po zfcp_erp_port_forced_reopen(port, 0, 65, NULL); } +/** + * zfcp_test_link - lightweight link test procedure + * @port: port to be tested + * + * Test status of a link to a remote port using the ELS command ADISC. + * If there is a problem with the remote port, error recovery steps + * will be triggered. + */ +void zfcp_test_link(struct zfcp_port *port) +{ + zfcp_port_get(port); + if (!queue_work(zfcp_data.work_queue, &port->test_link_work)) + zfcp_port_put(port); +} + static void zfcp_free_sg_env(struct zfcp_gpn_ft *gpn_ft, int buf_num) { struct scatterlist *sg = &gpn_ft->sg_req; --- a/drivers/s390/scsi/zfcp_fsf.c 2009-03-02 12:42:30.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_fsf.c 2009-03-02 12:42:33.000000000 +0100 @@ -647,14 +647,6 @@ static void zfcp_fsf_exchange_port_data_ } } -static int zfcp_fsf_sbal_available(struct zfcp_adapter *adapter) -{ - if (atomic_read(&adapter->req_q.count) > 0) - return 1; - atomic_inc(&adapter->qdio_outb_full); - return 0; -} - static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter) __releases(&adapter->req_q_lock) __acquires(&adapter->req_q_lock) @@ -1177,8 +1169,8 @@ int zfcp_fsf_send_els(struct zfcp_send_e ZFCP_STATUS_COMMON_UNBLOCKED))) return -EBUSY; - spin_lock(&adapter->req_q_lock); - if (!zfcp_fsf_sbal_available(adapter)) + spin_lock_bh(&adapter->req_q_lock); + if (zfcp_fsf_req_sbal_get(adapter)) goto out; req = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_ELS, ZFCP_REQ_AUTO_CLEANUP, NULL); @@ -1211,7 +1203,7 @@ int zfcp_fsf_send_els(struct zfcp_send_e failed_send: zfcp_fsf_req_free(req); out: - spin_unlock(&adapter->req_q_lock); + spin_unlock_bh(&adapter->req_q_lock); return ret; } @@ -2325,8 +2317,10 @@ int zfcp_fsf_send_fcp_command_task(struc return -EBUSY; spin_lock(&adapter->req_q_lock); - if (!zfcp_fsf_sbal_available(adapter)) + if (atomic_read(&adapter->req_q.count) <= 0) { + atomic_inc(&adapter->qdio_outb_full); goto out; + } req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, ZFCP_REQ_AUTO_CLEANUP, adapter->pool.fsf_req_scsi); ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 09/18] [PATCH] zfcp: remove undefined subtype for status read response 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt ` (7 preceding siblings ...) 2009-03-02 12:09 ` [patch 08/18] [PATCH] zfcp: Send ELS ADISC from workqueue Christof Schmitt @ 2009-03-02 12:09 ` Christof Schmitt 2009-03-02 12:09 ` [patch 10/18] [PATCH] zfcp: prevent adapter close on initial adapter open Christof Schmitt ` (8 subsequent siblings) 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:09 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: 708-zfcp-subtype.diff --] [-- Type: text/plain, Size: 2631 bytes --] From: Swen Schillig <swen@vnet.ibm.com> The status read response FSF_STATUS_READ_SUB_ERROR_PORT is not defined in the specs and therefore not valid. All occurrences are removed from the code. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_dbf.c | 2 +- drivers/s390/scsi/zfcp_fsf.c | 9 +-------- drivers/s390/scsi/zfcp_fsf.h | 4 ---- 3 files changed, 2 insertions(+), 13 deletions(-) diff -urpN linux-2.6/drivers/s390/scsi/zfcp_dbf.c linux-2.6-patched/drivers/s390/scsi/zfcp_dbf.c --- linux-2.6/drivers/s390/scsi/zfcp_dbf.c 2009-03-01 16:41:01.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_dbf.c 2009-03-01 16:41:32.000000000 +0100 @@ -615,7 +615,7 @@ static const char *zfcp_rec_dbf_ids[] = [119] = "unknown protocol status", [120] = "unknown fsf command", [121] = "no recommendation for status qualifier", - [122] = "status read physical port closed in error", + [122] = "", [123] = "fc service class not supported", [124] = "", [125] = "need newer zfcp", diff -urpN linux-2.6/drivers/s390/scsi/zfcp_fsf.c linux-2.6-patched/drivers/s390/scsi/zfcp_fsf.c --- linux-2.6/drivers/s390/scsi/zfcp_fsf.c 2009-03-01 16:41:32.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_fsf.c 2009-03-01 16:41:32.000000000 +0100 @@ -162,14 +162,7 @@ static void zfcp_fsf_status_read_port_cl list_for_each_entry(port, &adapter->port_list_head, list) if (port->d_id == d_id) { read_unlock_irqrestore(&zfcp_data.config_lock, flags); - switch (sr_buf->status_subtype) { - case FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT: - zfcp_erp_port_reopen(port, 0, 101, req); - break; - case FSF_STATUS_READ_SUB_ERROR_PORT: - zfcp_erp_port_shutdown(port, 0, 122, req); - break; - } + zfcp_erp_port_reopen(port, 0, 101, req); return; } read_unlock_irqrestore(&zfcp_data.config_lock, flags); diff -urpN linux-2.6/drivers/s390/scsi/zfcp_fsf.h linux-2.6-patched/drivers/s390/scsi/zfcp_fsf.h --- linux-2.6/drivers/s390/scsi/zfcp_fsf.h 2009-03-01 16:41:01.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_fsf.h 2009-03-01 16:41:32.000000000 +0100 @@ -127,10 +127,6 @@ #define FSF_STATUS_READ_CFDC_UPDATED 0x0000000A #define FSF_STATUS_READ_FEATURE_UPDATE_ALERT 0x0000000C -/* status subtypes in status read buffer */ -#define FSF_STATUS_READ_SUB_CLOSE_PHYS_PORT 0x00000001 -#define FSF_STATUS_READ_SUB_ERROR_PORT 0x00000002 - /* status subtypes for link down */ #define FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK 0x00000000 #define FSF_STATUS_READ_SUB_FDISC_FAILED 0x00000001 ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 10/18] [PATCH] zfcp: prevent adapter close on initial adapter open 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt ` (8 preceding siblings ...) 2009-03-02 12:09 ` [patch 09/18] [PATCH] zfcp: remove undefined subtype for status read response Christof Schmitt @ 2009-03-02 12:09 ` Christof Schmitt 2009-03-02 12:09 ` [patch 11/18] [PATCH] zfcp: replace current ERP logging with a more convenient version Christof Schmitt ` (7 subsequent siblings) 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:09 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: 709-zfcp-adapter-close.diff --] [-- Type: text/plain, Size: 3539 bytes --] From: Swen Schillig <swen@vnet.ibm.com> An adapter close was always performed whether it was required, (e.g. in an error scenario) or not (e.g. initial open). This patch is changing the process in only doing an adapter close when it is required. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_erp.c | 69 +++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff -urpN linux-2.6/drivers/s390/scsi/zfcp_erp.c linux-2.6-patched/drivers/s390/scsi/zfcp_erp.c --- linux-2.6/drivers/s390/scsi/zfcp_erp.c 2009-03-01 16:41:30.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_erp.c 2009-03-01 16:41:33.000000000 +0100 @@ -705,32 +705,10 @@ static int zfcp_erp_adapter_strategy_ope return ZFCP_ERP_SUCCEEDED; } -static int zfcp_erp_adapter_strategy_generic(struct zfcp_erp_action *act, - int close) +static void zfcp_erp_adapter_strategy_close(struct zfcp_erp_action *act) { - int retval = ZFCP_ERP_SUCCEEDED; struct zfcp_adapter *adapter = act->adapter; - if (close) - goto close_only; - - retval = zfcp_erp_adapter_strategy_open_qdio(act); - if (retval != ZFCP_ERP_SUCCEEDED) - goto failed_qdio; - - retval = zfcp_erp_adapter_strategy_open_fsf(act); - if (retval != ZFCP_ERP_SUCCEEDED) - goto failed_openfcp; - - atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &act->adapter->status); - - return ZFCP_ERP_SUCCEEDED; - - close_only: - atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN, - &act->adapter->status); - - failed_openfcp: /* close queues to ensure that buffers are not accessed by adapter */ zfcp_qdio_close(adapter); zfcp_fsf_req_dismiss_all(adapter); @@ -738,27 +716,48 @@ static int zfcp_erp_adapter_strategy_gen /* all ports and units are closed */ zfcp_erp_modify_adapter_status(adapter, 24, NULL, ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); - failed_qdio: + atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK | - ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, - &act->adapter->status); - return retval; + ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status); } -static int zfcp_erp_adapter_strategy(struct zfcp_erp_action *act) +static int zfcp_erp_adapter_strategy_open(struct zfcp_erp_action *act) { - int retval; + struct zfcp_adapter *adapter = act->adapter; - zfcp_erp_adapter_strategy_generic(act, 1); /* close */ - if (act->status & ZFCP_STATUS_ERP_CLOSE_ONLY) - return ZFCP_ERP_EXIT; + if (zfcp_erp_adapter_strategy_open_qdio(act)) { + atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK | + ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, + &adapter->status); + return ZFCP_ERP_FAILED; + } - retval = zfcp_erp_adapter_strategy_generic(act, 0); /* open */ + if (zfcp_erp_adapter_strategy_open_fsf(act)) { + zfcp_erp_adapter_strategy_close(act); + return ZFCP_ERP_FAILED; + } - if (retval == ZFCP_ERP_FAILED) + atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &adapter->status); + + return ZFCP_ERP_SUCCEEDED; +} + +static int zfcp_erp_adapter_strategy(struct zfcp_erp_action *act) +{ + struct zfcp_adapter *adapter = act->adapter; + + if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_OPEN) { + zfcp_erp_adapter_strategy_close(act); + if (act->status & ZFCP_STATUS_ERP_CLOSE_ONLY) + return ZFCP_ERP_EXIT; + } + + if (zfcp_erp_adapter_strategy_open(act)) { ssleep(8); + return ZFCP_ERP_FAILED; + } - return retval; + return ZFCP_ERP_SUCCEEDED; } static int zfcp_erp_port_forced_strategy_close(struct zfcp_erp_action *act) ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 11/18] [PATCH] zfcp: replace current ERP logging with a more convenient version 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt ` (9 preceding siblings ...) 2009-03-02 12:09 ` [patch 10/18] [PATCH] zfcp: prevent adapter close on initial adapter open Christof Schmitt @ 2009-03-02 12:09 ` Christof Schmitt 2009-03-02 12:09 ` [patch 12/18] [PATCH] zfcp: Remove PCI flag Christof Schmitt ` (6 subsequent siblings) 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:09 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: 711-zfcp-erplog.diff --] [-- Type: text/plain, Size: 63378 bytes --] From: Swen Schillig <swen@vnet.ibm.com> The current number based id ERP logging is replaced by a string based tag version. The benefit is an easier location of the code in question and the removal of the lengthy array referencing the individual messages. The string (7 bytes) based version does not use more space since those bytes were "used" anyway due to the alignment of the structure. The encoding of the 7 byte string is as follows [0-1] = filename [2-5] = task/function [6] = section Due to the character of this string (fixed length) a string termination is not required here. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_aux.c | 3 drivers/s390/scsi/zfcp_ccw.c | 18 +-- drivers/s390/scsi/zfcp_dbf.c | 188 +++-------------------------------------- drivers/s390/scsi/zfcp_dbf.h | 3 drivers/s390/scsi/zfcp_erp.c | 137 +++++++++++++++-------------- drivers/s390/scsi/zfcp_ext.h | 55 ++++++----- drivers/s390/scsi/zfcp_fc.c | 14 +-- drivers/s390/scsi/zfcp_fsf.c | 131 ++++++++++++++-------------- drivers/s390/scsi/zfcp_qdio.c | 6 - drivers/s390/scsi/zfcp_scsi.c | 4 drivers/s390/scsi/zfcp_sysfs.c | 12 +- 11 files changed, 215 insertions(+), 356 deletions(-) --- a/drivers/s390/scsi/zfcp_aux.c 2009-03-02 12:42:33.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_aux.c 2009-03-02 12:42:38.000000000 +0100 @@ -421,7 +421,8 @@ int zfcp_status_read_refill(struct zfcp_ while (atomic_read(&adapter->stat_miss) > 0) if (zfcp_fsf_status_read(adapter)) { if (atomic_read(&adapter->stat_miss) >= 16) { - zfcp_erp_adapter_reopen(adapter, 0, 103, NULL); + zfcp_erp_adapter_reopen(adapter, 0, "axsref1", + NULL); return 1; } break; --- a/drivers/s390/scsi/zfcp_ccw.c 2009-03-02 12:42:23.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_ccw.c 2009-03-02 12:42:38.000000000 +0100 @@ -109,10 +109,10 @@ static int zfcp_ccw_set_online(struct cc BUG_ON(!zfcp_reqlist_isempty(adapter)); adapter->req_no = 0; - zfcp_erp_modify_adapter_status(adapter, 10, NULL, + zfcp_erp_modify_adapter_status(adapter, "ccsonl1", NULL, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); - zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 85, - NULL); + zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, + "ccsonl2", NULL); zfcp_erp_wait(adapter); up(&zfcp_data.config_sema); flush_work(&adapter->scan_work); @@ -136,7 +136,7 @@ static int zfcp_ccw_set_offline(struct c down(&zfcp_data.config_sema); adapter = dev_get_drvdata(&ccw_device->dev); - zfcp_erp_adapter_shutdown(adapter, 0, 86, NULL); + zfcp_erp_adapter_shutdown(adapter, 0, "ccsoff1", NULL); zfcp_erp_wait(adapter); zfcp_erp_thread_kill(adapter); up(&zfcp_data.config_sema); @@ -159,21 +159,21 @@ static int zfcp_ccw_notify(struct ccw_de case CIO_GONE: dev_warn(&adapter->ccw_device->dev, "The FCP device has been detached\n"); - zfcp_erp_adapter_shutdown(adapter, 0, 87, NULL); + zfcp_erp_adapter_shutdown(adapter, 0, "ccnoti1", NULL); break; case CIO_NO_PATH: dev_warn(&adapter->ccw_device->dev, "The CHPID for the FCP device is offline\n"); - zfcp_erp_adapter_shutdown(adapter, 0, 88, NULL); + zfcp_erp_adapter_shutdown(adapter, 0, "ccnoti2", NULL); break; case CIO_OPER: dev_info(&adapter->ccw_device->dev, "The FCP device is operational again\n"); - zfcp_erp_modify_adapter_status(adapter, 11, NULL, + zfcp_erp_modify_adapter_status(adapter, "ccnoti3", NULL, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, - 89, NULL); + "ccnoti4", NULL); break; } return 1; @@ -189,7 +189,7 @@ static void zfcp_ccw_shutdown(struct ccw down(&zfcp_data.config_sema); adapter = dev_get_drvdata(&cdev->dev); - zfcp_erp_adapter_shutdown(adapter, 0, 90, NULL); + zfcp_erp_adapter_shutdown(adapter, 0, "ccshut1", NULL); zfcp_erp_wait(adapter); up(&zfcp_data.config_sema); } --- a/drivers/s390/scsi/zfcp_dbf.c 2009-03-02 12:42:36.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_dbf.c 2009-03-02 12:42:38.000000000 +0100 @@ -490,172 +490,17 @@ static const char *zfcp_rec_dbf_tags[] = [ZFCP_REC_DBF_ID_ACTION] = "action", }; -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", - [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] = "", - [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", - [56] = "", - [57] = "", - [58] = "", - [59] = "unit access denied", - [60] = "shared unit access denied open unit", - [61] = "", - [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] = "", - [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 wwpn", - [84] = "wka port handle not valid close port", - [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] = "", - [123] = "fc service class not supported", - [124] = "", - [125] = "need newer zfcp", - [126] = "need newer microcode", - [127] = "arbitrated loop not supported", - [128] = "", - [129] = "qtcb size mismatch", - [130] = "unknown fsf status ecd", - [131] = "fcp request too big", - [132] = "", - [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 outbound", - [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", - [147] = "qdio error inbound", - [148] = "nameserver needed for port scan", - [149] = "port scan", - [150] = "ptp attach", - [151] = "port validation failed", -}; - 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; + char hint[ZFCP_DBF_ID_SIZE + 1]; + memcpy(hint, r->id2, ZFCP_DBF_ID_SIZE); + hint[ZFCP_DBF_ID_SIZE] = 0; 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); + zfcp_dbf_outs(&p, "hint", hint); switch (r->id) { case ZFCP_REC_DBF_ID_THREAD: zfcp_dbf_out(&p, "total", "%d", r->u.thread.total); @@ -707,7 +552,7 @@ static struct debug_view zfcp_rec_dbf_vi * @adapter: adapter * This function assumes that the caller is holding erp_lock. */ -void zfcp_rec_dbf_event_thread(u8 id2, struct zfcp_adapter *adapter) +void zfcp_rec_dbf_event_thread(char *id2, struct zfcp_adapter *adapter) { struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf; unsigned long flags = 0; @@ -723,7 +568,7 @@ void zfcp_rec_dbf_event_thread(u8 id2, s spin_lock_irqsave(&adapter->rec_dbf_lock, flags); memset(r, 0, sizeof(*r)); r->id = ZFCP_REC_DBF_ID_THREAD; - r->id2 = id2; + memcpy(r->id2, id2, ZFCP_DBF_ID_SIZE); r->u.thread.total = total; r->u.thread.ready = ready; r->u.thread.running = running; @@ -737,7 +582,7 @@ void zfcp_rec_dbf_event_thread(u8 id2, s * @adapter: adapter * This function assumes that the caller does not hold erp_lock. */ -void zfcp_rec_dbf_event_thread_lock(u8 id2, struct zfcp_adapter *adapter) +void zfcp_rec_dbf_event_thread_lock(char *id2, struct zfcp_adapter *adapter) { unsigned long flags; @@ -746,7 +591,7 @@ void zfcp_rec_dbf_event_thread_lock(u8 i read_unlock_irqrestore(&adapter->erp_lock, flags); } -static void zfcp_rec_dbf_event_target(u8 id2, void *ref, +static void zfcp_rec_dbf_event_target(char *id2, void *ref, struct zfcp_adapter *adapter, atomic_t *status, atomic_t *erp_count, u64 wwpn, u32 d_id, u64 fcp_lun) @@ -757,7 +602,7 @@ static void zfcp_rec_dbf_event_target(u8 spin_lock_irqsave(&adapter->rec_dbf_lock, flags); memset(r, 0, sizeof(*r)); r->id = ZFCP_REC_DBF_ID_TARGET; - r->id2 = id2; + memcpy(r->id2, id2, ZFCP_DBF_ID_SIZE); r->u.target.ref = (unsigned long)ref; r->u.target.status = atomic_read(status); r->u.target.wwpn = wwpn; @@ -774,7 +619,8 @@ static void zfcp_rec_dbf_event_target(u8 * @ref: additional reference (e.g. request) * @adapter: adapter */ -void zfcp_rec_dbf_event_adapter(u8 id, void *ref, struct zfcp_adapter *adapter) +void zfcp_rec_dbf_event_adapter(char *id, void *ref, + struct zfcp_adapter *adapter) { zfcp_rec_dbf_event_target(id, ref, adapter, &adapter->status, &adapter->erp_counter, 0, 0, 0); @@ -786,7 +632,7 @@ void zfcp_rec_dbf_event_adapter(u8 id, v * @ref: additional reference (e.g. request) * @port: port */ -void zfcp_rec_dbf_event_port(u8 id, void *ref, struct zfcp_port *port) +void zfcp_rec_dbf_event_port(char *id, void *ref, struct zfcp_port *port) { struct zfcp_adapter *adapter = port->adapter; @@ -801,7 +647,7 @@ void zfcp_rec_dbf_event_port(u8 id, void * @ref: additional reference (e.g. request) * @unit: unit */ -void zfcp_rec_dbf_event_unit(u8 id, void *ref, struct zfcp_unit *unit) +void zfcp_rec_dbf_event_unit(char *id, void *ref, struct zfcp_unit *unit) { struct zfcp_port *port = unit->port; struct zfcp_adapter *adapter = port->adapter; @@ -822,7 +668,7 @@ void zfcp_rec_dbf_event_unit(u8 id, void * @port: port * @unit: unit */ -void zfcp_rec_dbf_event_trigger(u8 id2, void *ref, u8 want, u8 need, +void zfcp_rec_dbf_event_trigger(char *id2, void *ref, u8 want, u8 need, void *action, struct zfcp_adapter *adapter, struct zfcp_port *port, struct zfcp_unit *unit) { @@ -832,7 +678,7 @@ void zfcp_rec_dbf_event_trigger(u8 id2, spin_lock_irqsave(&adapter->rec_dbf_lock, flags); memset(r, 0, sizeof(*r)); r->id = ZFCP_REC_DBF_ID_TRIGGER; - r->id2 = id2; + memcpy(r->id2, id2, ZFCP_DBF_ID_SIZE); r->u.trigger.ref = (unsigned long)ref; r->u.trigger.want = want; r->u.trigger.need = need; @@ -855,7 +701,7 @@ void zfcp_rec_dbf_event_trigger(u8 id2, * @id2: identifier * @erp_action: error recovery action struct pointer */ -void zfcp_rec_dbf_event_action(u8 id2, struct zfcp_erp_action *erp_action) +void zfcp_rec_dbf_event_action(char *id2, struct zfcp_erp_action *erp_action) { struct zfcp_adapter *adapter = erp_action->adapter; struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf; @@ -864,7 +710,7 @@ void zfcp_rec_dbf_event_action(u8 id2, s spin_lock_irqsave(&adapter->rec_dbf_lock, flags); memset(r, 0, sizeof(*r)); r->id = ZFCP_REC_DBF_ID_ACTION; - r->id2 = id2; + memcpy(r->id2, id2, ZFCP_DBF_ID_SIZE); r->u.action.action = (unsigned long)erp_action; r->u.action.status = erp_action->status; r->u.action.step = erp_action->step; --- a/drivers/s390/scsi/zfcp_dbf.h 2009-03-02 12:41:57.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_dbf.h 2009-03-02 12:42:38.000000000 +0100 @@ -25,6 +25,7 @@ #include "zfcp_fsf.h" #define ZFCP_DBF_TAG_SIZE 4 +#define ZFCP_DBF_ID_SIZE 7 struct zfcp_dbf_dump { u8 tag[ZFCP_DBF_TAG_SIZE]; @@ -70,7 +71,7 @@ struct zfcp_rec_dbf_record_action { struct zfcp_rec_dbf_record { u8 id; - u8 id2; + char id2[7]; union { struct zfcp_rec_dbf_record_action action; struct zfcp_rec_dbf_record_thread thread; --- a/drivers/s390/scsi/zfcp_erp.c 2009-03-02 12:42:37.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_erp.c 2009-03-02 12:42:38.000000000 +0100 @@ -55,7 +55,7 @@ enum zfcp_erp_act_result { static void zfcp_erp_adapter_block(struct zfcp_adapter *adapter, int mask) { - zfcp_erp_modify_adapter_status(adapter, 15, NULL, + zfcp_erp_modify_adapter_status(adapter, "erablk1", NULL, ZFCP_STATUS_COMMON_UNBLOCKED | mask, ZFCP_CLEAR); } @@ -75,9 +75,9 @@ static void zfcp_erp_action_ready(struct struct zfcp_adapter *adapter = act->adapter; list_move(&act->list, &act->adapter->erp_ready_head); - zfcp_rec_dbf_event_action(146, act); + zfcp_rec_dbf_event_action("erardy1", act); up(&adapter->erp_ready_sem); - zfcp_rec_dbf_event_thread(2, adapter); + zfcp_rec_dbf_event_thread("erardy2", adapter); } static void zfcp_erp_action_dismiss(struct zfcp_erp_action *act) @@ -208,7 +208,7 @@ static struct zfcp_erp_action *zfcp_erp_ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, struct zfcp_port *port, - struct zfcp_unit *unit, u8 id, void *ref) + struct zfcp_unit *unit, char *id, void *ref) { int retval = 1, need; struct zfcp_erp_action *act = NULL; @@ -228,7 +228,7 @@ static int zfcp_erp_action_enqueue(int w ++adapter->erp_total_count; list_add_tail(&act->list, &adapter->erp_ready_head); up(&adapter->erp_ready_sem); - zfcp_rec_dbf_event_thread(1, adapter); + zfcp_rec_dbf_event_thread("eracte1", adapter); retval = 0; out: zfcp_rec_dbf_event_trigger(id, ref, want, need, act, @@ -237,13 +237,13 @@ static int zfcp_erp_action_enqueue(int w } static int _zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, - int clear_mask, u8 id, void *ref) + int clear_mask, char *id, void *ref) { zfcp_erp_adapter_block(adapter, clear_mask); /* ensure propagation of failed status to new devices */ if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_FAILED) { - zfcp_erp_adapter_failed(adapter, 13, NULL); + zfcp_erp_adapter_failed(adapter, "erareo1", NULL); return -EIO; } return zfcp_erp_action_enqueue(ZFCP_ERP_ACTION_REOPEN_ADAPTER, @@ -258,7 +258,7 @@ static int _zfcp_erp_adapter_reopen(stru * @ref: Reference for debug trace event. */ void zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, int clear, - u8 id, void *ref) + char *id, void *ref) { unsigned long flags; @@ -277,7 +277,7 @@ void zfcp_erp_adapter_reopen(struct zfcp * @ref: Reference for debug trace event. */ void zfcp_erp_adapter_shutdown(struct zfcp_adapter *adapter, int clear, - u8 id, void *ref) + char *id, void *ref) { int flags = ZFCP_STATUS_COMMON_RUNNING | ZFCP_STATUS_COMMON_ERP_FAILED; zfcp_erp_adapter_reopen(adapter, clear | flags, id, ref); @@ -290,7 +290,8 @@ void zfcp_erp_adapter_shutdown(struct zf * @id: Id for debug trace event. * @ref: Reference for debug trace event. */ -void zfcp_erp_port_shutdown(struct zfcp_port *port, int clear, u8 id, void *ref) +void zfcp_erp_port_shutdown(struct zfcp_port *port, int clear, char *id, + void *ref) { int flags = ZFCP_STATUS_COMMON_RUNNING | ZFCP_STATUS_COMMON_ERP_FAILED; zfcp_erp_port_reopen(port, clear | flags, id, ref); @@ -303,7 +304,8 @@ void zfcp_erp_port_shutdown(struct zfcp_ * @id: Id for debug trace event. * @ref: Reference for debug trace event. */ -void zfcp_erp_unit_shutdown(struct zfcp_unit *unit, int clear, u8 id, void *ref) +void zfcp_erp_unit_shutdown(struct zfcp_unit *unit, int clear, char *id, + void *ref) { int flags = ZFCP_STATUS_COMMON_RUNNING | ZFCP_STATUS_COMMON_ERP_FAILED; zfcp_erp_unit_reopen(unit, clear | flags, id, ref); @@ -311,13 +313,13 @@ void zfcp_erp_unit_shutdown(struct zfcp_ static void zfcp_erp_port_block(struct zfcp_port *port, int clear) { - zfcp_erp_modify_port_status(port, 17, NULL, + zfcp_erp_modify_port_status(port, "erpblk1", NULL, ZFCP_STATUS_COMMON_UNBLOCKED | clear, ZFCP_CLEAR); } static void _zfcp_erp_port_forced_reopen(struct zfcp_port *port, - int clear, u8 id, void *ref) + int clear, char *id, void *ref) { zfcp_erp_port_block(port, clear); @@ -334,7 +336,7 @@ static void _zfcp_erp_port_forced_reopen * @id: Id for debug trace event. * @ref: Reference for debug trace event. */ -void zfcp_erp_port_forced_reopen(struct zfcp_port *port, int clear, u8 id, +void zfcp_erp_port_forced_reopen(struct zfcp_port *port, int clear, char *id, void *ref) { unsigned long flags; @@ -347,14 +349,14 @@ void zfcp_erp_port_forced_reopen(struct read_unlock_irqrestore(&zfcp_data.config_lock, flags); } -static int _zfcp_erp_port_reopen(struct zfcp_port *port, int clear, u8 id, +static int _zfcp_erp_port_reopen(struct zfcp_port *port, int clear, char *id, void *ref) { zfcp_erp_port_block(port, clear); if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED) { /* ensure propagation of failed status to new devices */ - zfcp_erp_port_failed(port, 14, NULL); + zfcp_erp_port_failed(port, "erpreo1", NULL); return -EIO; } @@ -369,7 +371,7 @@ static int _zfcp_erp_port_reopen(struct * * Returns 0 if recovery has been triggered, < 0 if not. */ -int zfcp_erp_port_reopen(struct zfcp_port *port, int clear, u8 id, void *ref) +int zfcp_erp_port_reopen(struct zfcp_port *port, int clear, char *id, void *ref) { unsigned long flags; int retval; @@ -386,12 +388,12 @@ int zfcp_erp_port_reopen(struct zfcp_por static void zfcp_erp_unit_block(struct zfcp_unit *unit, int clear_mask) { - zfcp_erp_modify_unit_status(unit, 19, NULL, + zfcp_erp_modify_unit_status(unit, "erublk1", NULL, ZFCP_STATUS_COMMON_UNBLOCKED | clear_mask, ZFCP_CLEAR); } -static void _zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear, u8 id, +static void _zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear, char *id, void *ref) { struct zfcp_adapter *adapter = unit->port->adapter; @@ -411,7 +413,8 @@ static void _zfcp_erp_unit_reopen(struct * @clear_mask: specifies flags in unit status to be cleared * Return: 0 on success, < 0 on error */ -void zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear, u8 id, void *ref) +void zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear, char *id, + void *ref) { unsigned long flags; struct zfcp_port *port = unit->port; @@ -437,28 +440,28 @@ static int status_change_clear(unsigned static void zfcp_erp_adapter_unblock(struct zfcp_adapter *adapter) { if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status)) - zfcp_rec_dbf_event_adapter(16, NULL, adapter); + zfcp_rec_dbf_event_adapter("eraubl1", NULL, adapter); atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &adapter->status); } static void zfcp_erp_port_unblock(struct zfcp_port *port) { if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status)) - zfcp_rec_dbf_event_port(18, NULL, port); + zfcp_rec_dbf_event_port("erpubl1", NULL, port); atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &port->status); } static void zfcp_erp_unit_unblock(struct zfcp_unit *unit) { if (status_change_set(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status)) - zfcp_rec_dbf_event_unit(20, NULL, unit); + zfcp_rec_dbf_event_unit("eruubl1", NULL, unit); atomic_set_mask(ZFCP_STATUS_COMMON_UNBLOCKED, &unit->status); } static void zfcp_erp_action_to_running(struct zfcp_erp_action *erp_action) { list_move(&erp_action->list, &erp_action->adapter->erp_running_head); - zfcp_rec_dbf_event_action(145, erp_action); + zfcp_rec_dbf_event_action("erator1", erp_action); } static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act) @@ -474,11 +477,11 @@ static void zfcp_erp_strategy_check_fsfr if (act->status & (ZFCP_STATUS_ERP_DISMISSED | ZFCP_STATUS_ERP_TIMEDOUT)) { act->fsf_req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; - zfcp_rec_dbf_event_action(142, act); + zfcp_rec_dbf_event_action("erscf_1", act); act->fsf_req->erp_action = NULL; } if (act->status & ZFCP_STATUS_ERP_TIMEDOUT) - zfcp_rec_dbf_event_action(143, act); + zfcp_rec_dbf_event_action("erscf_2", act); if (act->fsf_req->status & (ZFCP_STATUS_FSFREQ_COMPLETED | ZFCP_STATUS_FSFREQ_DISMISSED)) act->fsf_req = NULL; @@ -530,7 +533,7 @@ static void zfcp_erp_strategy_memwait(st } static void _zfcp_erp_port_reopen_all(struct zfcp_adapter *adapter, - int clear, u8 id, void *ref) + int clear, char *id, void *ref) { struct zfcp_port *port; @@ -538,8 +541,8 @@ static void _zfcp_erp_port_reopen_all(st _zfcp_erp_port_reopen(port, clear, id, ref); } -static void _zfcp_erp_unit_reopen_all(struct zfcp_port *port, int clear, u8 id, - void *ref) +static void _zfcp_erp_unit_reopen_all(struct zfcp_port *port, int clear, + char *id, void *ref) { struct zfcp_unit *unit; @@ -559,28 +562,28 @@ static void zfcp_erp_strategy_followup_a case ZFCP_ERP_ACTION_REOPEN_ADAPTER: if (status == ZFCP_ERP_SUCCEEDED) - _zfcp_erp_port_reopen_all(adapter, 0, 70, NULL); + _zfcp_erp_port_reopen_all(adapter, 0, "ersfa_1", NULL); else - _zfcp_erp_adapter_reopen(adapter, 0, 71, NULL); + _zfcp_erp_adapter_reopen(adapter, 0, "ersfa_2", NULL); break; case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: if (status == ZFCP_ERP_SUCCEEDED) - _zfcp_erp_port_reopen(port, 0, 72, NULL); + _zfcp_erp_port_reopen(port, 0, "ersfa_3", NULL); else - _zfcp_erp_adapter_reopen(adapter, 0, 73, NULL); + _zfcp_erp_adapter_reopen(adapter, 0, "ersfa_4", NULL); break; case ZFCP_ERP_ACTION_REOPEN_PORT: if (status == ZFCP_ERP_SUCCEEDED) - _zfcp_erp_unit_reopen_all(port, 0, 74, NULL); + _zfcp_erp_unit_reopen_all(port, 0, "ersfa_5", NULL); else - _zfcp_erp_port_forced_reopen(port, 0, 75, NULL); + _zfcp_erp_port_forced_reopen(port, 0, "ersfa_6", NULL); break; case ZFCP_ERP_ACTION_REOPEN_UNIT: if (status != ZFCP_ERP_SUCCEEDED) - _zfcp_erp_port_reopen(unit->port, 0, 76, NULL); + _zfcp_erp_port_reopen(unit->port, 0, "ersfa_7", NULL); break; } } @@ -617,7 +620,7 @@ static void zfcp_erp_enqueue_ptp_port(st adapter->peer_d_id); if (IS_ERR(port)) /* error or port already attached */ return; - _zfcp_erp_port_reopen(port, 0, 150, NULL); + _zfcp_erp_port_reopen(port, 0, "ereptp1", NULL); } static int zfcp_erp_adapter_strat_fsf_xconf(struct zfcp_erp_action *erp_action) @@ -640,9 +643,9 @@ static int zfcp_erp_adapter_strat_fsf_xc return ZFCP_ERP_FAILED; } - zfcp_rec_dbf_event_thread_lock(6, adapter); + zfcp_rec_dbf_event_thread_lock("erasfx1", adapter); down(&adapter->erp_ready_sem); - zfcp_rec_dbf_event_thread_lock(7, adapter); + zfcp_rec_dbf_event_thread_lock("erasfx2", adapter); if (erp_action->status & ZFCP_STATUS_ERP_TIMEDOUT) break; @@ -681,9 +684,9 @@ static int zfcp_erp_adapter_strategy_ope if (ret) return ZFCP_ERP_FAILED; - zfcp_rec_dbf_event_thread_lock(8, adapter); + zfcp_rec_dbf_event_thread_lock("erasox1", adapter); down(&adapter->erp_ready_sem); - zfcp_rec_dbf_event_thread_lock(9, adapter); + zfcp_rec_dbf_event_thread_lock("erasox2", adapter); if (act->status & ZFCP_STATUS_ERP_TIMEDOUT) return ZFCP_ERP_FAILED; @@ -714,7 +717,7 @@ static void zfcp_erp_adapter_strategy_cl zfcp_fsf_req_dismiss_all(adapter); adapter->fsf_req_seq_no = 0; /* all ports and units are closed */ - zfcp_erp_modify_adapter_status(adapter, 24, NULL, + zfcp_erp_modify_adapter_status(adapter, "erascl1", NULL, ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK | @@ -832,7 +835,7 @@ static int zfcp_erp_open_ptp_port(struct struct zfcp_port *port = act->port; if (port->wwpn != adapter->peer_wwpn) { - zfcp_erp_port_failed(port, 25, NULL); + zfcp_erp_port_failed(port, "eroptp1", NULL); return ZFCP_ERP_FAILED; } port->d_id = adapter->peer_d_id; @@ -986,7 +989,7 @@ static int zfcp_erp_strategy_check_unit( "port 0x%016Lx\n", (unsigned long long)unit->fcp_lun, (unsigned long long)unit->port->wwpn); - zfcp_erp_unit_failed(unit, 21, NULL); + zfcp_erp_unit_failed(unit, "erusck1", NULL); } break; } @@ -1016,7 +1019,7 @@ static int zfcp_erp_strategy_check_port( dev_err(&port->adapter->ccw_device->dev, "ERP failed for remote port 0x%016Lx\n", (unsigned long long)port->wwpn); - zfcp_erp_port_failed(port, 22, NULL); + zfcp_erp_port_failed(port, "erpsck1", NULL); } break; } @@ -1043,7 +1046,7 @@ static int zfcp_erp_strategy_check_adapt dev_err(&adapter->ccw_device->dev, "ERP cannot recover an error " "on the FCP device\n"); - zfcp_erp_adapter_failed(adapter, 23, NULL); + zfcp_erp_adapter_failed(adapter, "erasck1", NULL); } break; } @@ -1108,7 +1111,7 @@ static int zfcp_erp_strategy_statechange if (zfcp_erp_strat_change_det(&adapter->status, erp_status)) { _zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, - 67, NULL); + "ersscg1", NULL); return ZFCP_ERP_EXIT; } break; @@ -1118,7 +1121,7 @@ static int zfcp_erp_strategy_statechange if (zfcp_erp_strat_change_det(&port->status, erp_status)) { _zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, - 68, NULL); + "ersscg2", NULL); return ZFCP_ERP_EXIT; } break; @@ -1127,7 +1130,7 @@ static int zfcp_erp_strategy_statechange if (zfcp_erp_strat_change_det(&unit->status, erp_status)) { _zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED, - 69, NULL); + "ersscg3", NULL); return ZFCP_ERP_EXIT; } break; @@ -1146,7 +1149,7 @@ static void zfcp_erp_action_dequeue(stru } list_del(&erp_action->list); - zfcp_rec_dbf_event_action(144, erp_action); + zfcp_rec_dbf_event_action("eractd1", erp_action); switch (erp_action->action) { case ZFCP_ERP_ACTION_REOPEN_UNIT: @@ -1331,7 +1334,7 @@ static int zfcp_erp_strategy(struct zfcp erp_action->status |= ZFCP_STATUS_ERP_LOWMEM; } if (adapter->erp_total_count == adapter->erp_low_mem_count) - _zfcp_erp_adapter_reopen(adapter, 0, 66, NULL); + _zfcp_erp_adapter_reopen(adapter, 0, "erstgy1", NULL); else { zfcp_erp_strategy_memwait(erp_action); retval = ZFCP_ERP_CONTINUES; @@ -1391,9 +1394,9 @@ static int zfcp_erp_thread(void *data) zfcp_erp_wakeup(adapter); } - zfcp_rec_dbf_event_thread_lock(4, adapter); + zfcp_rec_dbf_event_thread_lock("erthrd1", adapter); ignore = down_interruptible(&adapter->erp_ready_sem); - zfcp_rec_dbf_event_thread_lock(5, adapter); + zfcp_rec_dbf_event_thread_lock("erthrd2", adapter); } atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status); @@ -1438,7 +1441,7 @@ void zfcp_erp_thread_kill(struct zfcp_ad { atomic_set_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_KILL, &adapter->status); up(&adapter->erp_ready_sem); - zfcp_rec_dbf_event_thread_lock(3, adapter); + zfcp_rec_dbf_event_thread_lock("erthrk1", adapter); wait_event(adapter->erp_thread_wqh, !(atomic_read(&adapter->status) & @@ -1454,7 +1457,7 @@ void zfcp_erp_thread_kill(struct zfcp_ad * @id: Event id for debug trace. * @ref: Reference for debug trace. */ -void zfcp_erp_adapter_failed(struct zfcp_adapter *adapter, u8 id, void *ref) +void zfcp_erp_adapter_failed(struct zfcp_adapter *adapter, char *id, void *ref) { zfcp_erp_modify_adapter_status(adapter, id, ref, ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); @@ -1466,7 +1469,7 @@ void zfcp_erp_adapter_failed(struct zfcp * @id: Event id for debug trace. * @ref: Reference for debug trace. */ -void zfcp_erp_port_failed(struct zfcp_port *port, u8 id, void *ref) +void zfcp_erp_port_failed(struct zfcp_port *port, char *id, void *ref) { zfcp_erp_modify_port_status(port, id, ref, ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); @@ -1478,7 +1481,7 @@ void zfcp_erp_port_failed(struct zfcp_po * @id: Event id for debug trace. * @ref: Reference for debug trace. */ -void zfcp_erp_unit_failed(struct zfcp_unit *unit, u8 id, void *ref) +void zfcp_erp_unit_failed(struct zfcp_unit *unit, char *id, void *ref) { zfcp_erp_modify_unit_status(unit, id, ref, ZFCP_STATUS_COMMON_ERP_FAILED, ZFCP_SET); @@ -1505,7 +1508,7 @@ void zfcp_erp_wait(struct zfcp_adapter * * * Changes in common status bits are propagated to attached ports and units. */ -void zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, u8 id, +void zfcp_erp_modify_adapter_status(struct zfcp_adapter *adapter, char *id, void *ref, u32 mask, int set_or_clear) { struct zfcp_port *port; @@ -1539,7 +1542,7 @@ void zfcp_erp_modify_adapter_status(stru * * Changes in common status bits are propagated to attached units. */ -void zfcp_erp_modify_port_status(struct zfcp_port *port, u8 id, void *ref, +void zfcp_erp_modify_port_status(struct zfcp_port *port, char *id, void *ref, u32 mask, int set_or_clear) { struct zfcp_unit *unit; @@ -1571,7 +1574,7 @@ void zfcp_erp_modify_port_status(struct * @mask: status bits to change * @set_or_clear: ZFCP_SET or ZFCP_CLEAR */ -void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, u8 id, void *ref, +void zfcp_erp_modify_unit_status(struct zfcp_unit *unit, char *id, void *ref, u32 mask, int set_or_clear) { if (set_or_clear == ZFCP_SET) { @@ -1594,7 +1597,7 @@ void zfcp_erp_modify_unit_status(struct * @id: The debug trace id. * @id: Reference for the debug trace. */ -void zfcp_erp_port_boxed(struct zfcp_port *port, u8 id, void *ref) +void zfcp_erp_port_boxed(struct zfcp_port *port, char *id, void *ref) { unsigned long flags; @@ -1611,7 +1614,7 @@ void zfcp_erp_port_boxed(struct zfcp_por * @id: The debug trace id. * @id: Reference for the debug trace. */ -void zfcp_erp_unit_boxed(struct zfcp_unit *unit, u8 id, void *ref) +void zfcp_erp_unit_boxed(struct zfcp_unit *unit, char *id, void *ref) { zfcp_erp_modify_unit_status(unit, id, ref, ZFCP_STATUS_COMMON_ACCESS_BOXED, ZFCP_SET); @@ -1627,7 +1630,7 @@ void zfcp_erp_unit_boxed(struct zfcp_uni * Since the adapter has denied access, stop using the port and the * attached units. */ -void zfcp_erp_port_access_denied(struct zfcp_port *port, u8 id, void *ref) +void zfcp_erp_port_access_denied(struct zfcp_port *port, char *id, void *ref) { unsigned long flags; @@ -1646,14 +1649,14 @@ void zfcp_erp_port_access_denied(struct * * Since the adapter has denied access, stop using the unit. */ -void zfcp_erp_unit_access_denied(struct zfcp_unit *unit, u8 id, void *ref) +void zfcp_erp_unit_access_denied(struct zfcp_unit *unit, char *id, void *ref) { zfcp_erp_modify_unit_status(unit, id, ref, ZFCP_STATUS_COMMON_ERP_FAILED | ZFCP_STATUS_COMMON_ACCESS_DENIED, ZFCP_SET); } -static void zfcp_erp_unit_access_changed(struct zfcp_unit *unit, u8 id, +static void zfcp_erp_unit_access_changed(struct zfcp_unit *unit, char *id, void *ref) { int status = atomic_read(&unit->status); @@ -1664,7 +1667,7 @@ static void zfcp_erp_unit_access_changed zfcp_erp_unit_reopen(unit, ZFCP_STATUS_COMMON_ERP_FAILED, id, ref); } -static void zfcp_erp_port_access_changed(struct zfcp_port *port, u8 id, +static void zfcp_erp_port_access_changed(struct zfcp_port *port, char *id, void *ref) { struct zfcp_unit *unit; @@ -1686,7 +1689,7 @@ static void zfcp_erp_port_access_changed * @id: Id for debug trace * @ref: Reference for debug trace */ -void zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter, u8 id, +void zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter, char *id, void *ref) { struct zfcp_port *port; --- a/drivers/s390/scsi/zfcp_ext.h 2009-03-02 12:42:33.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_ext.h 2009-03-02 12:42:38.000000000 +0100 @@ -35,15 +35,15 @@ extern struct miscdevice zfcp_cfdc_misc; /* zfcp_dbf.c */ extern int zfcp_adapter_debug_register(struct zfcp_adapter *); extern void zfcp_adapter_debug_unregister(struct zfcp_adapter *); -extern void zfcp_rec_dbf_event_thread(u8, struct zfcp_adapter *); -extern void zfcp_rec_dbf_event_thread_lock(u8, struct zfcp_adapter *); -extern void zfcp_rec_dbf_event_adapter(u8, void *, struct zfcp_adapter *); -extern void zfcp_rec_dbf_event_port(u8, void *, struct zfcp_port *); -extern void zfcp_rec_dbf_event_unit(u8, void *, struct zfcp_unit *); -extern void zfcp_rec_dbf_event_trigger(u8, void *, u8, u8, void *, +extern void zfcp_rec_dbf_event_thread(char *, struct zfcp_adapter *); +extern void zfcp_rec_dbf_event_thread_lock(char *, struct zfcp_adapter *); +extern void zfcp_rec_dbf_event_adapter(char *, void *, struct zfcp_adapter *); +extern void zfcp_rec_dbf_event_port(char *, void *, struct zfcp_port *); +extern void zfcp_rec_dbf_event_unit(char *, void *, struct zfcp_unit *); +extern void zfcp_rec_dbf_event_trigger(char *, void *, u8, u8, void *, struct zfcp_adapter *, struct zfcp_port *, struct zfcp_unit *); -extern void zfcp_rec_dbf_event_action(u8, struct zfcp_erp_action *); +extern void zfcp_rec_dbf_event_action(char *, 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 *, struct fsf_status_read_buffer *); @@ -66,31 +66,34 @@ extern void zfcp_scsi_dbf_event_devreset struct scsi_cmnd *); /* zfcp_erp.c */ -extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, u8, void *, - u32, int); -extern void zfcp_erp_adapter_reopen(struct zfcp_adapter *, int, u8, void *); -extern void 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, +extern void zfcp_erp_modify_adapter_status(struct zfcp_adapter *, char *, + void *, u32, int); +extern void zfcp_erp_adapter_reopen(struct zfcp_adapter *, int, char *, void *); +extern void zfcp_erp_adapter_shutdown(struct zfcp_adapter *, int, char *, + void *); +extern void zfcp_erp_adapter_failed(struct zfcp_adapter *, char *, void *); +extern void zfcp_erp_modify_port_status(struct zfcp_port *, char *, void *, u32, int); -extern int zfcp_erp_port_reopen(struct zfcp_port *, int, u8, void *); -extern void zfcp_erp_port_shutdown(struct zfcp_port *, int, u8, void *); -extern void zfcp_erp_port_forced_reopen(struct zfcp_port *, int, u8, void *); -extern void zfcp_erp_port_failed(struct zfcp_port *, u8, void *); -extern void zfcp_erp_modify_unit_status(struct zfcp_unit *, u8, void *, u32, +extern int zfcp_erp_port_reopen(struct zfcp_port *, int, char *, void *); +extern void zfcp_erp_port_shutdown(struct zfcp_port *, int, char *, void *); +extern void zfcp_erp_port_forced_reopen(struct zfcp_port *, int, char *, + void *); +extern void zfcp_erp_port_failed(struct zfcp_port *, char *, void *); +extern void zfcp_erp_modify_unit_status(struct zfcp_unit *, char *, void *, u32, int); -extern void zfcp_erp_unit_reopen(struct zfcp_unit *, int, u8, void *); -extern void zfcp_erp_unit_shutdown(struct zfcp_unit *, int, u8, void *); -extern void zfcp_erp_unit_failed(struct zfcp_unit *, u8, void *); +extern void zfcp_erp_unit_reopen(struct zfcp_unit *, int, char *, void *); +extern void zfcp_erp_unit_shutdown(struct zfcp_unit *, int, char *, void *); +extern void zfcp_erp_unit_failed(struct zfcp_unit *, char *, void *); extern int zfcp_erp_thread_setup(struct zfcp_adapter *); extern void zfcp_erp_thread_kill(struct zfcp_adapter *); extern void zfcp_erp_wait(struct zfcp_adapter *); extern void zfcp_erp_notify(struct zfcp_erp_action *, unsigned long); -extern void zfcp_erp_port_boxed(struct zfcp_port *, u8, void *); -extern void zfcp_erp_unit_boxed(struct zfcp_unit *, u8, void *); -extern void zfcp_erp_port_access_denied(struct zfcp_port *, u8, void *); -extern void zfcp_erp_unit_access_denied(struct zfcp_unit *, u8, void *); -extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *, u8, void *); +extern void zfcp_erp_port_boxed(struct zfcp_port *, char *, void *); +extern void zfcp_erp_unit_boxed(struct zfcp_unit *, char *, void *); +extern void zfcp_erp_port_access_denied(struct zfcp_port *, char *, void *); +extern void zfcp_erp_unit_access_denied(struct zfcp_unit *, char *, void *); +extern void zfcp_erp_adapter_access_changed(struct zfcp_adapter *, char *, + void *); extern void zfcp_erp_timeout_handler(unsigned long); extern void zfcp_erp_port_strategy_open_lookup(struct work_struct *); --- a/drivers/s390/scsi/zfcp_fc.c 2009-03-02 12:42:33.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_fc.c 2009-03-02 12:42:38.000000000 +0100 @@ -150,7 +150,7 @@ static void _zfcp_fc_incoming_rscn(struc /* Try to connect to unused ports anyway. */ zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, - 82, fsf_req); + "fcirsc1", fsf_req); else if ((port->d_id & range) == (elem->nport_did & range)) /* Check connection status for connected ports */ zfcp_test_link(port); @@ -196,7 +196,7 @@ static void zfcp_fc_incoming_wwpn(struct read_unlock_irqrestore(&zfcp_data.config_lock, flags); if (port && (port->wwpn == wwpn)) - zfcp_erp_port_forced_reopen(port, 0, 83, req); + zfcp_erp_port_forced_reopen(port, 0, "fciwwp1", req); } static void zfcp_fc_incoming_plogi(struct zfcp_fsf_req *req) @@ -374,7 +374,7 @@ static void zfcp_fc_adisc_handler(unsign if (adisc->els.status) { /* request rejected or timed out */ - zfcp_erp_port_forced_reopen(port, 0, 63, NULL); + zfcp_erp_port_forced_reopen(port, 0, "fcadh_1", NULL); goto out; } @@ -382,7 +382,7 @@ static void zfcp_fc_adisc_handler(unsign port->wwnn = ls_adisc->wwnn; if (port->wwpn != ls_adisc->wwpn) - zfcp_erp_port_reopen(port, 0, 64, NULL); + zfcp_erp_port_reopen(port, 0, "fcadh_2", NULL); out: zfcp_port_put(port); @@ -434,7 +434,7 @@ void zfcp_fc_link_test_work(struct work_ /* send of ADISC was not possible */ zfcp_port_put(port); if (retval != -EBUSY) - zfcp_erp_port_forced_reopen(port, 0, 65, NULL); + zfcp_erp_port_forced_reopen(port, 0, "fcltwk1", NULL); } /** @@ -536,7 +536,7 @@ static void zfcp_validate_port(struct zf zfcp_port_put(port); return; } - zfcp_erp_port_shutdown(port, 0, 151, NULL); + zfcp_erp_port_shutdown(port, 0, "fcpval1", NULL); zfcp_erp_wait(adapter); zfcp_port_put(port); zfcp_port_dequeue(port); @@ -599,7 +599,7 @@ static int zfcp_scan_eval_gpn_ft(struct if (IS_ERR(port)) ret = PTR_ERR(port); else - zfcp_erp_port_reopen(port, 0, 149, NULL); + zfcp_erp_port_reopen(port, 0, "fcegpf1", NULL); } zfcp_erp_wait(adapter); --- a/drivers/s390/scsi/zfcp_fsf.c 2009-03-02 12:42:36.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_fsf.c 2009-03-02 12:42:38.000000000 +0100 @@ -18,8 +18,8 @@ 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, - NULL); + zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, + "fsrth_1", NULL); } static void zfcp_fsf_start_timer(struct zfcp_fsf_req *fsf_req, @@ -78,7 +78,7 @@ static void zfcp_fsf_access_denied_port( (unsigned long long)port->wwpn); zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[0]); zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[1]); - zfcp_erp_port_access_denied(port, 55, req); + zfcp_erp_port_access_denied(port, "fspad_1", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; } @@ -92,7 +92,7 @@ static void zfcp_fsf_access_denied_unit( (unsigned long long)unit->port->wwpn); zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[0]); zfcp_act_eval_err(req->adapter, header->fsf_status_qual.halfword[1]); - zfcp_erp_unit_access_denied(unit, 59, req); + zfcp_erp_unit_access_denied(unit, "fsuad_1", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; } @@ -100,7 +100,7 @@ static void zfcp_fsf_class_not_supp(stru { dev_err(&req->adapter->ccw_device->dev, "FCP device not " "operational because of an unsupported FC class\n"); - zfcp_erp_adapter_shutdown(req->adapter, 0, 123, req); + zfcp_erp_adapter_shutdown(req->adapter, 0, "fscns_1", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; } @@ -162,13 +162,13 @@ static void zfcp_fsf_status_read_port_cl list_for_each_entry(port, &adapter->port_list_head, list) if (port->d_id == d_id) { read_unlock_irqrestore(&zfcp_data.config_lock, flags); - zfcp_erp_port_reopen(port, 0, 101, req); + zfcp_erp_port_reopen(port, 0, "fssrpc1", req); return; } read_unlock_irqrestore(&zfcp_data.config_lock, flags); } -static void zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *req, u8 id, +static void zfcp_fsf_link_down_info_eval(struct zfcp_fsf_req *req, char *id, struct fsf_link_down_info *link_down) { struct zfcp_adapter *adapter = req->adapter; @@ -257,13 +257,13 @@ static void zfcp_fsf_status_read_link_do switch (sr_buf->status_subtype) { case FSF_STATUS_READ_SUB_NO_PHYSICAL_LINK: - zfcp_fsf_link_down_info_eval(req, 38, ldi); + zfcp_fsf_link_down_info_eval(req, "fssrld1", ldi); break; case FSF_STATUS_READ_SUB_FDISC_FAILED: - zfcp_fsf_link_down_info_eval(req, 39, ldi); + zfcp_fsf_link_down_info_eval(req, "fssrld2", ldi); break; case FSF_STATUS_READ_SUB_FIRMWARE_UPDATE: - zfcp_fsf_link_down_info_eval(req, 40, NULL); + zfcp_fsf_link_down_info_eval(req, "fssrld3", NULL); }; } @@ -303,22 +303,23 @@ static void zfcp_fsf_status_read_handler dev_info(&adapter->ccw_device->dev, "The local link has been restored\n"); /* All ports should be marked as ready to run again */ - zfcp_erp_modify_adapter_status(adapter, 30, NULL, + zfcp_erp_modify_adapter_status(adapter, "fssrh_1", NULL, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED | ZFCP_STATUS_COMMON_ERP_FAILED, - 102, req); + "fssrh_2", req); break; case FSF_STATUS_READ_NOTIFICATION_LOST: if (sr_buf->status_subtype & FSF_STATUS_READ_SUB_ACT_UPDATED) - zfcp_erp_adapter_access_changed(adapter, 135, req); + zfcp_erp_adapter_access_changed(adapter, "fssrh_3", + req); if (sr_buf->status_subtype & FSF_STATUS_READ_SUB_INCOMING_ELS) schedule_work(&adapter->scan_work); break; case FSF_STATUS_READ_CFDC_UPDATED: - zfcp_erp_adapter_access_changed(adapter, 136, req); + zfcp_erp_adapter_access_changed(adapter, "fssrh_4", req); break; case FSF_STATUS_READ_FEATURE_UPDATE_ALERT: adapter->adapter_features = sr_buf->payload.word[0]; @@ -347,7 +348,7 @@ static void zfcp_fsf_fsfstatus_qual_eval dev_err(&req->adapter->ccw_device->dev, "The FCP adapter reported a problem " "that cannot be recovered\n"); - zfcp_erp_adapter_shutdown(req->adapter, 0, 121, req); + zfcp_erp_adapter_shutdown(req->adapter, 0, "fsfsqe1", req); break; } /* all non-return stats set FSFREQ_ERROR*/ @@ -364,7 +365,7 @@ static void zfcp_fsf_fsfstatus_eval(stru dev_err(&req->adapter->ccw_device->dev, "The FCP adapter does not recognize the command 0x%x\n", req->qtcb->header.fsf_command); - zfcp_erp_adapter_shutdown(req->adapter, 0, 120, req); + zfcp_erp_adapter_shutdown(req->adapter, 0, "fsfse_1", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_ADAPTER_STATUS_AVAILABLE: @@ -396,17 +397,17 @@ static void zfcp_fsf_protstatus_eval(str "QTCB version 0x%x not supported by FCP adapter " "(0x%x to 0x%x)\n", FSF_QTCB_CURRENT_VERSION, psq->word[0], psq->word[1]); - zfcp_erp_adapter_shutdown(adapter, 0, 117, req); + zfcp_erp_adapter_shutdown(adapter, 0, "fspse_1", req); break; case FSF_PROT_ERROR_STATE: case FSF_PROT_SEQ_NUMB_ERROR: - zfcp_erp_adapter_reopen(adapter, 0, 98, req); + zfcp_erp_adapter_reopen(adapter, 0, "fspse_2", req); req->status |= ZFCP_STATUS_FSFREQ_RETRY; break; case FSF_PROT_UNSUPP_QTCB_TYPE: dev_err(&adapter->ccw_device->dev, "The QTCB type is not supported by the FCP adapter\n"); - zfcp_erp_adapter_shutdown(adapter, 0, 118, req); + zfcp_erp_adapter_shutdown(adapter, 0, "fspse_3", req); break; case FSF_PROT_HOST_CONNECTION_INITIALIZING: atomic_set_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, @@ -416,27 +417,29 @@ static void zfcp_fsf_protstatus_eval(str dev_err(&adapter->ccw_device->dev, "0x%Lx is an ambiguous request identifier\n", (unsigned long long)qtcb->bottom.support.req_handle); - zfcp_erp_adapter_shutdown(adapter, 0, 78, req); + zfcp_erp_adapter_shutdown(adapter, 0, "fspse_4", req); break; case FSF_PROT_LINK_DOWN: - zfcp_fsf_link_down_info_eval(req, 37, &psq->link_down_info); + zfcp_fsf_link_down_info_eval(req, "fspse_5", + &psq->link_down_info); /* FIXME: reopening adapter now? better wait for link up */ - zfcp_erp_adapter_reopen(adapter, 0, 79, req); + zfcp_erp_adapter_reopen(adapter, 0, "fspse_6", req); break; case FSF_PROT_REEST_QUEUE: /* All ports should be marked as ready to run again */ - zfcp_erp_modify_adapter_status(adapter, 28, NULL, + zfcp_erp_modify_adapter_status(adapter, "fspse_7", NULL, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED | - ZFCP_STATUS_COMMON_ERP_FAILED, 99, req); + ZFCP_STATUS_COMMON_ERP_FAILED, + "fspse_8", req); break; default: dev_err(&adapter->ccw_device->dev, "0x%x is not a valid transfer protocol status\n", qtcb->prefix.prot_status); - zfcp_erp_adapter_shutdown(adapter, 0, 119, req); + zfcp_erp_adapter_shutdown(adapter, 0, "fspse_9", req); } req->status |= ZFCP_STATUS_FSFREQ_ERROR; } @@ -522,7 +525,7 @@ static int zfcp_fsf_exchange_config_eval dev_err(&adapter->ccw_device->dev, "Unknown or unsupported arbitrated loop " "fibre channel topology detected\n"); - zfcp_erp_adapter_shutdown(adapter, 0, 127, req); + zfcp_erp_adapter_shutdown(adapter, 0, "fsece_1", req); return -EIO; } @@ -556,7 +559,7 @@ static void zfcp_fsf_exchange_config_dat "FCP adapter maximum QTCB size (%d bytes) " "is too small\n", bottom->max_qtcb_size); - zfcp_erp_adapter_shutdown(adapter, 0, 129, req); + zfcp_erp_adapter_shutdown(adapter, 0, "fsecdh1", req); return; } atomic_set_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, @@ -573,11 +576,11 @@ static void zfcp_fsf_exchange_config_dat atomic_set_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, &adapter->status); - zfcp_fsf_link_down_info_eval(req, 42, + zfcp_fsf_link_down_info_eval(req, "fsecdh2", &qtcb->header.fsf_status_qual.link_down_info); break; default: - zfcp_erp_adapter_shutdown(adapter, 0, 130, req); + zfcp_erp_adapter_shutdown(adapter, 0, "fsecdh3", req); return; } @@ -593,14 +596,14 @@ static void zfcp_fsf_exchange_config_dat dev_err(&adapter->ccw_device->dev, "The FCP adapter only supports newer " "control block versions\n"); - zfcp_erp_adapter_shutdown(adapter, 0, 125, req); + zfcp_erp_adapter_shutdown(adapter, 0, "fsecdh4", req); return; } if (FSF_QTCB_CURRENT_VERSION > bottom->high_qtcb_version) { dev_err(&adapter->ccw_device->dev, "The FCP adapter only supports older " "control block versions\n"); - zfcp_erp_adapter_shutdown(adapter, 0, 126, req); + zfcp_erp_adapter_shutdown(adapter, 0, "fsecdh5", req); } } @@ -634,7 +637,7 @@ static void zfcp_fsf_exchange_port_data_ break; case FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE: zfcp_fsf_exchange_port_evaluate(req); - zfcp_fsf_link_down_info_eval(req, 43, + zfcp_fsf_link_down_info_eval(req, "fsepdh1", &qtcb->header.fsf_status_qual.link_down_info); break; } @@ -779,7 +782,7 @@ static int zfcp_fsf_req_send(struct zfcp if (zfcp_reqlist_find_safe(adapter, req)) zfcp_reqlist_remove(adapter, req); spin_unlock_irqrestore(&adapter->req_list_lock, flags); - zfcp_erp_adapter_reopen(adapter, 0, 116, req); + zfcp_erp_adapter_reopen(adapter, 0, "fsrs__1", req); return -EIO; } @@ -859,14 +862,14 @@ static void zfcp_fsf_abort_fcp_command_h switch (req->qtcb->header.fsf_status) { case FSF_PORT_HANDLE_NOT_VALID: if (fsq->word[0] == fsq->word[1]) { - zfcp_erp_adapter_reopen(unit->port->adapter, 0, 104, - req); + zfcp_erp_adapter_reopen(unit->port->adapter, 0, + "fsafch1", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; } break; case FSF_LUN_HANDLE_NOT_VALID: if (fsq->word[0] == fsq->word[1]) { - zfcp_erp_port_reopen(unit->port, 0, 105, req); + zfcp_erp_port_reopen(unit->port, 0, "fsafch2", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; } break; @@ -874,12 +877,12 @@ static void zfcp_fsf_abort_fcp_command_h req->status |= ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED; break; case FSF_PORT_BOXED: - zfcp_erp_port_boxed(unit->port, 47, req); + zfcp_erp_port_boxed(unit->port, "fsafch3", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; case FSF_LUN_BOXED: - zfcp_erp_unit_boxed(unit, 48, req); + zfcp_erp_unit_boxed(unit, "fsafch4", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -982,7 +985,7 @@ static void zfcp_fsf_send_ct_handler(str ZFCP_STATUS_FSFREQ_RETRY; break; case FSF_PORT_HANDLE_NOT_VALID: - zfcp_erp_adapter_reopen(adapter, 0, 106, req); + zfcp_erp_adapter_reopen(adapter, 0, "fsscth1", req); case FSF_GENERIC_COMMAND_REJECTED: case FSF_PAYLOAD_SIZE_MISMATCH: case FSF_REQUEST_SIZE_TOO_LARGE: @@ -1400,7 +1403,7 @@ static void zfcp_fsf_open_port_handler(s "Not enough FCP adapter resources to open " "remote port 0x%016Lx\n", (unsigned long long)port->wwpn); - zfcp_erp_port_failed(port, 31, req); + zfcp_erp_port_failed(port, "fsoph_1", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_ADAPTER_STATUS_AVAILABLE: @@ -1506,13 +1509,13 @@ static void zfcp_fsf_close_port_handler( switch (req->qtcb->header.fsf_status) { case FSF_PORT_HANDLE_NOT_VALID: - zfcp_erp_adapter_reopen(port->adapter, 0, 107, req); + zfcp_erp_adapter_reopen(port->adapter, 0, "fscph_1", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_ADAPTER_STATUS_AVAILABLE: break; case FSF_GOOD: - zfcp_erp_modify_port_status(port, 33, req, + zfcp_erp_modify_port_status(port, "fscph_2", req, ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); break; @@ -1641,7 +1644,7 @@ static void zfcp_fsf_close_wka_port_hand if (req->qtcb->header.fsf_status == FSF_PORT_HANDLE_NOT_VALID) { req->status |= ZFCP_STATUS_FSFREQ_ERROR; - zfcp_erp_adapter_reopen(wka_port->adapter, 0, 84, req); + zfcp_erp_adapter_reopen(wka_port->adapter, 0, "fscwph1", req); } wka_port->status = ZFCP_WKA_PORT_OFFLINE; @@ -1700,14 +1703,14 @@ static void zfcp_fsf_close_physical_port switch (header->fsf_status) { case FSF_PORT_HANDLE_NOT_VALID: - zfcp_erp_adapter_reopen(port->adapter, 0, 108, req); + zfcp_erp_adapter_reopen(port->adapter, 0, "fscpph1", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_ACCESS_DENIED: zfcp_fsf_access_denied_port(req, port); break; case FSF_PORT_BOXED: - zfcp_erp_port_boxed(port, 50, req); + zfcp_erp_port_boxed(port, "fscpph2", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; /* can't use generic zfcp_erp_modify_port_status because @@ -1805,7 +1808,7 @@ static void zfcp_fsf_open_unit_handler(s switch (header->fsf_status) { case FSF_PORT_HANDLE_NOT_VALID: - zfcp_erp_adapter_reopen(unit->port->adapter, 0, 109, req); + zfcp_erp_adapter_reopen(unit->port->adapter, 0, "fsouh_1", req); /* fall through */ case FSF_LUN_ALREADY_OPEN: break; @@ -1815,7 +1818,7 @@ static void zfcp_fsf_open_unit_handler(s atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status); break; case FSF_PORT_BOXED: - zfcp_erp_port_boxed(unit->port, 51, req); + zfcp_erp_port_boxed(unit->port, "fsouh_2", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -1831,7 +1834,7 @@ static void zfcp_fsf_open_unit_handler(s else zfcp_act_eval_err(adapter, header->fsf_status_qual.word[2]); - zfcp_erp_unit_access_denied(unit, 60, req); + zfcp_erp_unit_access_denied(unit, "fsouh_3", req); atomic_clear_mask(ZFCP_STATUS_UNIT_SHARED, &unit->status); atomic_clear_mask(ZFCP_STATUS_UNIT_READONLY, &unit->status); req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -1842,7 +1845,7 @@ static void zfcp_fsf_open_unit_handler(s "0x%016Lx on port 0x%016Lx\n", (unsigned long long)unit->fcp_lun, (unsigned long long)unit->port->wwpn); - zfcp_erp_unit_failed(unit, 34, req); + zfcp_erp_unit_failed(unit, "fsouh_4", req); /* fall through */ case FSF_INVALID_COMMAND_OPTION: req->status |= ZFCP_STATUS_FSFREQ_ERROR; @@ -1891,9 +1894,9 @@ static void zfcp_fsf_open_unit_handler(s "port 0x%016Lx)\n", (unsigned long long)unit->fcp_lun, (unsigned long long)unit->port->wwpn); - zfcp_erp_unit_failed(unit, 35, req); + zfcp_erp_unit_failed(unit, "fsouh_5", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; - zfcp_erp_unit_shutdown(unit, 0, 80, req); + zfcp_erp_unit_shutdown(unit, 0, "fsouh_6", req); } else if (!exclusive && readwrite) { dev_err(&adapter->ccw_device->dev, "Shared read-write access not " @@ -1901,9 +1904,9 @@ static void zfcp_fsf_open_unit_handler(s "0x%016Lx)\n", (unsigned long long)unit->fcp_lun, (unsigned long long)unit->port->wwpn); - zfcp_erp_unit_failed(unit, 36, req); + zfcp_erp_unit_failed(unit, "fsouh_7", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; - zfcp_erp_unit_shutdown(unit, 0, 81, req); + zfcp_erp_unit_shutdown(unit, 0, "fsouh_8", req); } } break; @@ -1968,15 +1971,15 @@ static void zfcp_fsf_close_unit_handler( switch (req->qtcb->header.fsf_status) { case FSF_PORT_HANDLE_NOT_VALID: - zfcp_erp_adapter_reopen(unit->port->adapter, 0, 110, req); + zfcp_erp_adapter_reopen(unit->port->adapter, 0, "fscuh_1", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_LUN_HANDLE_NOT_VALID: - zfcp_erp_port_reopen(unit->port, 0, 111, req); + zfcp_erp_port_reopen(unit->port, 0, "fscuh_2", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_PORT_BOXED: - zfcp_erp_port_boxed(unit->port, 52, req); + zfcp_erp_port_boxed(unit->port, "fscuh_3", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -2216,12 +2219,12 @@ static void zfcp_fsf_send_fcp_command_ha switch (header->fsf_status) { case FSF_HANDLE_MISMATCH: case FSF_PORT_HANDLE_NOT_VALID: - zfcp_erp_adapter_reopen(unit->port->adapter, 0, 112, req); + zfcp_erp_adapter_reopen(unit->port->adapter, 0, "fssfch1", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_FCPLUN_NOT_VALID: case FSF_LUN_HANDLE_NOT_VALID: - zfcp_erp_port_reopen(unit->port, 0, 113, req); + zfcp_erp_port_reopen(unit->port, 0, "fssfch2", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_SERVICE_CLASS_NOT_SUPPORTED: @@ -2237,7 +2240,8 @@ static void zfcp_fsf_send_fcp_command_ha req->qtcb->bottom.io.data_direction, (unsigned long long)unit->fcp_lun, (unsigned long long)unit->port->wwpn); - zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 133, req); + zfcp_erp_adapter_shutdown(unit->port->adapter, 0, "fssfch3", + req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_CMND_LENGTH_NOT_VALID: @@ -2247,16 +2251,17 @@ static void zfcp_fsf_send_fcp_command_ha req->qtcb->bottom.io.fcp_cmnd_length, (unsigned long long)unit->fcp_lun, (unsigned long long)unit->port->wwpn); - zfcp_erp_adapter_shutdown(unit->port->adapter, 0, 134, req); + zfcp_erp_adapter_shutdown(unit->port->adapter, 0, "fssfch4", + req); req->status |= ZFCP_STATUS_FSFREQ_ERROR; break; case FSF_PORT_BOXED: - zfcp_erp_port_boxed(unit->port, 53, req); + zfcp_erp_port_boxed(unit->port, "fssfch5", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; case FSF_LUN_BOXED: - zfcp_erp_unit_boxed(unit, 54, req); + zfcp_erp_unit_boxed(unit, "fssfch6", req); req->status |= ZFCP_STATUS_FSFREQ_ERROR | ZFCP_STATUS_FSFREQ_RETRY; break; @@ -2389,7 +2394,7 @@ int zfcp_fsf_send_fcp_command_task(struc "on port 0x%016Lx closed\n", (unsigned long long)unit->fcp_lun, (unsigned long long)unit->port->wwpn); - zfcp_erp_unit_shutdown(unit, 0, 131, req); + zfcp_erp_unit_shutdown(unit, 0, "fssfct1", req); retval = -EINVAL; } goto failed_scsi_cmnd; --- a/drivers/s390/scsi/zfcp_qdio.c 2009-03-02 12:42:24.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_qdio.c 2009-03-02 12:42:38.000000000 +0100 @@ -58,7 +58,7 @@ void zfcp_qdio_free(struct zfcp_adapter } } -static void zfcp_qdio_handler_error(struct zfcp_adapter *adapter, u8 id) +static void zfcp_qdio_handler_error(struct zfcp_adapter *adapter, char *id) { dev_warn(&adapter->ccw_device->dev, "A QDIO problem occurred\n"); @@ -103,7 +103,7 @@ static void zfcp_qdio_int_req(struct ccw if (unlikely(qdio_err)) { zfcp_hba_dbf_event_qdio(adapter, qdio_err, first, count); - zfcp_qdio_handler_error(adapter, 140); + zfcp_qdio_handler_error(adapter, "qdireq1"); return; } @@ -172,7 +172,7 @@ static void zfcp_qdio_int_resp(struct cc if (unlikely(qdio_err)) { zfcp_hba_dbf_event_qdio(adapter, qdio_err, first, count); - zfcp_qdio_handler_error(adapter, 147); + zfcp_qdio_handler_error(adapter, "qdires1"); return; } --- a/drivers/s390/scsi/zfcp_scsi.c 2009-03-02 12:42:30.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_scsi.c 2009-03-02 12:42:38.000000000 +0100 @@ -28,7 +28,7 @@ static void zfcp_scsi_slave_destroy(stru { struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; unit->device = NULL; - zfcp_erp_unit_failed(unit, 12, NULL); + zfcp_erp_unit_failed(unit, "scslvd1", NULL); zfcp_unit_put(unit); } @@ -257,7 +257,7 @@ static int zfcp_scsi_eh_host_reset_handl struct zfcp_unit *unit = scpnt->device->hostdata; struct zfcp_adapter *adapter = unit->port->adapter; - zfcp_erp_adapter_reopen(adapter, 0, 141, scpnt); + zfcp_erp_adapter_reopen(adapter, 0, "schrh_1", scpnt); zfcp_erp_wait(adapter); return SUCCESS; --- a/drivers/s390/scsi/zfcp_sysfs.c 2009-03-02 12:42:25.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_sysfs.c 2009-03-02 12:42:38.000000000 +0100 @@ -112,9 +112,9 @@ static ZFCP_DEV_ATTR(_feat, failed, S_IW zfcp_sysfs_##_feat##_failed_show, \ zfcp_sysfs_##_feat##_failed_store); -ZFCP_SYSFS_FAILED(zfcp_adapter, adapter, adapter, 44, 93); -ZFCP_SYSFS_FAILED(zfcp_port, port, port->adapter, 45, 96); -ZFCP_SYSFS_FAILED(zfcp_unit, unit, unit->port->adapter, 46, 97); +ZFCP_SYSFS_FAILED(zfcp_adapter, adapter, adapter, "syafai1", "syafai2"); +ZFCP_SYSFS_FAILED(zfcp_port, port, port->adapter, "sypfai1", "sypfai2"); +ZFCP_SYSFS_FAILED(zfcp_unit, unit, unit->port->adapter, "syufai1", "syufai2"); static ssize_t zfcp_sysfs_port_rescan_store(struct device *dev, struct device_attribute *attr, @@ -168,7 +168,7 @@ static ssize_t zfcp_sysfs_port_remove_st goto out; } - zfcp_erp_port_shutdown(port, 0, 92, NULL); + zfcp_erp_port_shutdown(port, 0, "syprs_1", NULL); zfcp_erp_wait(adapter); zfcp_port_put(port); zfcp_port_dequeue(port); @@ -222,7 +222,7 @@ static ssize_t zfcp_sysfs_unit_add_store retval = 0; - zfcp_erp_unit_reopen(unit, 0, 94, NULL); + zfcp_erp_unit_reopen(unit, 0, "syuas_1", NULL); zfcp_erp_wait(unit->port->adapter); zfcp_unit_put(unit); out: @@ -268,7 +268,7 @@ static ssize_t zfcp_sysfs_unit_remove_st goto out; } - zfcp_erp_unit_shutdown(unit, 0, 95, NULL); + zfcp_erp_unit_shutdown(unit, 0, "syurs_1", NULL); zfcp_erp_wait(unit->port->adapter); zfcp_unit_put(unit); zfcp_unit_dequeue(unit); ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 12/18] [PATCH] zfcp: Remove PCI flag 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt ` (10 preceding siblings ...) 2009-03-02 12:09 ` [patch 11/18] [PATCH] zfcp: replace current ERP logging with a more convenient version Christof Schmitt @ 2009-03-02 12:09 ` Christof Schmitt 2009-03-02 12:09 ` [patch 13/18] [PATCH] zfcp: Report fc_host_port_type as NPIV Christof Schmitt ` (5 subsequent siblings) 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:09 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: q.diff --] [-- Type: text/plain, Size: 3100 bytes --] From: Christof Schmitt <christof.schmitt@de.ibm.com> The usage of the PCI flag to trigger interrupts is optional. Even without setting the flag, qdio still receives interrupts to continue working on the queue. Remove the PCI flag from zfcp, it is not necessary. Acked-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- a/drivers/s390/scsi/zfcp_qdio.c 2009-03-02 09:47:50.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_qdio.c 2009-03-02 09:47:50.000000000 +0100 @@ -11,9 +11,6 @@ #include "zfcp_ext.h" -/* FIXME(tune): free space should be one max. SBAL chain plus what? */ -#define ZFCP_QDIO_PCI_INTERVAL (QDIO_MAX_BUFFERS_PER_Q \ - - (FSF_MAX_SBALS_PER_REQ + 4)) #define QBUFF_PER_PAGE (PAGE_SIZE / sizeof(struct qdio_buffer)) static int zfcp_qdio_buffers_enqueue(struct qdio_buffer **sbal) @@ -364,23 +361,12 @@ int zfcp_qdio_send(struct zfcp_fsf_req * struct zfcp_qdio_queue *req_q = &adapter->req_q; int first = fsf_req->sbal_first; int count = fsf_req->sbal_number; - int retval, pci, pci_batch; - struct qdio_buffer_element *sbale; - - /* acknowledgements for transferred buffers */ - pci_batch = adapter->req_q_pci_batch + count; - if (unlikely(pci_batch >= ZFCP_QDIO_PCI_INTERVAL)) { - pci_batch %= ZFCP_QDIO_PCI_INTERVAL; - pci = first + count - (pci_batch + 1); - pci %= QDIO_MAX_BUFFERS_PER_Q; - sbale = zfcp_qdio_sbale(req_q, pci, 0); - sbale->flags |= SBAL_FLAGS0_PCI; - } + int retval; + unsigned int qdio_flags = QDIO_FLAG_SYNC_OUTPUT; zfcp_qdio_account(adapter); - retval = do_QDIO(adapter->ccw_device, QDIO_FLAG_SYNC_OUTPUT, 0, first, - count); + retval = do_QDIO(adapter->ccw_device, qdio_flags, 0, first, count); if (unlikely(retval)) { zfcp_qdio_zero_sbals(req_q->sbal, first, count); return retval; @@ -390,7 +376,6 @@ int zfcp_qdio_send(struct zfcp_fsf_req * atomic_sub(count, &req_q->count); req_q->first += count; req_q->first %= QDIO_MAX_BUFFERS_PER_Q; - adapter->req_q_pci_batch = pci_batch; return 0; } @@ -461,7 +446,6 @@ void zfcp_qdio_close(struct zfcp_adapter } req_q->first = 0; atomic_set(&req_q->count, 0); - adapter->req_q_pci_batch = 0; adapter->resp_q.first = 0; atomic_set(&adapter->resp_q.count, 0); } @@ -499,7 +483,6 @@ int zfcp_qdio_open(struct zfcp_adapter * /* set index of first avalable SBALS / number of available SBALS */ adapter->req_q.first = 0; atomic_set(&adapter->req_q.count, QDIO_MAX_BUFFERS_PER_Q); - adapter->req_q_pci_batch = 0; return 0; --- a/drivers/s390/scsi/zfcp_def.h 2009-03-02 09:47:50.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_def.h 2009-03-02 09:55:14.000000000 +0100 @@ -443,8 +443,6 @@ struct zfcp_adapter { spinlock_t req_list_lock; /* request list lock */ struct zfcp_qdio_queue req_q; /* request queue */ spinlock_t req_q_lock; /* for operations on queue */ - int req_q_pci_batch; /* SBALs since PCI indication - was last set */ ktime_t req_q_time; /* time of last fill level change */ u64 req_q_util; /* for accounting */ spinlock_t qdio_stat_lock; ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 13/18] [PATCH] zfcp: Report fc_host_port_type as NPIV 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt ` (11 preceding siblings ...) 2009-03-02 12:09 ` [patch 12/18] [PATCH] zfcp: Remove PCI flag Christof Schmitt @ 2009-03-02 12:09 ` Christof Schmitt 2009-03-02 12:09 ` [patch 14/18] [PATCH] zfcp: incorrect reaction on incoming RSCN Christof Schmitt ` (4 subsequent siblings) 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:09 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: 714-zfcp-port-type.diff --] [-- Type: text/plain, Size: 1234 bytes --] From: Christof Schmitt <christof.schmitt@de.ibm.com> Report the fc_host_port_type as FC_PORTTYPE_NPIV when the subchannel is running in NPIV mode. This allows to see the correct type with lsscsi -H -t --list Acked-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_fsf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff -urpN linux-2.6/drivers/s390/scsi/zfcp_fsf.c linux-2.6-patched/drivers/s390/scsi/zfcp_fsf.c --- linux-2.6/drivers/s390/scsi/zfcp_fsf.c 2009-03-01 16:41:34.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_fsf.c 2009-03-01 16:41:35.000000000 +0100 @@ -616,9 +616,10 @@ static void zfcp_fsf_exchange_port_evalu if (req->data) memcpy(req->data, bottom, sizeof(*bottom)); - if (adapter->connection_features & FSF_FEATURE_NPIV_MODE) + if (adapter->connection_features & FSF_FEATURE_NPIV_MODE) { fc_host_permanent_port_name(shost) = bottom->wwpn; - else + fc_host_port_type(shost) = FC_PORTTYPE_NPIV; + } else fc_host_permanent_port_name(shost) = fc_host_port_name(shost); fc_host_maxframe_size(shost) = bottom->maximum_frame_size; fc_host_supported_speeds(shost) = bottom->supported_speed; ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 14/18] [PATCH] zfcp: incorrect reaction on incoming RSCN 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt ` (12 preceding siblings ...) 2009-03-02 12:09 ` [patch 13/18] [PATCH] zfcp: Report fc_host_port_type as NPIV Christof Schmitt @ 2009-03-02 12:09 ` Christof Schmitt 2009-03-02 12:09 ` [patch 15/18] [PATCH] zfcp: Block FC transport rports early on errors Christof Schmitt ` (3 subsequent siblings) 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:09 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: 715-zfcp-incoming-rscn.diff --] [-- Type: text/plain, Size: 2547 bytes --] From: Swen Schillig <swen@vnet.ibm.com> After an error condition resolved a remote storage port was never re-opened. The incoming RSCN was not processed accordingly due to a misinterpreted status flag / return value combination. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_fc.c | 18 +++++++----------- drivers/s390/scsi/zfcp_fsf.c | 4 ---- 2 files changed, 7 insertions(+), 15 deletions(-) diff -urpN linux-2.6/drivers/s390/scsi/zfcp_fc.c linux-2.6-patched/drivers/s390/scsi/zfcp_fc.c --- linux-2.6/drivers/s390/scsi/zfcp_fc.c 2009-03-01 16:41:34.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_fc.c 2009-03-01 16:41:35.000000000 +0100 @@ -145,16 +145,10 @@ static void _zfcp_fc_incoming_rscn(struc struct zfcp_port *port; read_lock_irqsave(&zfcp_data.config_lock, flags); - list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) { - if (!(atomic_read(&port->status) & ZFCP_STATUS_PORT_PHYS_OPEN)) - /* Try to connect to unused ports anyway. */ - zfcp_erp_port_reopen(port, - ZFCP_STATUS_COMMON_ERP_FAILED, - "fcirsc1", fsf_req); - else if ((port->d_id & range) == (elem->nport_did & range)) - /* Check connection status for connected ports */ + list_for_each_entry(port, &fsf_req->adapter->port_list_head, list) + if ((port->d_id & range) == (elem->nport_did & range)) zfcp_test_link(port); - } + read_unlock_irqrestore(&zfcp_data.config_lock, flags); } @@ -381,8 +375,10 @@ static void zfcp_fc_adisc_handler(unsign if (!port->wwnn) port->wwnn = ls_adisc->wwnn; - if (port->wwpn != ls_adisc->wwpn) - zfcp_erp_port_reopen(port, 0, "fcadh_2", NULL); + if ((port->wwpn != ls_adisc->wwpn) || + !(atomic_read(&port->status) & ZFCP_STATUS_COMMON_OPEN)) + zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, + "fcadh_2", NULL); out: zfcp_port_put(port); diff -urpN linux-2.6/drivers/s390/scsi/zfcp_fsf.c linux-2.6-patched/drivers/s390/scsi/zfcp_fsf.c --- linux-2.6/drivers/s390/scsi/zfcp_fsf.c 2009-03-01 16:41:35.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_fsf.c 2009-03-01 16:41:35.000000000 +0100 @@ -1162,10 +1162,6 @@ int zfcp_fsf_send_els(struct zfcp_send_e struct fsf_qtcb_bottom_support *bottom; int ret = -EIO; - if (unlikely(!(atomic_read(&els->port->status) & - ZFCP_STATUS_COMMON_UNBLOCKED))) - return -EBUSY; - spin_lock_bh(&adapter->req_q_lock); if (zfcp_fsf_req_sbal_get(adapter)) goto out; ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 15/18] [PATCH] zfcp: Block FC transport rports early on errors 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt ` (13 preceding siblings ...) 2009-03-02 12:09 ` [patch 14/18] [PATCH] zfcp: incorrect reaction on incoming RSCN Christof Schmitt @ 2009-03-02 12:09 ` Christof Schmitt 2009-03-02 12:09 ` [patch 16/18] [PATCH] zfcp: erp failed status bit will not be set Christof Schmitt ` (2 subsequent siblings) 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:09 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: rport.diff --] [-- Type: text/plain, Size: 13227 bytes --] From: Christof Schmitt <christof.schmitt@de.ibm.com> Use the I/O blocking mechanism in the FC transport class to allow faster failovers for multipathing: - Call fc_remote_port_delete early to set the rport to BLOCKED. - Check the rport status in queuecommand with fc_remote_portchkready to no longer accept new I/O for this port and fail the I/O with the appropriate scsi_cmnd result. - Implement the terminate_rport_io handler to abort all pending I/O requests - Return SCSI commands with DID_TRANSPORT_DISRUPTED while erp is running. - When updating the remote port status, check for late changes and update the remote ports status accordingly. Acked-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- a/drivers/s390/scsi/zfcp_erp.c 2009-03-02 09:59:28.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_erp.c 2009-03-02 09:59:28.000000000 +0100 @@ -3,7 +3,7 @@ * * Error Recovery Procedures (ERP). * - * Copyright IBM Corporation 2002, 2008 + * Copyright IBM Corporation 2002, 2009 */ #define KMSG_COMPONENT "zfcp" @@ -240,6 +240,7 @@ static int _zfcp_erp_adapter_reopen(stru int clear_mask, char *id, void *ref) { zfcp_erp_adapter_block(adapter, clear_mask); + zfcp_scsi_schedule_rports_block(adapter); /* ensure propagation of failed status to new devices */ if (atomic_read(&adapter->status) & ZFCP_STATUS_COMMON_ERP_FAILED) { @@ -322,6 +323,7 @@ static void _zfcp_erp_port_forced_reopen int clear, char *id, void *ref) { zfcp_erp_port_block(port, clear); + zfcp_scsi_schedule_rport_block(port); if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED) return; @@ -353,6 +355,7 @@ static int _zfcp_erp_port_reopen(struct void *ref) { zfcp_erp_port_block(port, clear); + zfcp_scsi_schedule_rport_block(port); if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED) { /* ensure propagation of failed status to new devices */ @@ -1211,37 +1214,6 @@ static void zfcp_erp_schedule_work(struc queue_work(zfcp_data.work_queue, &p->work); } -static void zfcp_erp_rport_register(struct zfcp_port *port) -{ - struct fc_rport_identifiers ids; - ids.node_name = port->wwnn; - ids.port_name = port->wwpn; - ids.port_id = port->d_id; - ids.roles = FC_RPORT_ROLE_FCP_TARGET; - port->rport = fc_remote_port_add(port->adapter->scsi_host, 0, &ids); - if (!port->rport) { - dev_err(&port->adapter->ccw_device->dev, - "Registering port 0x%016Lx failed\n", - (unsigned long long)port->wwpn); - return; - } - - scsi_target_unblock(&port->rport->dev); - port->rport->maxframe_size = port->maxframe_size; - port->rport->supported_classes = port->supported_classes; -} - -static void zfcp_erp_rports_del(struct zfcp_adapter *adapter) -{ - struct zfcp_port *port; - list_for_each_entry(port, &adapter->port_list_head, list) { - if (!port->rport) - continue; - fc_remote_port_delete(port->rport); - port->rport = NULL; - } -} - static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) { struct zfcp_adapter *adapter = act->adapter; @@ -1250,8 +1222,8 @@ static void zfcp_erp_action_cleanup(stru switch (act->action) { case ZFCP_ERP_ACTION_REOPEN_UNIT: - if ((result == ZFCP_ERP_SUCCEEDED) && - !unit->device && port->rport) { + flush_work(&port->rport_work); + if ((result == ZFCP_ERP_SUCCEEDED) && !unit->device) { if (!(atomic_read(&unit->status) & ZFCP_STATUS_UNIT_SCSI_WORK_PENDING)) zfcp_erp_schedule_work(unit); @@ -1261,23 +1233,17 @@ static void zfcp_erp_action_cleanup(stru case ZFCP_ERP_ACTION_REOPEN_PORT_FORCED: case ZFCP_ERP_ACTION_REOPEN_PORT: - if ((result == ZFCP_ERP_SUCCEEDED) && !port->rport) - zfcp_erp_rport_register(port); - if ((result != ZFCP_ERP_SUCCEEDED) && port->rport) { - fc_remote_port_delete(port->rport); - port->rport = NULL; - } + if (result == ZFCP_ERP_SUCCEEDED) + zfcp_scsi_schedule_rport_register(port); zfcp_port_put(port); break; case ZFCP_ERP_ACTION_REOPEN_ADAPTER: - if (result != ZFCP_ERP_SUCCEEDED) { - unregister_service_level(&adapter->service_level); - zfcp_erp_rports_del(adapter); - } else { + if (result == ZFCP_ERP_SUCCEEDED) { register_service_level(&adapter->service_level); schedule_work(&adapter->scan_work); - } + } else + unregister_service_level(&adapter->service_level); zfcp_adapter_put(adapter); break; } --- a/drivers/s390/scsi/zfcp_aux.c 2009-03-02 09:59:28.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_aux.c 2009-03-02 09:59:28.000000000 +0100 @@ -3,7 +3,7 @@ * * Module interface and handling of zfcp data structures. * - * Copyright IBM Corporation 2002, 2008 + * Copyright IBM Corporation 2002, 2009 */ /* @@ -606,10 +606,12 @@ struct zfcp_port *zfcp_port_enqueue(stru INIT_LIST_HEAD(&port->unit_list_head); INIT_WORK(&port->gid_pn_work, zfcp_erp_port_strategy_open_lookup); INIT_WORK(&port->test_link_work, zfcp_fc_link_test_work); + INIT_WORK(&port->rport_work, zfcp_scsi_rport_work); port->adapter = adapter; port->d_id = d_id; port->wwpn = wwpn; + port->rport_task = RPORT_NONE; /* mark port unusable as long as sysfs registration is not complete */ atomic_set_mask(status | ZFCP_STATUS_COMMON_REMOVE, &port->status); --- a/drivers/s390/scsi/zfcp_def.h 2009-03-02 09:59:28.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_def.h 2009-03-02 09:59:28.000000000 +0100 @@ -3,7 +3,7 @@ * * Global definitions for the zfcp device driver. * - * Copyright IBM Corporation 2002, 2008 + * Copyright IBM Corporation 2002, 2009 */ #ifndef ZFCP_DEF_H @@ -512,6 +512,8 @@ struct zfcp_port { u32 supported_classes; struct work_struct gid_pn_work; struct work_struct test_link_work; + struct work_struct rport_work; + enum { RPORT_NONE, RPORT_ADD, RPORT_DEL } rport_task; }; struct zfcp_unit { --- a/drivers/s390/scsi/zfcp_ext.h 2009-03-02 09:59:28.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_ext.h 2009-03-02 09:59:28.000000000 +0100 @@ -3,7 +3,7 @@ * * External function declarations. * - * Copyright IBM Corporation 2002, 2008 + * Copyright IBM Corporation 2002, 2009 */ #ifndef ZFCP_EXT_H @@ -154,6 +154,10 @@ extern int zfcp_adapter_scsi_register(st extern void zfcp_adapter_scsi_unregister(struct zfcp_adapter *); extern char *zfcp_get_fcp_sns_info_ptr(struct fcp_rsp_iu *); extern struct fc_function_template zfcp_transport_functions; +extern void zfcp_scsi_rport_work(struct work_struct *); +extern void zfcp_scsi_schedule_rport_register(struct zfcp_port *); +extern void zfcp_scsi_schedule_rport_block(struct zfcp_port *); +extern void zfcp_scsi_schedule_rports_block(struct zfcp_adapter *); /* zfcp_sysfs.c */ extern struct attribute_group zfcp_sysfs_unit_attrs; --- a/drivers/s390/scsi/zfcp_fc.c 2009-03-02 09:59:28.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_fc.c 2009-03-02 09:59:28.000000000 +0100 @@ -3,7 +3,7 @@ * * Fibre Channel related functions for the zfcp device driver. * - * Copyright IBM Corporation 2008 + * Copyright IBM Corporation 2008, 2009 */ #define KMSG_COMPONENT "zfcp" @@ -376,10 +376,14 @@ static void zfcp_fc_adisc_handler(unsign port->wwnn = ls_adisc->wwnn; if ((port->wwpn != ls_adisc->wwpn) || - !(atomic_read(&port->status) & ZFCP_STATUS_COMMON_OPEN)) + !(atomic_read(&port->status) & ZFCP_STATUS_COMMON_OPEN)) { zfcp_erp_port_reopen(port, ZFCP_STATUS_COMMON_ERP_FAILED, "fcadh_2", NULL); + goto out; + } + /* port is good, unblock rport without going through erp */ + zfcp_scsi_schedule_rport_register(port); out: zfcp_port_put(port); kfree(adisc); @@ -423,14 +427,23 @@ void zfcp_fc_link_test_work(struct work_ container_of(work, struct zfcp_port, test_link_work); int retval; + if (!(atomic_read(&port->status) & ZFCP_STATUS_COMMON_UNBLOCKED)) { + zfcp_port_put(port); + return; /* port erp is running and will update rport status */ + } + + zfcp_port_get(port); + port->rport_task = RPORT_DEL; + zfcp_scsi_rport_work(&port->rport_work); + retval = zfcp_fc_adisc(port); if (retval == 0) return; /* send of ADISC was not possible */ + zfcp_erp_port_forced_reopen(port, 0, "fcltwk1", NULL); + zfcp_port_put(port); - if (retval != -EBUSY) - zfcp_erp_port_forced_reopen(port, 0, "fcltwk1", NULL); } /** --- a/drivers/s390/scsi/zfcp_fsf.c 2009-03-02 09:59:28.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_fsf.c 2009-03-02 09:59:28.000000000 +0100 @@ -3,7 +3,7 @@ * * Implementation of FSF commands. * - * Copyright IBM Corporation 2002, 2008 + * Copyright IBM Corporation 2002, 2009 */ #define KMSG_COMPONENT "zfcp" @@ -177,6 +177,7 @@ static void zfcp_fsf_link_down_info_eval return; atomic_set_mask(ZFCP_STATUS_ADAPTER_LINK_UNPLUGGED, &adapter->status); + zfcp_scsi_schedule_rports_block(adapter); if (!link_down) goto out; --- a/drivers/s390/scsi/zfcp_scsi.c 2009-03-02 09:59:28.000000000 +0100 +++ b/drivers/s390/scsi/zfcp_scsi.c 2009-03-02 09:59:28.000000000 +0100 @@ -3,7 +3,7 @@ * * Interface to Linux SCSI midlayer. * - * Copyright IBM Corporation 2002, 2008 + * Copyright IBM Corporation 2002, 2009 */ #define KMSG_COMPONENT "zfcp" @@ -57,8 +57,8 @@ static int zfcp_scsi_queuecommand(struct { struct zfcp_unit *unit; struct zfcp_adapter *adapter; - int status; - int ret; + int status, scsi_result, ret; + struct fc_rport *rport = starget_to_rport(scsi_target(scpnt->device)); /* reset the status for this request */ scpnt->result = 0; @@ -80,6 +80,14 @@ static int zfcp_scsi_queuecommand(struct return 0; } + scsi_result = fc_remote_port_chkready(rport); + if (unlikely(scsi_result)) { + scpnt->result = scsi_result; + zfcp_scsi_dbf_event_result("fail", 4, adapter, scpnt, NULL); + scpnt->scsi_done(scpnt); + return 0; + } + status = atomic_read(&unit->status); if (unlikely((status & ZFCP_STATUS_COMMON_ERP_FAILED) || !(status & ZFCP_STATUS_COMMON_RUNNING))) { @@ -473,6 +481,109 @@ static void zfcp_set_rport_dev_loss_tmo( rport->dev_loss_tmo = timeout; } +/** + * zfcp_scsi_dev_loss_tmo_callbk - Free any reference to rport + * @rport: The rport that is about to be deleted. + */ +static void zfcp_scsi_dev_loss_tmo_callbk(struct fc_rport *rport) +{ + struct zfcp_port *port = rport->dd_data; + + write_lock_irq(&zfcp_data.config_lock); + port->rport = NULL; + write_unlock_irq(&zfcp_data.config_lock); +} + +/** + * zfcp_scsi_terminate_rport_io - Terminate all I/O on a rport + * @rport: The FC rport where to teminate I/O + * + * Abort all pending SCSI commands for a port by closing the + * port. Using a reopen for avoids a conflict with a shutdown + * overwriting a reopen. + */ +static void zfcp_scsi_terminate_rport_io(struct fc_rport *rport) +{ + struct zfcp_port *port = rport->dd_data; + + zfcp_erp_port_reopen(port, 0, "sctrpi1", NULL); +} + +static void zfcp_scsi_rport_register(struct zfcp_port *port) +{ + struct fc_rport_identifiers ids; + struct fc_rport *rport; + + ids.node_name = port->wwnn; + ids.port_name = port->wwpn; + ids.port_id = port->d_id; + ids.roles = FC_RPORT_ROLE_FCP_TARGET; + + rport = fc_remote_port_add(port->adapter->scsi_host, 0, &ids); + if (!rport) { + dev_err(&port->adapter->ccw_device->dev, + "Registering port 0x%016Lx failed\n", + (unsigned long long)port->wwpn); + return; + } + + rport->dd_data = port; + rport->maxframe_size = port->maxframe_size; + rport->supported_classes = port->supported_classes; + port->rport = rport; +} + +static void zfcp_scsi_rport_block(struct zfcp_port *port) +{ + if (port->rport) + fc_remote_port_delete(port->rport); +} + +void zfcp_scsi_schedule_rport_register(struct zfcp_port *port) +{ + zfcp_port_get(port); + port->rport_task = RPORT_ADD; + + if (!queue_work(zfcp_data.work_queue, &port->rport_work)) + zfcp_port_put(port); +} + +void zfcp_scsi_schedule_rport_block(struct zfcp_port *port) +{ + zfcp_port_get(port); + port->rport_task = RPORT_DEL; + + if (!queue_work(zfcp_data.work_queue, &port->rport_work)) + zfcp_port_put(port); +} + +void zfcp_scsi_schedule_rports_block(struct zfcp_adapter *adapter) +{ + struct zfcp_port *port; + + list_for_each_entry(port, &adapter->port_list_head, list) + zfcp_scsi_schedule_rport_block(port); +} + +void zfcp_scsi_rport_work(struct work_struct *work) +{ + struct zfcp_port *port = container_of(work, struct zfcp_port, + rport_work); + + while (port->rport_task) { + if (port->rport_task == RPORT_ADD) { + port->rport_task = RPORT_NONE; + zfcp_scsi_rport_register(port); + } else { + port->rport_task = RPORT_NONE; + zfcp_scsi_rport_block(port); + } + } + + zfcp_port_put(port); +} + + struct fc_function_template zfcp_transport_functions = { .show_starget_port_id = 1, .show_starget_port_name = 1, @@ -491,6 +602,8 @@ struct fc_function_template zfcp_transpo .reset_fc_host_stats = zfcp_reset_fc_host_stats, .set_rport_dev_loss_tmo = zfcp_set_rport_dev_loss_tmo, .get_host_port_state = zfcp_get_host_port_state, + .dev_loss_tmo_callbk = zfcp_scsi_dev_loss_tmo_callbk, + .terminate_rport_io = zfcp_scsi_terminate_rport_io, .show_host_port_state = 1, /* no functions registered for following dynamic attributes but directly set by LLDD */ ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 16/18] [PATCH] zfcp: erp failed status bit will not be set 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt ` (14 preceding siblings ...) 2009-03-02 12:09 ` [patch 15/18] [PATCH] zfcp: Block FC transport rports early on errors Christof Schmitt @ 2009-03-02 12:09 ` Christof Schmitt 2009-03-02 12:09 ` [patch 17/18] [PATCH] zfcp: fix queue, scheduled work processing Christof Schmitt 2009-03-02 12:09 ` [patch 18/18] [PATCH] zfcp: Ensure all work is cancelled on adapter dequeue Christof Schmitt 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:09 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Martin Petermann, Christof Schmitt [-- Attachment #1: 717-zfcp-erp-status-bit.diff --] [-- Type: text/plain, Size: 975 bytes --] From: Martin Petermann <martin@linux.vnet.ibm.com> It will not be necessary to set the erp failed status bit in case a SCSI device is removed by the SCSI mid layer. In the case a SCSI device is unavailable for a short time (15 to 20 seconds) a FCP unit will not get on-line again. Signed-off-by: Martin Petermann <martin@linux.vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_scsi.c | 1 - 1 file changed, 1 deletion(-) diff -urpN linux-2.6/drivers/s390/scsi/zfcp_scsi.c linux-2.6-patched/drivers/s390/scsi/zfcp_scsi.c --- linux-2.6/drivers/s390/scsi/zfcp_scsi.c 2009-03-01 16:41:36.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_scsi.c 2009-03-01 16:41:36.000000000 +0100 @@ -28,7 +28,6 @@ static void zfcp_scsi_slave_destroy(stru { struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; unit->device = NULL; - zfcp_erp_unit_failed(unit, "scslvd1", NULL); zfcp_unit_put(unit); } ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 17/18] [PATCH] zfcp: fix queue, scheduled work processing. 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt ` (15 preceding siblings ...) 2009-03-02 12:09 ` [patch 16/18] [PATCH] zfcp: erp failed status bit will not be set Christof Schmitt @ 2009-03-02 12:09 ` Christof Schmitt 2009-03-02 12:09 ` [patch 18/18] [PATCH] zfcp: Ensure all work is cancelled on adapter dequeue Christof Schmitt 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:09 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: 718-zfcp-fix-queue.diff --] [-- Type: text/plain, Size: 2486 bytes --] From: Swen Schillig <swen@vnet.ibm.com> Ensure the refcounting is correct even if we were not able to schedule a work. In addition we have to make sure no scheduled work is pending while we're dequeing the adapter from the systems environment. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_aux.c | 1 + drivers/s390/scsi/zfcp_erp.c | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff -urpN linux-2.6/drivers/s390/scsi/zfcp_aux.c linux-2.6-patched/drivers/s390/scsi/zfcp_aux.c --- linux-2.6/drivers/s390/scsi/zfcp_aux.c 2009-03-01 16:41:36.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_aux.c 2009-03-01 16:41:36.000000000 +0100 @@ -554,6 +554,7 @@ void zfcp_adapter_dequeue(struct zfcp_ad cancel_work_sync(&adapter->scan_work); cancel_work_sync(&adapter->stat_work); + cancel_delayed_work_sync(&adapter->nsp.work); zfcp_adapter_scsi_unregister(adapter); sysfs_remove_group(&adapter->ccw_device->dev.kobj, &zfcp_sysfs_adapter_attrs); diff -urpN linux-2.6/drivers/s390/scsi/zfcp_erp.c linux-2.6-patched/drivers/s390/scsi/zfcp_erp.c --- linux-2.6/drivers/s390/scsi/zfcp_erp.c 2009-03-01 16:41:36.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_erp.c 2009-03-01 16:41:36.000000000 +0100 @@ -857,7 +857,7 @@ void zfcp_erp_port_strategy_open_lookup( port->erp_action.step = ZFCP_ERP_STEP_NAMESERVER_LOOKUP; if (retval) zfcp_erp_notify(&port->erp_action, ZFCP_ERP_FAILED); - + zfcp_port_put(port); } static int zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *act) @@ -873,7 +873,10 @@ static int zfcp_erp_port_strategy_open_c if (fc_host_port_type(adapter->scsi_host) == FC_PORTTYPE_PTP) return zfcp_erp_open_ptp_port(act); if (!port->d_id) { - queue_work(zfcp_data.work_queue, &port->gid_pn_work); + zfcp_port_get(port); + if (!queue_work(zfcp_data.work_queue, + &port->gid_pn_work)) + zfcp_port_put(port); return ZFCP_ERP_CONTINUES; } case ZFCP_ERP_STEP_NAMESERVER_LOOKUP: @@ -1211,7 +1214,8 @@ static void zfcp_erp_schedule_work(struc atomic_set_mask(ZFCP_STATUS_UNIT_SCSI_WORK_PENDING, &unit->status); INIT_WORK(&p->work, zfcp_erp_scsi_scan); p->unit = unit; - queue_work(zfcp_data.work_queue, &p->work); + if (!queue_work(zfcp_data.work_queue, &p->work)) + zfcp_unit_put(unit); } static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) ^ permalink raw reply [flat|nested] 19+ messages in thread
* [patch 18/18] [PATCH] zfcp: Ensure all work is cancelled on adapter dequeue 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt ` (16 preceding siblings ...) 2009-03-02 12:09 ` [patch 17/18] [PATCH] zfcp: fix queue, scheduled work processing Christof Schmitt @ 2009-03-02 12:09 ` Christof Schmitt 17 siblings, 0 replies; 19+ messages in thread From: Christof Schmitt @ 2009-03-02 12:09 UTC (permalink / raw) To: James Bottomley Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, Swen Schillig, Christof Schmitt [-- Attachment #1: 719-zfcp-work-cancel.diff --] [-- Type: text/plain, Size: 2710 bytes --] From: Swen Schillig <swen@vnet.ibm.com> A scheduled work might still be pending, running while the adapter is in progress to get dequeued from the system. This can lead to an invalid pointer dereference (Oops). Once the adpater is set online again, ensure the nameserver environment is initialized to the appropriate values again. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> --- drivers/s390/scsi/zfcp_aux.c | 1 - drivers/s390/scsi/zfcp_ccw.c | 3 ++- drivers/s390/scsi/zfcp_fc.c | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff -urpN linux-2.6/drivers/s390/scsi/zfcp_aux.c linux-2.6-patched/drivers/s390/scsi/zfcp_aux.c --- linux-2.6/drivers/s390/scsi/zfcp_aux.c 2009-03-01 16:41:37.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_aux.c 2009-03-01 16:41:37.000000000 +0100 @@ -524,7 +524,6 @@ int zfcp_adapter_enqueue(struct ccw_devi goto sysfs_failed; atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status); - zfcp_fc_nameserver_init(adapter); if (!zfcp_adapter_scsi_register(adapter)) return 0; diff -urpN linux-2.6/drivers/s390/scsi/zfcp_ccw.c linux-2.6-patched/drivers/s390/scsi/zfcp_ccw.c --- linux-2.6/drivers/s390/scsi/zfcp_ccw.c 2009-03-01 16:41:34.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_ccw.c 2009-03-01 16:41:37.000000000 +0100 @@ -3,7 +3,7 @@ * * Registration and callback for the s390 common I/O layer. * - * Copyright IBM Corporation 2002, 2008 + * Copyright IBM Corporation 2002, 2009 */ #define KMSG_COMPONENT "zfcp" @@ -108,6 +108,7 @@ static int zfcp_ccw_set_online(struct cc /* initialize request counter */ BUG_ON(!zfcp_reqlist_isempty(adapter)); adapter->req_no = 0; + zfcp_fc_nameserver_init(adapter); zfcp_erp_modify_adapter_status(adapter, "ccsonl1", NULL, ZFCP_STATUS_COMMON_RUNNING, ZFCP_SET); diff -urpN linux-2.6/drivers/s390/scsi/zfcp_fc.c linux-2.6-patched/drivers/s390/scsi/zfcp_fc.c --- linux-2.6/drivers/s390/scsi/zfcp_fc.c 2009-03-01 16:41:36.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_fc.c 2009-03-01 16:41:37.000000000 +0100 @@ -98,8 +98,12 @@ static void zfcp_wka_port_offline(struct struct zfcp_wka_port *wka_port = container_of(dw, struct zfcp_wka_port, work); - wait_event(wka_port->completion_wq, - atomic_read(&wka_port->refcount) == 0); + /* Don't wait forvever. If the wka_port is too busy take it offline + through a new call later */ + if (!wait_event_timeout(wka_port->completion_wq, + atomic_read(&wka_port->refcount) == 0, + HZ >> 1)) + return; mutex_lock(&wka_port->mutex); if ((atomic_read(&wka_port->refcount) != 0) || ^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2009-03-02 12:11 UTC | newest] Thread overview: 19+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-03-02 12:08 [patch 00/18] zfcp updates for 2.6.30 Christof Schmitt 2009-03-02 12:08 ` [patch 01/18] [PATCH] zfcp: Remove some port flags Christof Schmitt 2009-03-02 12:08 ` [patch 02/18] [PATCH] zfcp: Remove UNIT_REGISTERED status flag Christof Schmitt 2009-03-02 12:08 ` [patch 03/18] [Patch] zfcp: add measurement data for average qdio queue utilisation Christof Schmitt 2009-03-02 12:08 ` [patch 04/18] [PATCH] zfcp: Simplify latency lock handling Christof Schmitt 2009-03-02 12:08 ` [patch 05/18] [PATCH] zfcp: Only increment req_id for successfully issued requests Christof Schmitt 2009-03-02 12:08 ` [patch 06/18] [PATCH] zfcp: Wait for free SBALs when possible Christof Schmitt 2009-03-02 12:09 ` [patch 07/18] [PATCH] zfcp: Improve reliability of SCSI eh handlers in zfcp Christof Schmitt 2009-03-02 12:09 ` [patch 08/18] [PATCH] zfcp: Send ELS ADISC from workqueue Christof Schmitt 2009-03-02 12:09 ` [patch 09/18] [PATCH] zfcp: remove undefined subtype for status read response Christof Schmitt 2009-03-02 12:09 ` [patch 10/18] [PATCH] zfcp: prevent adapter close on initial adapter open Christof Schmitt 2009-03-02 12:09 ` [patch 11/18] [PATCH] zfcp: replace current ERP logging with a more convenient version Christof Schmitt 2009-03-02 12:09 ` [patch 12/18] [PATCH] zfcp: Remove PCI flag Christof Schmitt 2009-03-02 12:09 ` [patch 13/18] [PATCH] zfcp: Report fc_host_port_type as NPIV Christof Schmitt 2009-03-02 12:09 ` [patch 14/18] [PATCH] zfcp: incorrect reaction on incoming RSCN Christof Schmitt 2009-03-02 12:09 ` [patch 15/18] [PATCH] zfcp: Block FC transport rports early on errors Christof Schmitt 2009-03-02 12:09 ` [patch 16/18] [PATCH] zfcp: erp failed status bit will not be set Christof Schmitt 2009-03-02 12:09 ` [patch 17/18] [PATCH] zfcp: fix queue, scheduled work processing Christof Schmitt 2009-03-02 12:09 ` [patch 18/18] [PATCH] zfcp: Ensure all work is cancelled on adapter dequeue Christof Schmitt
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox