]> err.no Git - linux-2.6/commitdiff
[SCSI] zfcp: fix spinlock initialization
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Thu, 1 Dec 2005 01:46:32 +0000 (02:46 +0100)
committerJames Bottomley <jejb@mulgrave.(none)>
Thu, 1 Dec 2005 21:59:46 +0000 (15:59 -0600)
Move initialization of locks and lists to adapter allocation function.
Otherwise we might end up with some uninitialized locks, like e.g. the
erp locks which only will be inititialized if an error recovery thread
for an adapter will be started.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/s390/scsi/zfcp_aux.c
drivers/s390/scsi/zfcp_dbf.c
drivers/s390/scsi/zfcp_erp.c

index c218b5c944a6f1d54f2f89df3bc8994fee3c9a23..5e84c5aa777977fac96b7b86d42be9547b70f779 100644 (file)
@@ -996,6 +996,20 @@ zfcp_adapter_enqueue(struct ccw_device *ccw_device)
        spin_lock_init(&adapter->fsf_req_list_lock);
        INIT_LIST_HEAD(&adapter->fsf_req_list_head);
 
+       /* initialize debug locks */
+
+       spin_lock_init(&adapter->erp_dbf_lock);
+       spin_lock_init(&adapter->hba_dbf_lock);
+       spin_lock_init(&adapter->san_dbf_lock);
+       spin_lock_init(&adapter->scsi_dbf_lock);
+
+       /* initialize error recovery stuff */
+
+       rwlock_init(&adapter->erp_lock);
+       sema_init(&adapter->erp_ready_sem, 0);
+       INIT_LIST_HEAD(&adapter->erp_ready_head);
+       INIT_LIST_HEAD(&adapter->erp_running_head);
+
        /* initialize abort lock */
        rwlock_init(&adapter->abort_lock);
 
index 826fb3b0060564b6af7117ef320f08392f4447f2..95599719f8ab9e02c8294b53e3885c7df7087c6a 100644 (file)
@@ -926,7 +926,6 @@ int zfcp_adapter_debug_register(struct zfcp_adapter *adapter)
        char dbf_name[DEBUG_MAX_NAME_LEN];
 
        /* debug feature area which records recovery activity */
-       spin_lock_init(&adapter->erp_dbf_lock);
        sprintf(dbf_name, "zfcp_%s_erp", zfcp_get_busid_by_adapter(adapter));
        adapter->erp_dbf = debug_register(dbf_name, dbfsize, 2,
                                          sizeof(struct zfcp_erp_dbf_record));
@@ -936,7 +935,6 @@ int zfcp_adapter_debug_register(struct zfcp_adapter *adapter)
        debug_set_level(adapter->erp_dbf, 3);
 
        /* debug feature area which records HBA (FSF and QDIO) conditions */
-       spin_lock_init(&adapter->hba_dbf_lock);
        sprintf(dbf_name, "zfcp_%s_hba", zfcp_get_busid_by_adapter(adapter));
        adapter->hba_dbf = debug_register(dbf_name, dbfsize, 1,
                                          sizeof(struct zfcp_hba_dbf_record));
@@ -947,7 +945,6 @@ int zfcp_adapter_debug_register(struct zfcp_adapter *adapter)
        debug_set_level(adapter->hba_dbf, 3);
 
        /* debug feature area which records SAN command failures and recovery */
-       spin_lock_init(&adapter->san_dbf_lock);
        sprintf(dbf_name, "zfcp_%s_san", zfcp_get_busid_by_adapter(adapter));
        adapter->san_dbf = debug_register(dbf_name, dbfsize, 1,
                                          sizeof(struct zfcp_san_dbf_record));
@@ -958,7 +955,6 @@ int zfcp_adapter_debug_register(struct zfcp_adapter *adapter)
        debug_set_level(adapter->san_dbf, 6);
 
        /* debug feature area which records SCSI command failures and recovery */
-       spin_lock_init(&adapter->scsi_dbf_lock);
        sprintf(dbf_name, "zfcp_%s_scsi", zfcp_get_busid_by_adapter(adapter));
        adapter->scsi_dbf = debug_register(dbf_name, dbfsize, 1,
                                           sizeof(struct zfcp_scsi_dbf_record));
index 023f4e558ae426aa2fd9bc349aaecca53686715d..8d503d9c8af778e5827d446fb8afee827af614de 100644 (file)
@@ -1071,11 +1071,6 @@ zfcp_erp_thread_setup(struct zfcp_adapter *adapter)
 
        atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status);
 
-       rwlock_init(&adapter->erp_lock);
-       INIT_LIST_HEAD(&adapter->erp_ready_head);
-       INIT_LIST_HEAD(&adapter->erp_running_head);
-       sema_init(&adapter->erp_ready_sem, 0);
-
        retval = kernel_thread(zfcp_erp_thread, adapter, SIGCHLD);
        if (retval < 0) {
                ZFCP_LOG_NORMAL("error: creation of erp thread failed for "