> @@ -79,7 +79,8 @@ static int _scsih_scan_finished(struct Scsi_Host *shost,
> unsigned long time);
>
> /* global parameters */
> LIST_HEAD(mpt2sas_ioc_list);
> -
> +/* global ioc lock for list operations */
> +spinlock_t gioc_lock;
> /* local parameters */
> static u8 scsi_io_cb_idx = -1;
> static u8 tm_cb_idx = -1;
> @@ -279,6 +280,20 @@ static struct pci_device_id scsih_pci_table[] = {
> MODULE_DEVICE_TABLE(pci, scsih_pci_table);
>
> /**
> + * mpt2sas_initialize_gioc_lock - initialize the gobal ioc lock
> + */
> +void
> +mpt2sas_initialize_gioc_lock(void)
> +{
> + static int gioc_lock_initialize;
> +
> + if (!gioc_lock_initialize) {
> + spin_lock_init(&gioc_lock);
> + gioc_lock_initialize = 1;
> + }
> +}
Just use DEFINE_SPINLOCK() to initialize the lock at compile time.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in