diff options
author | Dan Williams | 2012-01-18 20:47:01 -0800 |
---|---|---|
committer | James Bottomley | 2012-02-29 15:35:41 -0600 |
commit | 9508a66f898d46e726a318469312b45e0b1d078b (patch) | |
tree | e6b61e6c2a7dc8b40fdc0fe34901ff3db4af47a9 /drivers/scsi/libsas/sas_discover.c | |
parent | 92625f9bff3853951cc75f5bc084ee67c1317d2f (diff) |
[SCSI] libsas: async ata scanning
libsas ata error handling is already async but this does not help the
scan case. Move initial link recovery out from under host->scan_mutex,
and delay synchronization with eh until after all port probe/recovery
work has been queued.
Device ordering is maintained with scan order by still calling
sas_rphy_add() in order of domain discovery.
Since we now scan the domain list when invoking libata-eh we need to be
careful to check for fully initialized ata ports.
Acked-by: Jack Wang <jack_wang@usish.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/libsas/sas_discover.c')
-rw-r--r-- | drivers/scsi/libsas/sas_discover.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index 18fa364aa00f..0d58a8beaa3d 100644 --- a/drivers/scsi/libsas/sas_discover.c +++ b/drivers/scsi/libsas/sas_discover.c @@ -207,22 +207,22 @@ static void sas_probe_devices(struct work_struct *work) clear_bit(DISCE_PROBE, &port->disc.pending); - list_for_each_entry_safe(dev, n, &port->disco_list, disco_list_node) { - int err; - + /* devices must be domain members before link recovery and probe */ + list_for_each_entry(dev, &port->disco_list, disco_list_node) { spin_lock_irq(&port->dev_list_lock); list_add_tail(&dev->dev_list_node, &port->dev_list); spin_unlock_irq(&port->dev_list_lock); + } - err = sas_rphy_add(dev->rphy); + sas_probe_sata(port); - if (err) { - SAS_DPRINTK("%s: for %s device %16llx returned %d\n", - __func__, dev->parent ? "exp-attached" : - "direct-attached", - SAS_ADDR(dev->sas_addr), err); - sas_unregister_dev(port, dev); - } else + list_for_each_entry_safe(dev, n, &port->disco_list, disco_list_node) { + int err; + + err = sas_rphy_add(dev->rphy); + if (err) + sas_fail_probe(dev, __func__, err); + else list_del_init(&dev->disco_list_node); } } |