Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234976
b: refs/heads/master
c: 238c9cf
h: refs/heads/master
v: v3
  • Loading branch information
James Bottomley authored and Jeff Garzik committed Mar 2, 2011
1 parent c9d9bd1 commit de55787
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eb0e85e36b971ec31610eda7e3ff5c11c1c44785
refs/heads/master: 238c9cf9ea88bbbb9fd0f60c2cc9511c10b4585c
46 changes: 22 additions & 24 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -5887,21 +5887,9 @@ void ata_host_init(struct ata_host *host, struct device *dev,
host->ops = ops;
}


static void async_port_probe(void *data, async_cookie_t cookie)
int ata_port_probe(struct ata_port *ap)
{
int rc;
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);
int rc = 0;

/* probe */
if (ap->ops->error_handler) {
Expand All @@ -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);
rc = ata_bus_probe(ap);
DPRINTK("ata%u: bus probe end\n", ap->print_id);

if (rc) {
/* FIXME: do something useful here?
* Current libata behavior will
* tear down everything when
* the module is removed
* or the h/w is unplugged.
*/
}
}
return rc;
}


static void async_port_probe(void *data, async_cookie_t cookie)
{
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);

(void)ata_port_probe(ap);

/* in order to keep device order, we need to synchronize at this point */
async_synchronize_cookie(cookie);

ata_scsi_scan_host(ap, 1);

}

/**
* ata_host_register - register initialized ATA host
* @host: ATA host to register
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ata/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -3821,7 +3821,7 @@ int ata_sas_port_init(struct ata_port *ap)

if (!rc) {
ap->print_id = ata_print_id++;
rc = ata_bus_probe(ap);
rc = ata_port_probe(ap);
}

return rc;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/ata/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 struct ata_port *ata_port_alloc(struct ata_host *host);
extern const char *sata_spd_string(unsigned int spd);
extern int ata_port_probe(struct ata_port *ap);

/* libata-acpi.c */
#ifdef CONFIG_ATA_ACPI
Expand Down

0 comments on commit de55787

Please sign in to comment.