All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] ipr: Wait to do async scan until scsi host is initialized
@ 2016-07-15 19:48 Brian King
  2016-07-26 14:07 ` Gabriel Krisman Bertazi
  2016-07-27  4:09 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Brian King @ 2016-07-15 19:48 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, brking


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>
---

 drivers/scsi/ipr.c |    9 +++++++++
 drivers/scsi/ipr.h |    1 +
 2 files changed, 10 insertions(+)

diff -puN drivers/scsi/ipr.c~ipr_async_scan_fixup drivers/scsi/ipr.c
--- linux-2.6.git/drivers/scsi/ipr.c~ipr_async_scan_fixup	2016-07-15 14:47:13.412003811 -0500
+++ linux-2.6.git-bjking1/drivers/scsi/ipr.c	2016-07-15 14:47:13.422003757 -0500
@@ -3288,6 +3288,11 @@ static void ipr_worker_thread(struct wor
 		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 *p
 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 *pde
 		}
 	}
 
+	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;
 }
 
diff -puN drivers/scsi/ipr.h~ipr_async_scan_fixup drivers/scsi/ipr.h
--- linux-2.6.git/drivers/scsi/ipr.h~ipr_async_scan_fixup	2016-07-15 14:47:13.415003795 -0500
+++ linux-2.6.git-bjking1/drivers/scsi/ipr.h	2016-07-15 14:47:13.424003746 -0500
@@ -1478,6 +1478,7 @@ struct ipr_ioa_cfg {
 	u8 in_ioa_bringdown:1;
 	u8 ioa_unit_checked:1;
 	u8 dump_taken:1;
+	u8 scan_enabled:1;
 	u8 scan_done:1;
 	u8 needs_hard_reset:1;
 	u8 dual_raid:1;
_


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] ipr: Wait to do async scan until scsi host is initialized
  2016-07-15 19:48 [PATCH 1/1] ipr: Wait to do async scan until scsi host is initialized Brian King
@ 2016-07-26 14:07 ` Gabriel Krisman Bertazi
  2016-07-27  4:09 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Gabriel Krisman Bertazi @ 2016-07-26 14:07 UTC (permalink / raw)
  To: Brian King; +Cc: James.Bottomley, linux-scsi

Brian King <brking@linux.vnet.ibm.com> writes:

> When performing an async scan, make sure the kthread doing scanning
> doesn't start before the scsi host is fully initialized.
>

Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>

-- 
Gabriel Krisman Bertazi


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] ipr: Wait to do async scan until scsi host is initialized
  2016-07-15 19:48 [PATCH 1/1] ipr: Wait to do async scan until scsi host is initialized Brian King
  2016-07-26 14:07 ` Gabriel Krisman Bertazi
@ 2016-07-27  4:09 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2016-07-27  4:09 UTC (permalink / raw)
  To: Brian King; +Cc: James.Bottomley, linux-scsi

>>>>> "Brian" == Brian King <brking@linux.vnet.ibm.com> writes:

Brian> When performing an async scan, make sure the kthread doing
Brian> scanning doesn't start before the scsi host is fully initialized.

Applied to 4.8/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-27  4:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15 19:48 [PATCH 1/1] ipr: Wait to do async scan until scsi host is initialized Brian King
2016-07-26 14:07 ` Gabriel Krisman Bertazi
2016-07-27  4:09 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.