zfcp: fix spinlock initialization
Subsystems (3)
PATCH 1/4 zfcp: fix spinlock initialization
From: Heiko Carstens <[email protected]>
[patch 1/4] zfcp: fix spinlock initialization
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 <[email protected]>
Signed-off-by Andreas Herrmann <[email protected]>
drivers/s390/scsi/zfcp_aux.c +14 -0
@@ -996,6 +996,20 @@ zfcp_adapter_enqueue(struct 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);
drivers/s390/scsi/zfcp_dbf.c +0 -4
@@ -926,7 +926,6 @@ int zfcp_adapter_debug_register(struct zchar 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 zdebug_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 zdebug_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 zdebug_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 ));
drivers/s390/scsi/zfcp_erp.c +0 -5
@@ -1071,11 +1071,6 @@ zfcp_erp_thread_setup(struct zfcp_adapteatomic_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 "