From: Jeff Garzik <jgarzik@pobox.com>
To: SCSI Mailing List <linux-scsi@vger.kernel.org>, linuxraid@amcc.com
Subject: [PATCH] 3ware: use scsi_scan_target()
Date: Mon, 03 Oct 2005 20:57:46 -0400 [thread overview]
Message-ID: <4341D38A.40509@pobox.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 288 bytes --]
This change updates the 3ware raid drivers to use scsi_scan_target(),
rather than scsi_scan_host(). This is especially nice for 3w-xxxx,
which does not support LUNs. The device scan is a bit quicker and more
direct, even if it is a tiny bit more code in the driver.
Patch untested.
[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1409 bytes --]
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -1992,7 +1992,7 @@ static int __devinit twa_probe(struct pc
struct Scsi_Host *host = NULL;
TW_Device_Extension *tw_dev;
u32 mem_addr;
- int retval = -ENODEV;
+ int retval = -ENODEV, i;
retval = pci_enable_device(pdev);
if (retval) {
@@ -2092,7 +2092,8 @@ static int __devinit twa_probe(struct pc
TW_ENABLE_AND_CLEAR_INTERRUPTS(tw_dev);
/* Finally, scan the host */
- scsi_scan_host(host);
+ for (i = 0; i < TW_MAX_UNITS; i++)
+ scsi_scan_target(&host->shost_gendev, 0, i, ~0, 0);
if (twa_major == -1) {
if ((twa_major = register_chrdev (0, "twa", &twa_fops)) < 0)
diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -2315,7 +2315,7 @@ static int __devinit tw_probe(struct pci
{
struct Scsi_Host *host = NULL;
TW_Device_Extension *tw_dev;
- int retval = -ENODEV;
+ int retval = -ENODEV, i;
retval = pci_enable_device(pdev);
if (retval) {
@@ -2404,7 +2404,8 @@ static int __devinit tw_probe(struct pci
TW_ENABLE_AND_CLEAR_INTERRUPTS(tw_dev);
/* Finally, scan the host */
- scsi_scan_host(host);
+ for (i = 0; i < TW_MAX_UNITS; i++)
+ scsi_scan_target(&host->shost_gendev, 0, i, 0, 0);
if (twe_major == -1) {
if ((twe_major = register_chrdev (0, "twe", &tw_fops)) < 0)
next reply other threads:[~2005-10-04 0:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-04 0:57 Jeff Garzik [this message]
2005-10-05 16:28 ` [PATCH] 3ware: use scsi_scan_target() Christoph Hellwig
2005-10-05 19:01 ` Luben Tuikov
2005-10-05 19:20 ` adam radford
2005-10-05 19:24 ` Jeff Garzik
2005-10-05 19:34 ` Jeff Garzik
2005-10-05 23:19 ` Luben Tuikov
2005-10-07 1:07 ` James Bottomley
2005-10-07 21:36 ` Luben Tuikov
2005-10-08 14:30 ` James Bottomley
2005-10-09 16:25 ` Luben Tuikov
2005-10-10 5:05 ` Mike Anderson
2005-10-14 16:19 ` Luben Tuikov
-- strict thread matches above, loose matches on Subject: below --
2005-10-06 13:13 James.Smart
2005-10-06 18:09 ` Luben Tuikov
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=4341D38A.40509@pobox.com \
--to=jgarzik@pobox.com \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxraid@amcc.com \
/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).