Skip to content

Commit b195d5e

Browse files
bjking1martinkpetersen
authored andcommitted
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 <[email protected]> Reviewed-by: Gabriel Krisman Bertazi <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent b2c0627 commit b195d5e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

drivers/scsi/ipr.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,6 +3288,11 @@ static void ipr_worker_thread(struct work_struct *work)
32883288
return;
32893289
}
32903290

3291+
if (!ioa_cfg->scan_enabled) {
3292+
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
3293+
return;
3294+
}
3295+
32913296
restart:
32923297
do {
32933298
did_work = 0;
@@ -10362,6 +10367,7 @@ static void ipr_remove(struct pci_dev *pdev)
1036210367
static int ipr_probe(struct pci_dev *pdev, const struct pci_device_id *dev_id)
1036310368
{
1036410369
struct ipr_ioa_cfg *ioa_cfg;
10370+
unsigned long flags;
1036510371
int rc, i;
1036610372

1036710373
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)
1041410420
}
1041510421
}
1041610422

10423+
spin_lock_irqsave(ioa_cfg->host->host_lock, flags);
10424+
ioa_cfg->scan_enabled = 1;
1041710425
schedule_work(&ioa_cfg->work_q);
10426+
spin_unlock_irqrestore(ioa_cfg->host->host_lock, flags);
1041810427
return 0;
1041910428
}
1042010429

drivers/scsi/ipr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,6 +1478,7 @@ struct ipr_ioa_cfg {
14781478
u8 in_ioa_bringdown:1;
14791479
u8 ioa_unit_checked:1;
14801480
u8 dump_taken:1;
1481+
u8 scan_enabled:1;
14811482
u8 scan_done:1;
14821483
u8 needs_hard_reset:1;
14831484
u8 dual_raid:1;

0 commit comments

Comments
 (0)