[libata] improve device scan
authorJeff Garzik <jgarzik@pobox.com>
Mon, 3 Oct 2005 19:55:19 +0000 (15:55 -0400)
committerJeff Garzik <jgarzik@pobox.com>
Mon, 3 Oct 2005 19:55:19 +0000 (15:55 -0400)
Replace SCSI's legacy "bang at the door" method of probing with one
directly controlled by the underlying ATA transport layer.

We now only call scsi_scan_target() for devices we find, rather than
probing every possible channel/id within a certain range.

drivers/scsi/libata-core.c
drivers/scsi/libata-scsi.c
drivers/scsi/libata.h

index e5b01997117a9965249cb734b7c00f43b7d9bbd8..902c76364af7fb01e6265318cc69b92a62def2ff 100644 (file)
@@ -4113,7 +4113,7 @@ int ata_device_add(struct ata_probe_ent *ent)
        for (i = 0; i < count; i++) {
                struct ata_port *ap = host_set->ports[i];
 
-               scsi_scan_host(ap->host);
+               ata_scsi_scan_host(ap);
        }
 
        dev_set_drvdata(dev, host_set);
index 104fd9a63e734ddc752f68de92215a208242a0d1..4fc0134d4272d86b0eb3b48fe0a6659a3b874748 100644 (file)
@@ -1678,3 +1678,15 @@ void ata_scsi_simulate(u16 *id,
        }
 }
 
+void ata_scsi_scan_host(struct ata_port *ap)
+{
+       unsigned int i;
+
+       if (ap->flags & ATA_FLAG_PORT_DISABLED)
+               return;
+
+       for (i = 0; i < ATA_MAX_DEVICES; i++)
+               if (ata_dev_present(&ap->device[i]))
+                       scsi_scan_target(&ap->host->shost_gendev, 0, i, ~0, 0);
+}
+
index d608b3a0f6fe6897d108cd8f6557c8e4d53c1820..c7a1fa1c9abc143136de8caa475e117ccdf1a7ed 100644 (file)
@@ -51,6 +51,7 @@ extern void swap_buf_le16(u16 *buf, unsigned int buf_words);
 
 
 /* libata-scsi.c */
+extern void ata_scsi_scan_host(struct ata_port *ap);
 extern void ata_to_sense_error(struct ata_queued_cmd *qc, u8 drv_stat);
 extern int ata_scsi_error(struct Scsi_Host *host);
 extern unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf,
This page took 0.055295 seconds and 5 git commands to generate.