aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_aux.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_aux.c')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 8af7dfbe022c..616c60ffcf2c 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Module interface and handling of zfcp data structures. 4 * Module interface and handling of zfcp data structures.
5 * 5 *
6 * Copyright IBM Corporation 2002, 2008 6 * Copyright IBM Corporation 2002, 2009
7 */ 7 */
8 8
9/* 9/*
@@ -249,8 +249,8 @@ struct zfcp_port *zfcp_get_port_by_wwpn(struct zfcp_adapter *adapter,
249 struct zfcp_port *port; 249 struct zfcp_port *port;
250 250
251 list_for_each_entry(port, &adapter->port_list_head, list) 251 list_for_each_entry(port, &adapter->port_list_head, list)
252 if ((port->wwpn == wwpn) && !(atomic_read(&port->status) & 252 if ((port->wwpn == wwpn) &&
253 (ZFCP_STATUS_PORT_NO_WWPN | ZFCP_STATUS_COMMON_REMOVE))) 253 !(atomic_read(&port->status) & ZFCP_STATUS_COMMON_REMOVE))
254 return port; 254 return port;
255 return NULL; 255 return NULL;
256} 256}
@@ -421,7 +421,8 @@ int zfcp_status_read_refill(struct zfcp_adapter *adapter)
421 while (atomic_read(&adapter->stat_miss) > 0) 421 while (atomic_read(&adapter->stat_miss) > 0)
422 if (zfcp_fsf_status_read(adapter)) { 422 if (zfcp_fsf_status_read(adapter)) {
423 if (atomic_read(&adapter->stat_miss) >= 16) { 423 if (atomic_read(&adapter->stat_miss) >= 16) {
424 zfcp_erp_adapter_reopen(adapter, 0, 103, NULL); 424 zfcp_erp_adapter_reopen(adapter, 0, "axsref1",
425 NULL);
425 return 1; 426 return 1;
426 } 427 }
427 break; 428 break;
@@ -501,6 +502,7 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device)
501 spin_lock_init(&adapter->scsi_dbf_lock); 502 spin_lock_init(&adapter->scsi_dbf_lock);
502 spin_lock_init(&adapter->rec_dbf_lock); 503 spin_lock_init(&adapter->rec_dbf_lock);
503 spin_lock_init(&adapter->req_q_lock); 504 spin_lock_init(&adapter->req_q_lock);
505 spin_lock_init(&adapter->qdio_stat_lock);
504 506
505 rwlock_init(&adapter->erp_lock); 507 rwlock_init(&adapter->erp_lock);
506 rwlock_init(&adapter->abort_lock); 508 rwlock_init(&adapter->abort_lock);
@@ -522,7 +524,6 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device)
522 goto sysfs_failed; 524 goto sysfs_failed;
523 525
524 atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status); 526 atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &adapter->status);
525 zfcp_fc_nameserver_init(adapter);
526 527
527 if (!zfcp_adapter_scsi_register(adapter)) 528 if (!zfcp_adapter_scsi_register(adapter))
528 return 0; 529 return 0;
@@ -552,6 +553,7 @@ void zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
552 553
553 cancel_work_sync(&adapter->scan_work); 554 cancel_work_sync(&adapter->scan_work);
554 cancel_work_sync(&adapter->stat_work); 555 cancel_work_sync(&adapter->stat_work);
556 cancel_delayed_work_sync(&adapter->nsp.work);
555 zfcp_adapter_scsi_unregister(adapter); 557 zfcp_adapter_scsi_unregister(adapter);
556 sysfs_remove_group(&adapter->ccw_device->dev.kobj, 558 sysfs_remove_group(&adapter->ccw_device->dev.kobj,
557 &zfcp_sysfs_adapter_attrs); 559 &zfcp_sysfs_adapter_attrs);
@@ -603,10 +605,13 @@ struct zfcp_port *zfcp_port_enqueue(struct zfcp_adapter *adapter, u64 wwpn,
603 init_waitqueue_head(&port->remove_wq); 605 init_waitqueue_head(&port->remove_wq);
604 INIT_LIST_HEAD(&port->unit_list_head); 606 INIT_LIST_HEAD(&port->unit_list_head);
605 INIT_WORK(&port->gid_pn_work, zfcp_erp_port_strategy_open_lookup); 607 INIT_WORK(&port->gid_pn_work, zfcp_erp_port_strategy_open_lookup);
608 INIT_WORK(&port->test_link_work, zfcp_fc_link_test_work);
609 INIT_WORK(&port->rport_work, zfcp_scsi_rport_work);
606 610
607 port->adapter = adapter; 611 port->adapter = adapter;
608 port->d_id = d_id; 612 port->d_id = d_id;
609 port->wwpn = wwpn; 613 port->wwpn = wwpn;
614 port->rport_task = RPORT_NONE;
610 615
611 /* mark port unusable as long as sysfs registration is not complete */ 616 /* mark port unusable as long as sysfs registration is not complete */
612 atomic_set_mask(status | ZFCP_STATUS_COMMON_REMOVE, &port->status); 617 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,
620 dev_set_drvdata(&port->sysfs_device, port); 625 dev_set_drvdata(&port->sysfs_device, port);
621 626
622 read_lock_irq(&zfcp_data.config_lock); 627 read_lock_irq(&zfcp_data.config_lock);
623 if (!(status & ZFCP_STATUS_PORT_NO_WWPN)) 628 if (zfcp_get_port_by_wwpn(adapter, wwpn)) {
624 if (zfcp_get_port_by_wwpn(adapter, wwpn)) { 629 read_unlock_irq(&zfcp_data.config_lock);
625 read_unlock_irq(&zfcp_data.config_lock); 630 goto err_out_free;
626 goto err_out_free; 631 }
627 }
628 read_unlock_irq(&zfcp_data.config_lock); 632 read_unlock_irq(&zfcp_data.config_lock);
629 633
630 if (device_register(&port->sysfs_device)) 634 if (device_register(&port->sysfs_device))