Commit 238c9cf9 authored by James Bottomley's avatar James Bottomley Committed by Jeff Garzik

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: default avatarJames Bottomley <James.Bottomley@suse.de>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent eb0e85e3
...@@ -5887,21 +5887,9 @@ void ata_host_init(struct ata_host *host, struct device *dev, ...@@ -5887,21 +5887,9 @@ void ata_host_init(struct ata_host *host, struct device *dev,
host->ops = ops; host->ops = ops;
} }
int ata_port_probe(struct ata_port *ap)
static void async_port_probe(void *data, async_cookie_t cookie)
{ {
int rc; int rc = 0;
struct ata_port *ap = data;
/*
* If we're not allowed to scan this host in parallel,
* we need to wait until all previous scans have completed
* before going further.
* Jeff Garzik says this is only within a controller, so we
* don't need to wait for port 0, only for later ports.
*/
if (!(ap->host->flags & ATA_HOST_PARALLEL_SCAN) && ap->port_no != 0)
async_synchronize_cookie(cookie);
/* probe */ /* probe */
if (ap->ops->error_handler) { if (ap->ops->error_handler) {
...@@ -5927,23 +5915,33 @@ static void async_port_probe(void *data, async_cookie_t cookie) ...@@ -5927,23 +5915,33 @@ static void async_port_probe(void *data, async_cookie_t cookie)
DPRINTK("ata%u: bus probe begin\n", ap->print_id); DPRINTK("ata%u: bus probe begin\n", ap->print_id);
rc = ata_bus_probe(ap); rc = ata_bus_probe(ap);
DPRINTK("ata%u: bus probe end\n", ap->print_id); DPRINTK("ata%u: bus probe end\n", ap->print_id);
}
return rc;
}
if (rc) {
/* FIXME: do something useful here? static void async_port_probe(void *data, async_cookie_t cookie)
* Current libata behavior will {
* tear down everything when struct ata_port *ap = data;
* the module is removed
* or the h/w is unplugged. /*
* If we're not allowed to scan this host in parallel,
* we need to wait until all previous scans have completed
* before going further.
* Jeff Garzik says this is only within a controller, so we
* don't need to wait for port 0, only for later ports.
*/ */
} if (!(ap->host->flags & ATA_HOST_PARALLEL_SCAN) && ap->port_no != 0)
} async_synchronize_cookie(cookie);
(void)ata_port_probe(ap);
/* in order to keep device order, we need to synchronize at this point */ /* in order to keep device order, we need to synchronize at this point */
async_synchronize_cookie(cookie); async_synchronize_cookie(cookie);
ata_scsi_scan_host(ap, 1); ata_scsi_scan_host(ap, 1);
} }
/** /**
* ata_host_register - register initialized ATA host * ata_host_register - register initialized ATA host
* @host: ATA host to register * @host: ATA host to register
......
...@@ -3821,7 +3821,7 @@ int ata_sas_port_init(struct ata_port *ap) ...@@ -3821,7 +3821,7 @@ int ata_sas_port_init(struct ata_port *ap)
if (!rc) { if (!rc) {
ap->print_id = ata_print_id++; ap->print_id = ata_print_id++;
rc = ata_bus_probe(ap); rc = ata_port_probe(ap);
} }
return rc; return rc;
......
...@@ -103,6 +103,7 @@ extern int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg); ...@@ -103,6 +103,7 @@ extern int ata_task_ioctl(struct scsi_device *scsidev, void __user *arg);
extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg); extern int ata_cmd_ioctl(struct scsi_device *scsidev, void __user *arg);
extern struct ata_port *ata_port_alloc(struct ata_host *host); extern struct ata_port *ata_port_alloc(struct ata_host *host);
extern const char *sata_spd_string(unsigned int spd); extern const char *sata_spd_string(unsigned int spd);
extern int ata_port_probe(struct ata_port *ap);
/* libata-acpi.c */ /* libata-acpi.c */
#ifdef CONFIG_ATA_ACPI #ifdef CONFIG_ATA_ACPI
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment