Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e7571c152dea576f8c80ca240befc93d4f16551d
Commit:     e7571c152dea576f8c80ca240befc93d4f16551d
Parent:     fe3b5bfe73ace420709f0cfb198b0ffc704bd38b
Author:     Darrick J. Wong <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 11 14:15:38 2007 -0800
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Sat Jan 13 16:20:23 2007 -0600

    [SCSI] aic94xx: Scan SAS devices asynchronously
    
    Add the necessary hooks to the aic94xx driver to support the asynchronous 
SCSI
    device scan infrastructure.
    
    Signed-off-by: Darrick J. Wong <[EMAIL PROTECTED]>
    Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/scsi/aic94xx/aic94xx_init.c |   41 +++++++++++++++++++++++-----------
 1 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/drivers/scsi/aic94xx/aic94xx_init.c 
b/drivers/scsi/aic94xx/aic94xx_init.c
index 7344f4d..a6fb33f 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -57,6 +57,8 @@ MODULE_PARM_DESC(collector, "\n"
 char sas_addr_str[2*SAS_ADDR_SIZE + 1] = "";
 
 static struct scsi_transport_template *aic94xx_transport_template;
+static int asd_scan_finished(struct Scsi_Host *, unsigned long);
+static void asd_scan_start(struct Scsi_Host *);
 
 static struct scsi_host_template aic94xx_sht = {
        .module                 = THIS_MODULE,
@@ -66,6 +68,8 @@ static struct scsi_host_template aic94xx_sht = {
        .target_alloc           = sas_target_alloc,
        .slave_configure        = sas_slave_configure,
        .slave_destroy          = sas_slave_destroy,
+       .scan_finished          = asd_scan_finished,
+       .scan_start             = asd_scan_start,
        .change_queue_depth     = sas_change_queue_depth,
        .change_queue_type      = sas_change_queue_type,
        .bios_param             = sas_bios_param,
@@ -672,21 +676,10 @@ static int __devinit asd_pci_probe(struct pci_dev *dev,
        if (err)
                goto Err_reg_sas;
 
-       err = asd_enable_phys(asd_ha, asd_ha->hw_prof.enabled_phys);
-       if (err) {
-               asd_printk("coudln't enable phys, err:%d\n", err);
-               goto Err_en_phys;
-       }
-       ASD_DPRINTK("enabled phys\n");
-       /* give the phy enabling interrupt event time to come in (1s
-        * is empirically about all it takes) */
-       ssleep(1);
-       /* Wait for discovery to finish */
-       scsi_flush_work(asd_ha->sas_ha.core.shost);
+       scsi_scan_host(shost);
 
        return 0;
-Err_en_phys:
-       asd_unregister_sas_ha(asd_ha);
+
 Err_reg_sas:
        asd_remove_dev_attrs(asd_ha);
 Err_dev_attrs:
@@ -779,6 +772,28 @@ static void __devexit asd_pci_remove(struct pci_dev *dev)
        return;
 }
 
+static void asd_scan_start(struct Scsi_Host *shost)
+{
+       struct asd_ha_struct *asd_ha;
+       int err;
+
+       asd_ha = SHOST_TO_SAS_HA(shost)->lldd_ha;
+       err = asd_enable_phys(asd_ha, asd_ha->hw_prof.enabled_phys);
+       if (err)
+               asd_printk("Couldn't enable phys, err:%d\n", err);
+}
+
+static int asd_scan_finished(struct Scsi_Host *shost, unsigned long time)
+{
+       /* give the phy enabling interrupt event time to come in (1s
+        * is empirically about all it takes) */
+       if (time < HZ)
+               return 0;
+       /* Wait for discovery to finish */
+       scsi_flush_work(shost);
+       return 1;
+}
+
 static ssize_t asd_version_show(struct device_driver *driver, char *buf)
 {
        return snprintf(buf, PAGE_SIZE, "%s\n", ASD_DRIVER_VERSION);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to