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.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index d1e75d36ed1a..8e989159e4ed 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -84,7 +84,7 @@ static void __init zfcp_init_device_configure(char *busid, u64 wwpn, u64 lun)
84 struct zfcp_port *port; 84 struct zfcp_port *port;
85 struct zfcp_unit *unit; 85 struct zfcp_unit *unit;
86 86
87 down(&zfcp_data.config_sema); 87 mutex_lock(&zfcp_data.config_mutex);
88 read_lock_irq(&zfcp_data.config_lock); 88 read_lock_irq(&zfcp_data.config_lock);
89 adapter = zfcp_get_adapter_by_busid(busid); 89 adapter = zfcp_get_adapter_by_busid(busid);
90 if (adapter) 90 if (adapter)
@@ -99,20 +99,20 @@ static void __init zfcp_init_device_configure(char *busid, u64 wwpn, u64 lun)
99 unit = zfcp_unit_enqueue(port, lun); 99 unit = zfcp_unit_enqueue(port, lun);
100 if (IS_ERR(unit)) 100 if (IS_ERR(unit))
101 goto out_unit; 101 goto out_unit;
102 up(&zfcp_data.config_sema); 102 mutex_unlock(&zfcp_data.config_mutex);
103 ccw_device_set_online(adapter->ccw_device); 103 ccw_device_set_online(adapter->ccw_device);
104 104
105 zfcp_erp_wait(adapter); 105 zfcp_erp_wait(adapter);
106 flush_work(&unit->scsi_work); 106 flush_work(&unit->scsi_work);
107 107
108 down(&zfcp_data.config_sema); 108 mutex_lock(&zfcp_data.config_mutex);
109 zfcp_unit_put(unit); 109 zfcp_unit_put(unit);
110out_unit: 110out_unit:
111 zfcp_port_put(port); 111 zfcp_port_put(port);
112out_port: 112out_port:
113 zfcp_adapter_put(adapter); 113 zfcp_adapter_put(adapter);
114out_adapter: 114out_adapter:
115 up(&zfcp_data.config_sema); 115 mutex_unlock(&zfcp_data.config_mutex);
116 return; 116 return;
117} 117}
118 118
@@ -176,7 +176,7 @@ static int __init zfcp_module_init(void)
176 if (!zfcp_data.gid_pn_cache) 176 if (!zfcp_data.gid_pn_cache)
177 goto out_gid_cache; 177 goto out_gid_cache;
178 178
179 sema_init(&zfcp_data.config_sema, 1); 179 mutex_init(&zfcp_data.config_mutex);
180 rwlock_init(&zfcp_data.config_lock); 180 rwlock_init(&zfcp_data.config_lock);
181 181
182 zfcp_data.scsi_transport_template = 182 zfcp_data.scsi_transport_template =
@@ -266,7 +266,7 @@ static void zfcp_sysfs_unit_release(struct device *dev)
266 * @port: pointer to port where unit is added 266 * @port: pointer to port where unit is added
267 * @fcp_lun: FCP LUN of unit to be enqueued 267 * @fcp_lun: FCP LUN of unit to be enqueued
268 * Returns: pointer to enqueued unit on success, ERR_PTR on error 268 * Returns: pointer to enqueued unit on success, ERR_PTR on error
269 * Locks: config_sema must be held to serialize changes to the unit list 269 * Locks: config_mutex must be held to serialize changes to the unit list
270 * 270 *
271 * Sets up some unit internal structures and creates sysfs entry. 271 * Sets up some unit internal structures and creates sysfs entry.
272 */ 272 */
@@ -356,7 +356,7 @@ void zfcp_unit_dequeue(struct zfcp_unit *unit)
356 356
357static int zfcp_allocate_low_mem_buffers(struct zfcp_adapter *adapter) 357static int zfcp_allocate_low_mem_buffers(struct zfcp_adapter *adapter)
358{ 358{
359 /* must only be called with zfcp_data.config_sema taken */ 359 /* must only be called with zfcp_data.config_mutex taken */
360 adapter->pool.erp_req = 360 adapter->pool.erp_req =
361 mempool_create_kmalloc_pool(1, sizeof(struct zfcp_fsf_req)); 361 mempool_create_kmalloc_pool(1, sizeof(struct zfcp_fsf_req));
362 if (!adapter->pool.erp_req) 362 if (!adapter->pool.erp_req)
@@ -404,7 +404,7 @@ static int zfcp_allocate_low_mem_buffers(struct zfcp_adapter *adapter)
404 404
405static void zfcp_free_low_mem_buffers(struct zfcp_adapter *adapter) 405static void zfcp_free_low_mem_buffers(struct zfcp_adapter *adapter)
406{ 406{
407 /* zfcp_data.config_sema must be held */ 407 /* zfcp_data.config_mutex must be held */
408 if (adapter->pool.erp_req) 408 if (adapter->pool.erp_req)
409 mempool_destroy(adapter->pool.erp_req); 409 mempool_destroy(adapter->pool.erp_req);
410 if (adapter->pool.scsi_req) 410 if (adapter->pool.scsi_req)
@@ -491,7 +491,7 @@ static void zfcp_destroy_adapter_work_queue(struct zfcp_adapter *adapter)
491 * Enqueues an adapter at the end of the adapter list in the driver data. 491 * Enqueues an adapter at the end of the adapter list in the driver data.
492 * All adapter internal structures are set up. 492 * All adapter internal structures are set up.
493 * Proc-fs entries are also created. 493 * Proc-fs entries are also created.
494 * locks: config_sema must be held to serialise changes to the adapter list 494 * locks: config_mutex must be held to serialize changes to the adapter list
495 */ 495 */
496int zfcp_adapter_enqueue(struct ccw_device *ccw_device) 496int zfcp_adapter_enqueue(struct ccw_device *ccw_device)
497{ 497{
@@ -499,7 +499,7 @@ int zfcp_adapter_enqueue(struct ccw_device *ccw_device)
499 499
500 /* 500 /*
501 * Note: It is safe to release the list_lock, as any list changes 501 * Note: It is safe to release the list_lock, as any list changes
502 * are protected by the config_sema, which must be held to get here 502 * are protected by the config_mutex, which must be held to get here
503 */ 503 */
504 504
505 adapter = kzalloc(sizeof(struct zfcp_adapter), GFP_KERNEL); 505 adapter = kzalloc(sizeof(struct zfcp_adapter), GFP_KERNEL);
@@ -630,7 +630,7 @@ static void zfcp_sysfs_port_release(struct device *dev)
630 * @status: initial status for the port 630 * @status: initial status for the port
631 * @d_id: destination id of the remote port to be enqueued 631 * @d_id: destination id of the remote port to be enqueued
632 * Returns: pointer to enqueued port on success, ERR_PTR on error 632 * Returns: pointer to enqueued port on success, ERR_PTR on error
633 * Locks: config_sema must be held to serialize changes to the port list 633 * Locks: config_mutex must be held to serialize changes to the port list
634 * 634 *
635 * All port internal structures are set up and the sysfs entry is generated. 635 * All port internal structures are set up and the sysfs entry is generated.
636 * d_id is used to enqueue ports with a well known address like the Directory 636 * d_id is used to enqueue ports with a well known address like the Directory