diff options
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_base.c')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index 6dec7cff316f..c167911221e9 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c | |||
@@ -112,9 +112,12 @@ _scsih_set_fwfault_debug(const char *val, struct kernel_param *kp) | |||
112 | if (ret) | 112 | if (ret) |
113 | return ret; | 113 | return ret; |
114 | 114 | ||
115 | /* global ioc spinlock to protect controller list on list operations */ | ||
115 | printk(KERN_INFO "setting fwfault_debug(%d)\n", mpt2sas_fwfault_debug); | 116 | printk(KERN_INFO "setting fwfault_debug(%d)\n", mpt2sas_fwfault_debug); |
117 | spin_lock(&gioc_lock); | ||
116 | list_for_each_entry(ioc, &mpt2sas_ioc_list, list) | 118 | list_for_each_entry(ioc, &mpt2sas_ioc_list, list) |
117 | ioc->fwfault_debug = mpt2sas_fwfault_debug; | 119 | ioc->fwfault_debug = mpt2sas_fwfault_debug; |
120 | spin_unlock(&gioc_lock); | ||
118 | return 0; | 121 | return 0; |
119 | } | 122 | } |
120 | 123 | ||
@@ -4437,6 +4440,8 @@ mpt2sas_base_free_resources(struct MPT2SAS_ADAPTER *ioc) | |||
4437 | dexitprintk(ioc, printk(MPT2SAS_INFO_FMT "%s\n", ioc->name, | 4440 | dexitprintk(ioc, printk(MPT2SAS_INFO_FMT "%s\n", ioc->name, |
4438 | __func__)); | 4441 | __func__)); |
4439 | 4442 | ||
4443 | /* synchronizing freeing resource with pci_access_mutex lock */ | ||
4444 | mutex_lock(&ioc->pci_access_mutex); | ||
4440 | if (ioc->chip_phys && ioc->chip) { | 4445 | if (ioc->chip_phys && ioc->chip) { |
4441 | _base_mask_interrupts(ioc); | 4446 | _base_mask_interrupts(ioc); |
4442 | ioc->shost_recovery = 1; | 4447 | ioc->shost_recovery = 1; |
@@ -4456,6 +4461,7 @@ mpt2sas_base_free_resources(struct MPT2SAS_ADAPTER *ioc) | |||
4456 | pci_disable_pcie_error_reporting(pdev); | 4461 | pci_disable_pcie_error_reporting(pdev); |
4457 | pci_disable_device(pdev); | 4462 | pci_disable_device(pdev); |
4458 | } | 4463 | } |
4464 | mutex_unlock(&ioc->pci_access_mutex); | ||
4459 | return; | 4465 | return; |
4460 | } | 4466 | } |
4461 | 4467 | ||