aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@suse.de>2011-01-23 09:28:33 -0500
committerJeff Garzik <jgarzik@redhat.com>2011-03-02 02:36:45 -0500
commit238c9cf9ea88bbbb9fd0f60c2cc9511c10b4585c (patch)
tree914d87dc521fc4bca4f91f7c432ddac9be17c9be /drivers/ata/libata-core.c
parenteb0e85e36b971ec31610eda7e3ff5c11c1c44785 (diff)
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). Signed-off-by: James Bottomley <James.Bottomley@suse.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c46
1 files changed, 22 insertions, 24 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index d4e52e214859..7d3c71a3750a 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5887,21 +5887,9 @@ void ata_host_init(struct ata_host *host, struct device *dev,
5887 host->ops = ops; 5887 host->ops = ops;
5888} 5888}
5889 5889
5890 5890int ata_port_probe(struct ata_port *ap)
5891static void async_port_probe(void *data, async_cookie_t cookie)
5892{ 5891{
5893 int rc; 5892 int rc = 0;
5894 struct ata_port *ap = data;
5895
5896 /*
5897 * If we're not allowed to scan this host in parallel,
5898 * we need to wait until all previous scans have completed
5899 * before going further.
5900 * Jeff Garzik says this is only within a controller, so we
5901 * don't need to wait for port 0, only for later ports.
5902 */
5903 if (!(ap->host->flags & ATA_HOST_PARALLEL_SCAN) && ap->port_no != 0)
5904 async_synchronize_cookie(cookie);
5905 5893
5906 /* probe */ 5894 /* probe */
5907 if (ap->ops->error_handler) { 5895 if (ap->ops->error_handler) {
@@ -5927,23 +5915,33 @@ static void async_port_probe(void *data, async_cookie_t cookie)
5927 DPRINTK("ata%u: bus probe begin\n", ap->print_id); 5915 DPRINTK("ata%u: bus probe begin\n", ap->print_id);
5928 rc = ata_bus_probe(ap); 5916 rc = ata_bus_probe(ap);
5929 DPRINTK("ata%u: bus probe end\n", ap->print_id); 5917 DPRINTK("ata%u: bus probe end\n", ap->print_id);
5930
5931 if (rc) {
5932 /* FIXME: do something useful here?
5933 * Current libata behavior will
5934 * tear down everything when
5935 * the module is removed
5936 * or the h/w is unplugged.
5937 */
5938 }
5939 } 5918 }
5919 return rc;
5920}
5921
5922
5923static void async_port_probe(void *data, async_cookie_t cookie)
5924{
5925 struct ata_port *ap = data;
5926
5927 /*
5928 * If we're not allowed to scan this host in parallel,
5929 * we need to wait until all previous scans have completed
5930 * before going further.
5931 * Jeff Garzik says this is only within a controller, so we
5932 * don't need to wait for port 0, only for later ports.
5933 */
5934 if (!(ap->host->flags & ATA_HOST_PARALLEL_SCAN) && ap->port_no != 0)
5935 async_synchronize_cookie(cookie);
5936
5937 (void)ata_port_probe(ap);
5940 5938
5941 /* in order to keep device order, we need to synchronize at this point */ 5939 /* in order to keep device order, we need to synchronize at this point */
5942 async_synchronize_cookie(cookie); 5940 async_synchronize_cookie(cookie);
5943 5941
5944 ata_scsi_scan_host(ap, 1); 5942 ata_scsi_scan_host(ap, 1);
5945
5946} 5943}
5944
5947/** 5945/**
5948 * ata_host_register - register initialized ATA host 5946 * ata_host_register - register initialized ATA host
5949 * @host: ATA host to register 5947 * @host: ATA host to register