diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2009-09-24 04:23:22 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-10-02 10:49:47 -0400 |
commit | c5afd81e5d7ebacc9dd23954e169ac79a34fe399 (patch) | |
tree | 91de28df6297b9823d6eb10533b7728a4b48e6ba /drivers/s390/scsi/zfcp_aux.c | |
parent | b1a58985853574346f1518531bdd82069501b317 (diff) |
[SCSI] zfcp: Fix initial device and cfdc for delayed adapter allocation
With the change for delaying the allocation of zfcp_adapter, the
initial device parameter function has to first call
ccw_device_set_online which allocates the zfcp_adapter structure.
Change this and adapt the cfdc part accordingly.
Reviewed-by: Felix Beck <felix.beck@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_aux.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_aux.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 1be6bf7e8ce6..351d2e711ec5 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 | ||
81 | static void __init zfcp_init_device_configure(char *busid, u64 wwpn, u64 lun) | 81 | static 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); |
112 | out_port: | 119 | out_port: |
113 | zfcp_adapter_put(adapter); | 120 | zfcp_adapter_put(adapter); |
114 | out_adapter: | 121 | out_unlock: |
115 | mutex_unlock(&zfcp_data.config_mutex); | 122 | mutex_unlock(&zfcp_data.config_mutex); |
123 | out_ccwdev: | ||
124 | put_device(&ccwdev->dev); | ||
116 | return; | 125 | return; |
117 | } | 126 | } |
118 | 127 | ||