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.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index 1be6bf7e8ce6..0f79f3af4f54 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -80,28 +80,35 @@ int zfcp_reqlist_isempty(struct zfcp_adapter *adapter)
80 80
81static void __init zfcp_init_device_configure(char *busid, u64 wwpn, u64 lun) 81static void __init zfcp_init_device_configure(char *busid, u64 wwpn, u64 lun)
82{ 82{
83 struct ccw_device *ccwdev;
83 struct zfcp_adapter *adapter; 84 struct zfcp_adapter *adapter;
84 struct zfcp_port *port; 85 struct zfcp_port *port;
85 struct zfcp_unit *unit; 86 struct zfcp_unit *unit;
86 87
87 mutex_lock(&zfcp_data.config_mutex); 88 ccwdev = get_ccwdev_by_busid(&zfcp_ccw_driver, busid);
88 read_lock_irq(&zfcp_data.config_lock); 89 if (!ccwdev)
89 adapter = zfcp_get_adapter_by_busid(busid); 90 return;
90 if (adapter) 91
91 zfcp_adapter_get(adapter); 92 if (ccw_device_set_online(ccwdev))
92 read_unlock_irq(&zfcp_data.config_lock); 93 goto out_ccwdev;
93 94
95 mutex_lock(&zfcp_data.config_mutex);
96 adapter = dev_get_drvdata(&ccwdev->dev);
94 if (!adapter) 97 if (!adapter)
95 goto out_adapter; 98 goto out_unlock;
96 port = zfcp_port_enqueue(adapter, wwpn, 0, 0); 99 zfcp_adapter_get(adapter);
97 if (IS_ERR(port)) 100
101 port = zfcp_get_port_by_wwpn(adapter, wwpn);
102 if (!port)
98 goto out_port; 103 goto out_port;
104
105 zfcp_port_get(port);
99 unit = zfcp_unit_enqueue(port, lun); 106 unit = zfcp_unit_enqueue(port, lun);
100 if (IS_ERR(unit)) 107 if (IS_ERR(unit))
101 goto out_unit; 108 goto out_unit;
102 mutex_unlock(&zfcp_data.config_mutex); 109 mutex_unlock(&zfcp_data.config_mutex);
103 ccw_device_set_online(adapter->ccw_device);
104 110
111 zfcp_erp_unit_reopen(unit, 0, "auidc_1", NULL);
105 zfcp_erp_wait(adapter); 112 zfcp_erp_wait(adapter);
106 flush_work(&unit->scsi_work); 113 flush_work(&unit->scsi_work);
107 114
@@ -111,8 +118,10 @@ out_unit:
111 zfcp_port_put(port); 118 zfcp_port_put(port);
112out_port: 119out_port:
113 zfcp_adapter_put(adapter); 120 zfcp_adapter_put(adapter);
114out_adapter: 121out_unlock:
115 mutex_unlock(&zfcp_data.config_mutex); 122 mutex_unlock(&zfcp_data.config_mutex);
123out_ccwdev:
124 put_device(&ccwdev->dev);
116 return; 125 return;
117} 126}
118 127
@@ -593,10 +602,8 @@ void zfcp_adapter_dequeue(struct zfcp_adapter *adapter)
593 int retval = 0; 602 int retval = 0;
594 unsigned long flags; 603 unsigned long flags;
595 604
596 cancel_work_sync(&adapter->scan_work);
597 cancel_work_sync(&adapter->stat_work); 605 cancel_work_sync(&adapter->stat_work);
598 zfcp_fc_wka_ports_force_offline(adapter->gs); 606 zfcp_fc_wka_ports_force_offline(adapter->gs);
599 zfcp_adapter_scsi_unregister(adapter);
600 sysfs_remove_group(&adapter->ccw_device->dev.kobj, 607 sysfs_remove_group(&adapter->ccw_device->dev.kobj,
601 &zfcp_sysfs_adapter_attrs); 608 &zfcp_sysfs_adapter_attrs);
602 dev_set_drvdata(&adapter->ccw_device->dev, NULL); 609 dev_set_drvdata(&adapter->ccw_device->dev, NULL);