aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c54
1 files changed, 26 insertions, 28 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index d4e52e21485..b91e19cab10 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4210,7 +4210,7 @@ static int glob_match (const char *text, const char *pattern)
4210 return 0; /* End of both strings: match */ 4210 return 0; /* End of both strings: match */
4211 return 1; /* No match */ 4211 return 1; /* No match */
4212} 4212}
4213 4213
4214static unsigned long ata_dev_blacklisted(const struct ata_device *dev) 4214static unsigned long ata_dev_blacklisted(const struct ata_device *dev)
4215{ 4215{
4216 unsigned char model_num[ATA_ID_PROD_LEN + 1]; 4216 unsigned char model_num[ATA_ID_PROD_LEN + 1];
@@ -5479,7 +5479,7 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
5479 ap = kzalloc(sizeof(*ap), GFP_KERNEL); 5479 ap = kzalloc(sizeof(*ap), GFP_KERNEL);
5480 if (!ap) 5480 if (!ap)
5481 return NULL; 5481 return NULL;
5482 5482
5483 ap->pflags |= ATA_PFLAG_INITIALIZING; 5483 ap->pflags |= ATA_PFLAG_INITIALIZING;
5484 ap->lock = &host->lock; 5484 ap->lock = &host->lock;
5485 ap->print_id = -1; 5485 ap->print_id = -1;
@@ -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
@@ -5983,7 +5981,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
5983 for (i = 0; i < host->n_ports; i++) 5981 for (i = 0; i < host->n_ports; i++)
5984 host->ports[i]->print_id = ata_print_id++; 5982 host->ports[i]->print_id = ata_print_id++;
5985 5983
5986 5984
5987 /* Create associated sysfs transport objects */ 5985 /* Create associated sysfs transport objects */
5988 for (i = 0; i < host->n_ports; i++) { 5986 for (i = 0; i < host->n_ports; i++) {
5989 rc = ata_tport_add(host->dev,host->ports[i]); 5987 rc = ata_tport_add(host->dev,host->ports[i]);
@@ -6471,7 +6469,7 @@ static int __init ata_init(void)
6471 ata_sff_exit(); 6469 ata_sff_exit();
6472 rc = -ENOMEM; 6470 rc = -ENOMEM;
6473 goto err_out; 6471 goto err_out;
6474 } 6472 }
6475 6473
6476 printk(KERN_DEBUG "libata version " DRV_VERSION " loaded.\n"); 6474 printk(KERN_DEBUG "libata version " DRV_VERSION " loaded.\n");
6477 return 0; 6475 return 0;