linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] 3ware: use scsi_scan_target()
@ 2005-10-04  0:57 Jeff Garzik
  2005-10-05 16:28 ` Christoph Hellwig
  0 siblings, 1 reply; 15+ messages in thread
From: Jeff Garzik @ 2005-10-04  0:57 UTC (permalink / raw)
  To: SCSI Mailing List, linuxraid

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

^ permalink raw reply	[flat|nested] 15+ messages in thread
* RE: [PATCH] 3ware: use scsi_scan_target()
@ 2005-10-06 13:13 James.Smart
  2005-10-06 18:09 ` Luben Tuikov
  0 siblings, 1 reply; 15+ messages in thread
From: James.Smart @ 2005-10-06 13:13 UTC (permalink / raw)
  To: ltuikov, jgarzik, hch; +Cc: linux-scsi, linuxraid


> I'd like to move sas_do_lu_discovery(struct domain_device *dev)
> into SCSI Core (as the comment therein says), for _new_ (non-legacy)
> devices, i.e. with newer FW.

My vote, for what it's worth, is to *not* have multiple discovery threads.
I don't care about "old" or "new", and in general, even things with "new"
interfaces behave in "old" manners, as they typically are existing
subsystems with new interface chips placed on them. It also makes life
hell for transport bridging devices, which want to map at the transport
endpoint level, and leave luns up to the actual SCSI task manager in the
device. Remember - devices are made to work with many OS's, and the level
of SCSI/SAM support in each os differs, so the devices choose a median
that allows them to function with the OS's they care about. It's no longer
a SAM thing. Also - SAM/SPC/SBC/etc has many many grey areas, and SAM (the
original) was written such that SCSI-2 devices were still SAM compliant.
And if you say SAM - what rev of SAM (SAM, SAM-2, SAM-3) ?  There are
things allowed in SAM that are disallowed in SAM-3. Same with SPC and so on.

I've lived with a driver with it's own scan subsystem (which equates to
your own SAS scan functions) and all it did was create confusion for the
end users. If a device is mis-behaving, do you tweak driver/sas_transport
tunables, or do you tweak black/white list entries ? How do you deal with
the same SAS target device that behaves differently behind 2 different
adapters - one using the midlayers standard scanning functions (which the
device may already be supported by) vs the other using its own custom scan
logic. I know you'll come back at this from the pristine view that SAS is
new - well true, the transport is new, but the devices aren't necessarily.
Go back and look at the exceptions I mentioned above.

Bottomline, this kind of choice just makes life confusing for the end user.

As has been said before on this list - replicating scan functions is silly.
Let's fix or extend the current scan behavior.

-- james

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

end of thread, other threads:[~2005-10-14 16:19 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-04  0:57 [PATCH] 3ware: use scsi_scan_target() Jeff Garzik
2005-10-05 16:28 ` 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

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