From: David VomLehn <dvomlehn@cisco.com>
To: linux-usb@vger.kernel.org
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 5/5] USB: Wait for USB and SCSI block boot devices, v2
Date: Thu, 30 Apr 2009 08:48:20 -0700 [thread overview]
Message-ID: <20090430154820.GA15170@cuplxvomd02.corp.sa.net> (raw)
From: Alan Stern <stern@rowland.harvard.edu
Add synchronization for USB and SCSI block devices.
History
v2 Correct location of call to bootdev_found
v1 Initial version
Signed-off-by: Alan Stern <stern@rowland.harvard.edu
Signed-off-by: David VomLehn <dvomlehn@cisco.com>
---
drivers/scsi/scsi_scan.c | 2 ++
drivers/usb/storage/usb.c | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 6f51ca4..735b061 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -1834,6 +1834,7 @@ static int do_scan_async(void *_data)
struct async_scan_data *data = _data;
do_scsi_scan_host(data->shost);
scsi_finish_async_scan(data);
+ bootdev_probe_done(BOOTDEV_BLOCK_MASK);
return 0;
}
@@ -1855,6 +1856,7 @@ void scsi_scan_host(struct Scsi_Host *shost)
return;
}
+ bootdev_found(BOOTDEV_BLOCK_MASK);
p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no);
if (IS_ERR(p))
do_scan_async(data);
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 8060b85..ea7abab 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -837,6 +837,7 @@ static int usb_stor_scan_thread(void * __us)
/* Should we unbind if no devices were detected? */
}
+ bootdev_probe_done(BOOTDEV_BLOCK_MASK);
complete_and_exit(&us->scanning_done, 0);
}
@@ -937,10 +938,12 @@ int usb_stor_probe2(struct us_data *us)
}
/* Start up the thread for delayed SCSI-device scanning */
+ bootdev_found(BOOTDEV_BLOCK_MASK);
th = kthread_create(usb_stor_scan_thread, us, "usb-stor-scan");
if (IS_ERR(th)) {
printk(KERN_WARNING USB_STORAGE
"Unable to start the device-scanning thread\n");
+ bootdev_probe_done(BOOTDEV_BLOCK_MASK);
complete(&us->scanning_done);
quiesce_and_remove_host(us);
result = PTR_ERR(th);
reply other threads:[~2009-04-30 15:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090430154820.GA15170@cuplxvomd02.corp.sa.net \
--to=dvomlehn@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).