diff options
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 24 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_ccw.c | 24 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_dbf.c | 188 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_dbf.h | 3 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_def.h | 17 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 290 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_ext.h | 73 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fc.c | 82 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 240 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.h | 4 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_qdio.c | 47 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 250 | ||||
-rw-r--r-- | drivers/s390/scsi/zfcp_sysfs.c | 20 |
13 files changed, 586 insertions, 676 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 8af7dfbe022..616c60ffcf2 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -3,7 +3,7 @@ * * Module interface and handling of zfcp data structures. * - * Copyright IBM Corporation 2002, 2008 + * Copyright IBM Corporation 2002, 2009 */ /* @@ -249,8 +249,8 @@ struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *adapter, 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; } @@ -421,7 +421,8 @@ int zfcp_status_read_refill(struct zfcp_adapter *adapter) 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; @@ -501,6 +502,7 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device) 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); @@ -522,7 +524,6 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device) 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; @@ -552,6 +553,7 @@ void zfcp_adapter_dequeue(struct zfcp_adapter *adapter) 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); @@ -603,10 +605,13 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn, 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); + 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); @@ -620,11 +625,10 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn, 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 --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index 285881f0764..1fe1e2eda51 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c @@ -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" @@ -72,8 +72,7 @@ static void zfcp_ccw_remove(struct ccw_device *ccw_device) 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); } @@ -109,11 +108,12 @@ static int zfcp_ccw_set_online(struct ccw_device *ccw_device) /* initialize request counter */ BUG_ON(!zfcp_reqlist_isempty(adapter)); adapter->req_no = 0; + zfcp_fc_nameserver_init(adapter); - 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); @@ -137,7 +137,7 @@ static int zfcp_ccw_set_offline(struct ccw_device *ccw_device) down(&zfcp_data.config_sema); adapter = dev_get_drvdata(&ccw_device->dev); - zfcp_erp_adapter_shutdown(adapter, 0, 86, NULL); + zfcp_erp_adapter_shutdown(adapter, 0, "ccsoff1", NULL); zfcp_erp_wait(adapter); zfcp_erp_thread_kill(adapter); up(&zfcp_data.config_sema); @@ -160,21 +160,21 @@ static int zfcp_ccw_notify(struct ccw_device *ccw_device, int event) 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; @@ -190,7 +190,7 @@ static void zfcp_ccw_shutdown(struct ccw_device *cdev) down(&zfcp_data.config_sema); adapter = dev_get_drvdata(&cdev->dev); - zfcp_erp_adapter_shutdown(adapter, 0, 90, NULL); + zfcp_erp_adapter_shutdown(adapter, 0, "ccshut1", NULL); zfcp_erp_wait(adapter); up(&zfcp_data.config_sema); } diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c index cb6df609953..0a1a5dd8d01 100644 --- a/drivers/s390/scsi/zfcp_dbf.c +++ b/drivers/s390/scsi/zfcp_dbf.c @@ -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] = "status read physical port closed in error", - [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_view = { * @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, struct zfcp_adapter *adapter) 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, struct zfcp_adapter *adapter) * @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 id2, struct zfcp_adapter *adapter) 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 id2, void *ref, 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 id2, void *ref, * @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, void *ref, struct zfcp_adapter *adapter) * @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, struct zfcp_port *port) * @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 *ref, struct zfcp_unit *unit) * @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, void *ref, u8 want, u8 need, 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, void *ref, u8 want, u8 need, * @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, struct zfcp_erp_action *erp_action) 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; diff --git a/drivers/s390/scsi/zfcp_dbf.h b/drivers/s390/scsi/zfcp_dbf.h index 74998ff88e5..a573f7344dd 100644 --- a/drivers/s390/scsi/zfcp_dbf.h +++ b/drivers/s390/scsi/zfcp_dbf.h @@ -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; diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 510662783a6..a0318630f04 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h @@ -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 @@ -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 { @@ -258,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) */ @@ -447,8 +443,9 @@ 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; u32 fsf_req_seq_no; /* FSF cmnd seq number */ wait_queue_head_t request_wq; /* can be used to wait for more avaliable SBALs */ @@ -514,6 +511,9 @@ struct zfcp_port { u32 maxframe_size; 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 { @@ -587,9 +587,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 diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 387a3af528a..631bdb1dfd6 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -3,7 +3,7 @@ * * Error Recovery Procedures (ERP). * - * Copyright IBM Corporation 2002, 2008 + * Copyright IBM Corporation 2002, 2009 */ #define KMSG_COMPONENT "zfcp" @@ -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 zfcp_erp_action *act) 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_setup_act(int need, 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 want, struct zfcp_adapter *adapter, ++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,14 @@ static int zfcp_erp_action_enqueue(int want, struct zfcp_adapter *adapter, } 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); + zfcp_scsi_schedule_rports_block(adapter); /* 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 +259,7 @@ static int _zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, * @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 +278,7 @@ void zfcp_erp_adapter_reopen(struct zfcp_adapter *adapter, int clear, * @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 +291,8 @@ void zfcp_erp_adapter_shutdown(struct zfcp_adapter *adapter, int clear, * @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 +305,8 @@ void zfcp_erp_port_shutdown(struct zfcp_port *port, int clear, u8 id, void *ref) * @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,15 +314,16 @@ void zfcp_erp_unit_shutdown(struct zfcp_unit *unit, int clear, u8 id, void *ref) 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); + zfcp_scsi_schedule_rport_block(port); if (atomic_read(&port->status) & ZFCP_STATUS_COMMON_ERP_FAILED) return; @@ -334,7 +338,7 @@ static void _zfcp_erp_port_forced_reopen(struct zfcp_port *port, * @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 +351,15 @@ void zfcp_erp_port_forced_reopen(struct zfcp_port *port, int clear, u8 id, 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); + zfcp_scsi_schedule_rport_block(port); 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 +374,7 @@ static int _zfcp_erp_port_reopen(struct zfcp_port *port, int clear, u8 id, * * 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 +391,12 @@ int zfcp_erp_port_reopen(struct zfcp_port *port, int clear, u8 id, void *ref) 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 +416,8 @@ static void _zfcp_erp_unit_reopen(struct zfcp_unit *unit, int clear, u8 id, * @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 +443,28 @@ static int status_change_clear(unsigned long mask, atomic_t *status) 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 +480,11 @@ static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act) 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 +536,7 @@ static void zfcp_erp_strategy_memwait(struct zfcp_erp_action *erp_action) } 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 +544,8 @@ static void _zfcp_erp_port_reopen_all(struct zfcp_adapter *adapter, _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 +565,28 @@ static void zfcp_erp_strategy_followup_actions(struct zfcp_erp_action *act) 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 +623,7 @@ static void zfcp_erp_enqueue_ptp_port(struct zfcp_adapter *adapter) 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 +646,9 @@ static int zfcp_erp_adapter_strat_fsf_xconf(struct zfcp_erp_action *erp_action) 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 +687,9 @@ static int zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *act) 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; @@ -705,60 +711,59 @@ static int zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *act) 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); 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_C |