diff options
author | Tejun Heo <htejun@gmail.com> | 2007-09-02 10:23:57 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-12 14:55:39 -0400 |
commit | 3f19859ee95a38c066a0420eb8a30c76ecd67a42 (patch) | |
tree | 0ad611a48ddb18be3b8ec35e4dc318e2fd344961 /drivers | |
parent | 7a234aff3d83728fd83cf19df32d3df52566d2ac (diff) |
libata: update ata_dev_try_classify() arguments
Make ata_dev_try_classify() take a pointer to ata_device instead of
ata_port/port_number combination for consistency and add @present
argument. @present indicates whether the device seems present during
reset. It's the result of TF access during softreset and link
onlineness during hardreset. @present will be used to improve
diagnostic failure handling.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/libata-core.c | 30 | ||||
-rw-r--r-- | drivers/ata/pata_scc.c | 6 | ||||
-rw-r--r-- | drivers/ata/sata_mv.c | 2 |
3 files changed, 21 insertions, 17 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index b01b5a897dcf..ea8c07b04f29 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -701,8 +701,8 @@ unsigned int ata_dev_classify(const struct ata_taskfile *tf) | |||
701 | 701 | ||
702 | /** | 702 | /** |
703 | * ata_dev_try_classify - Parse returned ATA device signature | 703 | * ata_dev_try_classify - Parse returned ATA device signature |
704 | * @ap: ATA channel to examine | 704 | * @dev: ATA device to classify (starting at zero) |
705 | * @device: Device to examine (starting at zero) | 705 | * @present: device seems present |
706 | * @r_err: Value of error register on completion | 706 | * @r_err: Value of error register on completion |
707 | * | 707 | * |
708 | * After an event -- SRST, E.D.D., or SATA COMRESET -- occurs, | 708 | * After an event -- SRST, E.D.D., or SATA COMRESET -- occurs, |
@@ -720,15 +720,15 @@ unsigned int ata_dev_classify(const struct ata_taskfile *tf) | |||
720 | * RETURNS: | 720 | * RETURNS: |
721 | * Device type - %ATA_DEV_ATA, %ATA_DEV_ATAPI or %ATA_DEV_NONE. | 721 | * Device type - %ATA_DEV_ATA, %ATA_DEV_ATAPI or %ATA_DEV_NONE. |
722 | */ | 722 | */ |
723 | 723 | unsigned int ata_dev_try_classify(struct ata_device *dev, int present, | |
724 | unsigned int | 724 | u8 *r_err) |
725 | ata_dev_try_classify(struct ata_port *ap, unsigned int device, u8 *r_err) | ||
726 | { | 725 | { |
726 | struct ata_port *ap = dev->link->ap; | ||
727 | struct ata_taskfile tf; | 727 | struct ata_taskfile tf; |
728 | unsigned int class; | 728 | unsigned int class; |
729 | u8 err; | 729 | u8 err; |
730 | 730 | ||
731 | ap->ops->dev_select(ap, device); | 731 | ap->ops->dev_select(ap, dev->devno); |
732 | 732 | ||
733 | memset(&tf, 0, sizeof(tf)); | 733 | memset(&tf, 0, sizeof(tf)); |
734 | 734 | ||
@@ -738,12 +738,12 @@ ata_dev_try_classify(struct ata_port *ap, unsigned int device, u8 *r_err) | |||
738 | *r_err = err; | 738 | *r_err = err; |
739 | 739 | ||
740 | /* see if device passed diags: if master then continue and warn later */ | 740 | /* see if device passed diags: if master then continue and warn later */ |
741 | if (err == 0 && device == 0) | 741 | if (err == 0 && dev->devno == 0) |
742 | /* diagnostic fail : do nothing _YET_ */ | 742 | /* diagnostic fail : do nothing _YET_ */ |
743 | ap->link.device[device].horkage |= ATA_HORKAGE_DIAGNOSTIC; | 743 | dev->horkage |= ATA_HORKAGE_DIAGNOSTIC; |
744 | else if (err == 1) | 744 | else if (err == 1) |
745 | /* do nothing */ ; | 745 | /* do nothing */ ; |
746 | else if ((device == 0) && (err == 0x81)) | 746 | else if ((dev->devno == 0) && (err == 0x81)) |
747 | /* do nothing */ ; | 747 | /* do nothing */ ; |
748 | else | 748 | else |
749 | return ATA_DEV_NONE; | 749 | return ATA_DEV_NONE; |
@@ -3238,9 +3238,9 @@ void ata_bus_reset(struct ata_port *ap) | |||
3238 | /* | 3238 | /* |
3239 | * determine by signature whether we have ATA or ATAPI devices | 3239 | * determine by signature whether we have ATA or ATAPI devices |
3240 | */ | 3240 | */ |
3241 | device[0].class = ata_dev_try_classify(ap, 0, &err); | 3241 | device[0].class = ata_dev_try_classify(&device[0], dev0, &err); |
3242 | if ((slave_possible) && (err != 0x81)) | 3242 | if ((slave_possible) && (err != 0x81)) |
3243 | device[1].class = ata_dev_try_classify(ap, 1, &err); | 3243 | device[1].class = ata_dev_try_classify(&device[1], dev1, &err); |
3244 | 3244 | ||
3245 | /* is double-select really necessary? */ | 3245 | /* is double-select really necessary? */ |
3246 | if (device[1].class != ATA_DEV_NONE) | 3246 | if (device[1].class != ATA_DEV_NONE) |
@@ -3479,9 +3479,11 @@ int ata_std_softreset(struct ata_link *link, unsigned int *classes, | |||
3479 | } | 3479 | } |
3480 | 3480 | ||
3481 | /* determine by signature whether we have ATA or ATAPI devices */ | 3481 | /* determine by signature whether we have ATA or ATAPI devices */ |
3482 | classes[0] = ata_dev_try_classify(ap, 0, &err); | 3482 | classes[0] = ata_dev_try_classify(&link->device[0], |
3483 | devmask & (1 << 0), &err); | ||
3483 | if (slave_possible && err != 0x81) | 3484 | if (slave_possible && err != 0x81) |
3484 | classes[1] = ata_dev_try_classify(ap, 1, &err); | 3485 | classes[1] = ata_dev_try_classify(&link->device[1], |
3486 | devmask & (1 << 1), &err); | ||
3485 | 3487 | ||
3486 | out: | 3488 | out: |
3487 | DPRINTK("EXIT, classes[0]=%u [1]=%u\n", classes[0], classes[1]); | 3489 | DPRINTK("EXIT, classes[0]=%u [1]=%u\n", classes[0], classes[1]); |
@@ -3600,7 +3602,7 @@ int sata_std_hardreset(struct ata_link *link, unsigned int *class, | |||
3600 | 3602 | ||
3601 | ap->ops->dev_select(ap, 0); /* probably unnecessary */ | 3603 | ap->ops->dev_select(ap, 0); /* probably unnecessary */ |
3602 | 3604 | ||
3603 | *class = ata_dev_try_classify(ap, 0, NULL); | 3605 | *class = ata_dev_try_classify(link->device, 1, NULL); |
3604 | 3606 | ||
3605 | DPRINTK("EXIT, class=%u\n", *class); | 3607 | DPRINTK("EXIT, class=%u\n", *class); |
3606 | return 0; | 3608 | return 0; |
diff --git a/drivers/ata/pata_scc.c b/drivers/ata/pata_scc.c index 2153def3f345..941b72bec836 100644 --- a/drivers/ata/pata_scc.c +++ b/drivers/ata/pata_scc.c | |||
@@ -636,9 +636,11 @@ static int scc_std_softreset (struct ata_port *ap, unsigned int *classes, | |||
636 | } | 636 | } |
637 | 637 | ||
638 | /* determine by signature whether we have ATA or ATAPI devices */ | 638 | /* determine by signature whether we have ATA or ATAPI devices */ |
639 | classes[0] = ata_dev_try_classify(ap, 0, &err); | 639 | classes[0] = ata_dev_try_classify(&ap->link.device[0], |
640 | devmask & (1 << 0), &err); | ||
640 | if (slave_possible && err != 0x81) | 641 | if (slave_possible && err != 0x81) |
641 | classes[1] = ata_dev_try_classify(ap, 1, &err); | 642 | classes[1] = ata_dev_try_classify(&ap->link.device[1], |
643 | devmask & (1 << 1), &err); | ||
642 | 644 | ||
643 | out: | 645 | out: |
644 | DPRINTK("EXIT, classes[0]=%u [1]=%u\n", classes[0], classes[1]); | 646 | DPRINTK("EXIT, classes[0]=%u [1]=%u\n", classes[0], classes[1]); |
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 08077efa9afd..4df8311968e9 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -2248,7 +2248,7 @@ comreset_retry: | |||
2248 | */ | 2248 | */ |
2249 | 2249 | ||
2250 | /* finally, read device signature from TF registers */ | 2250 | /* finally, read device signature from TF registers */ |
2251 | *class = ata_dev_try_classify(ap, 0, NULL); | 2251 | *class = ata_dev_try_classify(ap->link.device, 1, NULL); |
2252 | 2252 | ||
2253 | writelfl(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS); | 2253 | writelfl(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS); |
2254 | 2254 | ||