aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2012-01-18 23:47:01 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-02-29 16:35:41 -0500
commit9508a66f898d46e726a318469312b45e0b1d078b (patch)
treee6b61e6c2a7dc8b40fdc0fe34901ff3db4af47a9 /drivers/ata
parent92625f9bff3853951cc75f5bc084ee67c1317d2f (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/ata')
-rw-r--r--drivers/ata/libata-core.c34
-rw-r--r--drivers/ata/libata-scsi.c13
-rw-r--r--drivers/ata/libata.h1
3 files changed, 32 insertions, 16 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index c06e0ec11556..e0bda9ff89cd 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5936,29 +5936,31 @@ void ata_host_init(struct ata_host *host, struct device *dev,
5936 host->ops = ops; 5936 host->ops = ops;
5937} 5937}
5938 5938
5939int ata_port_probe(struct ata_port *ap) 5939void __ata_port_probe(struct ata_port *ap)
5940{ 5940{
5941 int rc = 0; 5941 struct ata_eh_info *ehi = &ap->link.eh_info;
5942 unsigned long flags;
5942 5943
5943 /* probe */ 5944 /* kick EH for boot probing */
5944 if (ap->ops->error_handler) { 5945 spin_lock_irqsave(ap->lock, flags);
5945 struct ata_eh_info *ehi = &ap->link.eh_info;
5946 unsigned long flags;
5947 5946
5948 /* kick EH for boot probing */ 5947 ehi->probe_mask |= ATA_ALL_DEVICES;
5949 spin_lock_irqsave(ap->lock, flags); 5948 ehi->action |= ATA_EH_RESET;
5949 ehi->flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET;
5950 5950
5951 ehi->probe_mask |= ATA_ALL_DEVICES; 5951 ap->pflags &= ~ATA_PFLAG_INITIALIZING;
5952 ehi->action |= ATA_EH_RESET; 5952 ap->pflags |= ATA_PFLAG_LOADING;
5953 ehi->flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET; 5953 ata_port_schedule_eh(ap);
5954 5954
5955 ap->pflags &= ~ATA_PFLAG_INITIALIZING; 5955 spin_unlock_irqrestore(ap->lock, flags);
5956 ap->pflags |= ATA_PFLAG_LOADING; 5956}
5957 ata_port_schedule_eh(ap);
5958 5957
5959 spin_unlock_irqrestore(ap->lock, flags); 5958int ata_port_probe(struct ata_port *ap)
5959{
5960 int rc = 0;
5960 5961
5961 /* wait for EH to finish */ 5962 if (ap->ops->error_handler) {
5963 __ata_port_probe(ap);
5962 ata_port_wait_eh(ap); 5964 ata_port_wait_eh(ap);
5963 } else { 5965 } else {
5964 DPRINTK("ata%u: bus probe begin\n", ap->print_id); 5966 DPRINTK("ata%u: bus probe begin\n", ap->print_id);
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 508a60bfe5c1..1ee00c8b5b04 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3838,6 +3838,19 @@ void ata_sas_port_stop(struct ata_port *ap)
3838} 3838}
3839EXPORT_SYMBOL_GPL(ata_sas_port_stop); 3839EXPORT_SYMBOL_GPL(ata_sas_port_stop);
3840 3840
3841int ata_sas_async_port_init(struct ata_port *ap)
3842{
3843 int rc = ap->ops->port_start(ap);
3844
3845 if (!rc) {
3846 ap->print_id = ata_print_id++;
3847 __ata_port_probe(ap);
3848 }
3849
3850 return rc;
3851}
3852EXPORT_SYMBOL_GPL(ata_sas_async_port_init);
3853
3841/** 3854/**
3842 * ata_sas_port_init - Initialize a SATA device 3855 * ata_sas_port_init - Initialize a SATA device
3843 * @ap: SATA port to initialize 3856 * @ap: SATA port to initialize
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index 1fab235ee516..2e26fcaf635b 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -105,6 +105,7 @@ extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg);
105extern struct ata_port *ata_port_alloc(struct ata_host *host); 105extern struct ata_port *ata_port_alloc(struct ata_host *host);
106extern const char *sata_spd_string(unsigned int spd); 106extern const char *sata_spd_string(unsigned int spd);
107extern int ata_port_probe(struct ata_port *ap); 107extern int ata_port_probe(struct ata_port *ap);
108extern void __ata_port_probe(struct ata_port *ap);
108 109
109/* libata-acpi.c */ 110/* libata-acpi.c */
110#ifdef CONFIG_ATA_ACPI 111#ifdef CONFIG_ATA_ACPI