All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] ibmvfc: do not wait for initial device scan
@ 2021-08-17  7:53 mwilck
  2021-08-18  2:26 ` Martin K. Petersen
  2021-08-24  4:03 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: mwilck @ 2021-08-17  7:53 UTC (permalink / raw)
  To: Martin K. Petersen, Tyrel Datwyler, Hannes Reinecke; +Cc: linux-scsi

From: Hannes Reinecke <hare@suse.de>

The initial device scan might take some time, and there really is
no need to wait for it during probe().
So return immediately from scsi_scan_host() during probe() and avoid
any udev stalls during booting.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Acked-by: Tyrel Datwyler <tyreld@linux.ibm.com>
---
Patch resent unchanged, with my s-o-b and Tyler's a-b added.

 drivers/scsi/ibmvscsi/ibmvfc.c | 11 ++++++++---
 drivers/scsi/ibmvscsi/ibmvfc.h |  1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 935b01ee44b7..9d6550488db1 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -3292,14 +3292,18 @@ static int ibmvfc_scan_finished(struct Scsi_Host *shost, unsigned long time)
 	int done = 0;
 
 	spin_lock_irqsave(shost->host_lock, flags);
-	if (time >= (init_timeout * HZ)) {
+	if (!vhost->scan_timeout)
+		done = 1;
+	else if (time >= (vhost->scan_timeout * HZ)) {
 		dev_info(vhost->dev, "Scan taking longer than %d seconds, "
-			 "continuing initialization\n", init_timeout);
+			 "continuing initialization\n", vhost->scan_timeout);
 		done = 1;
 	}
 
-	if (vhost->scan_complete)
+	if (vhost->scan_complete) {
+		vhost->scan_timeout = init_timeout;
 		done = 1;
+	}
 	spin_unlock_irqrestore(shost->host_lock, flags);
 	return done;
 }
@@ -6084,6 +6088,7 @@ static int ibmvfc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
 	vhost->client_scsi_channels = min(shost->nr_hw_queues, nr_scsi_channels);
 	vhost->using_channels = 0;
 	vhost->do_enquiry = 1;
+	vhost->scan_timeout = 0;
 
 	strcpy(vhost->partition_name, "UNKNOWN");
 	init_waitqueue_head(&vhost->work_wait_q);
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.h b/drivers/scsi/ibmvscsi/ibmvfc.h
index 92fb889d7eb0..3718406e0988 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.h
+++ b/drivers/scsi/ibmvscsi/ibmvfc.h
@@ -876,6 +876,7 @@ struct ibmvfc_host {
 	int reinit;
 	int delay_init;
 	int scan_complete;
+	int scan_timeout;
 	int logged_in;
 	int mq_enabled;
 	int using_channels;
-- 
2.32.0


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

* Re: [PATCH RESEND] ibmvfc: do not wait for initial device scan
  2021-08-17  7:53 [PATCH RESEND] ibmvfc: do not wait for initial device scan mwilck
@ 2021-08-18  2:26 ` Martin K. Petersen
  2021-08-24  4:03 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-08-18  2:26 UTC (permalink / raw)
  To: mwilck; +Cc: Martin K. Petersen, Tyrel Datwyler, Hannes Reinecke, linux-scsi


Martin,

> The initial device scan might take some time, and there really is no
> need to wait for it during probe().  So return immediately from
> scsi_scan_host() during probe() and avoid any udev stalls during
> booting.

Applied to 5.15/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH RESEND] ibmvfc: do not wait for initial device scan
  2021-08-17  7:53 [PATCH RESEND] ibmvfc: do not wait for initial device scan mwilck
  2021-08-18  2:26 ` Martin K. Petersen
@ 2021-08-24  4:03 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-08-24  4:03 UTC (permalink / raw)
  To: Tyrel Datwyler, mwilck, Hannes Reinecke; +Cc: Martin K . Petersen, linux-scsi

On Tue, 17 Aug 2021 09:53:06 +0200, mwilck@suse.com wrote:

> From: Hannes Reinecke <hare@suse.de>
> 
> The initial device scan might take some time, and there really is
> no need to wait for it during probe().
> So return immediately from scsi_scan_host() during probe() and avoid
> any udev stalls during booting.
> 
> [...]

Applied to 5.15/scsi-queue, thanks!

[1/1] ibmvfc: do not wait for initial device scan
      https://git.kernel.org/mkp/scsi/c/7a3795f28795

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2021-08-24  4:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17  7:53 [PATCH RESEND] ibmvfc: do not wait for initial device scan mwilck
2021-08-18  2:26 ` Martin K. Petersen
2021-08-24  4:03 ` 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.