aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@suse.de>2011-01-23 09:28:33 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-02-13 14:14:29 -0500
commit1f723867e650e5e021445eea34fddeffca9c4faa (patch)
tree74ad2dd13739b64656b449c0ac9f1d63f183267b
parenta0b990c62c8915bb0c4ba55cf5d3da3c8fa74413 (diff)
[SCSI] libata: plumb sas port scan into standard libata paths
The function ata_sas_port_init() has always really done its own thing. However, as a precursor to moving to the libata new eh, it has to be properly using the standard libata scan paths. This means separating the current libata scan paths into pieces which can be shared with libsas and pieces which cant (really just the async call and the host scan). Cc: Tejun Heo <tj@kernel.org> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/ata/libata-core.c46
-rw-r--r--drivers/ata/libata-scsi.c2
-rw-r--r--drivers/ata/libata.h1
3 files changed, 24 insertions, 25 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index a31fe96f7de6..f5917756c49d 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5886,21 +5886,9 @@ void ata_host_init(struct ata_host *host, struct device *dev,
5886 host->ops = ops; 5886 host->ops = ops;
5887} 5887}
5888 5888
5889 5889int ata_port_probe(struct ata_port *ap)
5890static void async_port_probe(void *data, async_cookie_t cookie)
5891{ 5890{
5892 int rc; 5891 int rc = 0;
5893 struct ata_port *ap = data;
5894
5895 /*
5896 * If we're not allowed to scan this host in parallel,
5897 * we need to wait until all previous scans have completed
5898 * before going further.
5899 * Jeff Garzik says this is only within a controller, so we
5900 * don't need to wait for port 0, only for later ports.
5901 */
5902 if (!(ap->host->flags & ATA_HOST_PARALLEL_SCAN) && ap->port_no != 0)
5903 async_synchronize_cookie(cookie);
5904 5892
5905 /* probe */ 5893 /* probe */
5906 if (ap->ops->error_handler) { 5894 if (ap->ops->error_handler) {
@@ -5926,23 +5914,33 @@ static void async_port_probe(void *data, async_cookie_t cookie)
5926 DPRINTK("ata%u: bus probe begin\n", ap->print_id); 5914 DPRINTK("ata%u: bus probe begin\n", ap->print_id);
5927 rc = ata_bus_probe(ap); 5915 rc = ata_bus_probe(ap);
5928 DPRINTK("ata%u: bus probe end\n", ap->print_id); 5916 DPRINTK("ata%u: bus probe end\n", ap->print_id);
5929
5930 if (rc) {
5931 /* FIXME: do something useful here?
5932 * Current libata behavior will
5933 * tear down everything when
5934 * the module is removed
5935 * or the h/w is unplugged.
5936 */
5937 }
5938 } 5917 }
5918 return rc;
5919}
5920
5921
5922static void async_port_probe(void *data, async_cookie_t cookie)
5923{
5924 struct ata_port *ap = data;
5925
5926 /*
5927 * If we're not allowed to scan this host in parallel,
5928 * we need to wait until all previous scans have completed
5929 * before going further.
5930 * Jeff Garzik says this is only within a controller, so we
5931 * don't need to wait for port 0, only for later ports.
5932 */
5933 if (!(ap->host->flags & ATA_HOST_PARALLEL_SCAN) && ap->port_no != 0)
5934 async_synchronize_cookie(cookie);
5935
5936 (void)ata_port_probe(ap);
5939 5937
5940 /* in order to keep device order, we need to synchronize at this point */ 5938 /* in order to keep device order, we need to synchronize at this point */
5941 async_synchronize_cookie(cookie); 5939 async_synchronize_cookie(cookie);
5942 5940
5943 ata_scsi_scan_host(ap, 1); 5941 ata_scsi_scan_host(ap, 1);
5944
5945} 5942}
5943
5946/** 5944/**
5947 * ata_host_register - register initialized ATA host 5945 * ata_host_register - register initialized ATA host
5948 * @host: ATA host to register 5946 * @host: ATA host to register
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 5defc74973d7..897066761359 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3809,7 +3809,7 @@ int ata_sas_port_init(struct ata_port *ap)
3809 3809
3810 if (!rc) { 3810 if (!rc) {
3811 ap->print_id = ata_print_id++; 3811 ap->print_id = ata_print_id++;
3812 rc = ata_bus_probe(ap); 3812 rc = ata_port_probe(ap);
3813 } 3813 }
3814 3814
3815 return rc; 3815 return rc;
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index a9be110dbf51..773de97988a2 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -103,6 +103,7 @@ extern int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg);
103extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg); 103extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg);
104extern struct ata_port *ata_port_alloc(struct ata_host *host); 104extern struct ata_port *ata_port_alloc(struct ata_host *host);
105extern const char *sata_spd_string(unsigned int spd); 105extern const char *sata_spd_string(unsigned int spd);
106extern int ata_port_probe(struct ata_port *ap);
106 107
107/* libata-acpi.c */ 108/* libata-acpi.c */
108#ifdef CONFIG_ATA_ACPI 109#ifdef CONFIG_ATA_ACPI