diff options
author | Tejun Heo <htejun@gmail.com> | 2006-01-24 03:05:22 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-01-26 23:20:14 -0500 |
commit | c19ba8af4f104cca28d548cac55c128b28dd31fb (patch) | |
tree | 2624b544c0f8294a712b3255695b1e178943255a /drivers/scsi/libata-core.c | |
parent | b4dc7623c1bb258b66418261dab40f0e4cfc6d42 (diff) |
[PATCH] libata: new ->probe_reset operation
Add new ->probe_reset operation to ata_port_operations obsoleting
->phy_reset. The main difference from ->phy_reset is that the new
operation is not allowed to manipulate libata internals directly.
It's not allowed to configure or disable the port or devices. It can
only succeed or fail and classify attached devices into passed
@classes.
This change gives more control to higher level and eases sharing reset
methods with EH.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r-- | drivers/scsi/libata-core.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 1f78e246f5e..147e1461062 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -1485,7 +1485,24 @@ static int ata_bus_probe(struct ata_port *ap) | |||
1485 | { | 1485 | { |
1486 | unsigned int i, found = 0; | 1486 | unsigned int i, found = 0; |
1487 | 1487 | ||
1488 | ap->ops->phy_reset(ap); | 1488 | if (ap->ops->probe_reset) { |
1489 | unsigned int classes[ATA_MAX_DEVICES]; | ||
1490 | int rc; | ||
1491 | |||
1492 | ata_port_probe(ap); | ||
1493 | |||
1494 | rc = ap->ops->probe_reset(ap, classes); | ||
1495 | if (rc == 0) { | ||
1496 | for (i = 0; i < ATA_MAX_DEVICES; i++) | ||
1497 | ap->device[i].class = classes[i]; | ||
1498 | } else { | ||
1499 | printk(KERN_ERR "ata%u: probe reset failed, " | ||
1500 | "disabling port\n", ap->id); | ||
1501 | ata_port_disable(ap); | ||
1502 | } | ||
1503 | } else | ||
1504 | ap->ops->phy_reset(ap); | ||
1505 | |||
1489 | if (ap->flags & ATA_FLAG_PORT_DISABLED) | 1506 | if (ap->flags & ATA_FLAG_PORT_DISABLED) |
1490 | goto err_out; | 1507 | goto err_out; |
1491 | 1508 | ||