Commit b195d5e2 authored by Brian King's avatar Brian King Committed by Martin K. Petersen

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: default avatarBrian King <brking@linux.vnet.ibm.com>
Reviewed-by: default avatarGabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent b2c0627c
...@@ -3288,6 +3288,11 @@ static void ipr_worker_thread(struct work_struct *work) ...@@ -3288,6 +3288,11 @@ static void ipr_worker_thread(struct work_struct *work)
return; return;
} }
if (!ioa_cfg->scan_enabled) {
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
return;
}
restart: restart:
do { do {
did_work = 0; did_work = 0;
...@@ -10362,6 +10367,7 @@ static void ipr_remove(struct pci_dev *pdev) ...@@ -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) static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
{ {
struct ipr_ioa_cfg *ioa_cfg; struct ipr_ioa_cfg *ioa_cfg;
unsigned long flags;
int rc, i; int rc, i;
rc = ipr_probe_ioa(pdev, dev_id); 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) ...@@ -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); schedule_work(&ioa_cfg->work_q);
spin_unlock_irqrestore(ioa_cfg->host->host_lock, flags);
return 0; return 0;
} }
......
...@@ -1478,6 +1478,7 @@ struct ipr_ioa_cfg { ...@@ -1478,6 +1478,7 @@ struct ipr_ioa_cfg {
u8 in_ioa_bringdown:1; u8 in_ioa_bringdown:1;
u8 ioa_unit_checked:1; u8 ioa_unit_checked:1;
u8 dump_taken:1; u8 dump_taken:1;
u8 scan_enabled:1;
u8 scan_done:1; u8 scan_done:1;
u8 needs_hard_reset:1; u8 needs_hard_reset:1;
u8 dual_raid:1; u8 dual_raid:1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment