diff options
author | Brian King <brking@linux.vnet.ibm.com> | 2016-07-15 21:48:03 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-07-27 06:32:07 +0200 |
commit | b195d5e2bffd3de3f07e8683e6abddf099ea0822 (patch) | |
tree | 8b605a7a6e0b292df21074f70be25ab975cf82d9 /drivers/scsi/ipr.c | |
parent | MAINTAINERS: Update cxlflash maintainers (diff) | |
download | linux-b195d5e2bffd3de3f07e8683e6abddf099ea0822.tar.xz linux-b195d5e2bffd3de3f07e8683e6abddf099ea0822.zip |
ipr: Wait to do async scan until scsi host is initialized
When performing an async scan, make sure the kthread doing scanning
doesn't start before the scsi host is fully initialized.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ipr.c')
-rw-r--r-- | drivers/scsi/ipr.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index 1f539c288ae8..95e4834c58ee 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -3288,6 +3288,11 @@ static void ipr_worker_thread(struct work_struct *work) return; } + if (!ioa_cfg->scan_enabled) { + spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); + return; + } + restart: do { did_work = 0; @@ -10362,6 +10367,7 @@ static void ipr_remove(struct pci_dev *pdev) static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) { struct ipr_ioa_cfg *ioa_cfg; + unsigned long flags; int rc, i; rc = ipr_probe_ioa(pdev, dev_id); @@ -10414,7 +10420,10 @@ static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id) } } + spin_lock_irqsave(ioa_cfg->host->host_lock, flags); + ioa_cfg->scan_enabled = 1; schedule_work(&ioa_cfg->work_q); + spin_unlock_irqrestore(ioa_cfg->host->host_lock, flags); return 0; } |