aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-29 21:25:10 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-10-29 21:25:10 -0400
commit0169e284f6b6b263cc7c2ed25986b96cd6fda610 (patch)
tree266623b0131e310de6e77a2c87c42b4092902fa4 /drivers/scsi/libata-core.c
parentbe15cd72d256e5eb3261a781b8507fac83ab33f6 (diff)
[libata] remove ata_chk_err(), ->check_err() hook.
We now depend on ->tf_read() to provide us with the contents of the Error shadow register.
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c41
1 files changed, 9 insertions, 32 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index b1b1c6f01419..d2f71a2331bb 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -371,7 +371,7 @@ static void ata_tf_read_pio(struct ata_port *ap, struct ata_taskfile *tf)
371 struct ata_ioports *ioaddr = &ap->ioaddr; 371 struct ata_ioports *ioaddr = &ap->ioaddr;
372 372
373 tf->command = ata_check_status(ap); 373 tf->command = ata_check_status(ap);
374 tf->feature = ata_chk_err(ap); 374 tf->feature = inb(ioaddr->error_addr);
375 tf->nsect = inb(ioaddr->nsect_addr); 375 tf->nsect = inb(ioaddr->nsect_addr);
376 tf->lbal = inb(ioaddr->lbal_addr); 376 tf->lbal = inb(ioaddr->lbal_addr);
377 tf->lbam = inb(ioaddr->lbam_addr); 377 tf->lbam = inb(ioaddr->lbam_addr);
@@ -405,7 +405,7 @@ static void ata_tf_read_mmio(struct ata_port *ap, struct ata_taskfile *tf)
405 struct ata_ioports *ioaddr = &ap->ioaddr; 405 struct ata_ioports *ioaddr = &ap->ioaddr;
406 406
407 tf->command = ata_check_status(ap); 407 tf->command = ata_check_status(ap);
408 tf->feature = ata_chk_err(ap); 408 tf->feature = readb((void __iomem *)ioaddr->error_addr);
409 tf->nsect = readb((void __iomem *)ioaddr->nsect_addr); 409 tf->nsect = readb((void __iomem *)ioaddr->nsect_addr);
410 tf->lbal = readb((void __iomem *)ioaddr->lbal_addr); 410 tf->lbal = readb((void __iomem *)ioaddr->lbal_addr);
411 tf->lbam = readb((void __iomem *)ioaddr->lbam_addr); 411 tf->lbam = readb((void __iomem *)ioaddr->lbam_addr);
@@ -526,30 +526,6 @@ u8 ata_altstatus(struct ata_port *ap)
526 526
527 527
528/** 528/**
529 * ata_chk_err - Read device error reg
530 * @ap: port where the device is
531 *
532 * Reads ATA taskfile error register for
533 * currently-selected device and return its value.
534 *
535 * Note: may NOT be used as the check_err() entry in
536 * ata_port_operations.
537 *
538 * LOCKING:
539 * Inherited from caller.
540 */
541u8 ata_chk_err(struct ata_port *ap)
542{
543 if (ap->ops->check_err)
544 return ap->ops->check_err(ap);
545
546 if (ap->flags & ATA_FLAG_MMIO) {
547 return readb((void __iomem *) ap->ioaddr.error_addr);
548 }
549 return inb(ap->ioaddr.error_addr);
550}
551
552/**
553 * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure 529 * ata_tf_to_fis - Convert ATA taskfile to SATA FIS structure
554 * @tf: Taskfile to convert 530 * @tf: Taskfile to convert
555 * @fis: Buffer into which data will output 531 * @fis: Buffer into which data will output
@@ -901,8 +877,8 @@ static u8 ata_dev_try_classify(struct ata_port *ap, unsigned int device)
901 877
902 memset(&tf, 0, sizeof(tf)); 878 memset(&tf, 0, sizeof(tf));
903 879
904 err = ata_chk_err(ap);
905 ap->ops->tf_read(ap, &tf); 880 ap->ops->tf_read(ap, &tf);
881 err = tf.feature;
906 882
907 dev->class = ATA_DEV_NONE; 883 dev->class = ATA_DEV_NONE;
908 884
@@ -1139,7 +1115,6 @@ static void ata_dev_identify(struct ata_port *ap, unsigned int device)
1139 unsigned int major_version; 1115 unsigned int major_version;
1140 u16 tmp; 1116 u16 tmp;
1141 unsigned long xfer_modes; 1117 unsigned long xfer_modes;
1142 u8 status;
1143 unsigned int using_edd; 1118 unsigned int using_edd;
1144 DECLARE_COMPLETION(wait); 1119 DECLARE_COMPLETION(wait);
1145 struct ata_queued_cmd *qc; 1120 struct ata_queued_cmd *qc;
@@ -1193,8 +1168,11 @@ retry:
1193 else 1168 else
1194 wait_for_completion(&wait); 1169 wait_for_completion(&wait);
1195 1170
1196 status = ata_chk_status(ap); 1171 spin_lock_irqsave(&ap->host_set->lock, flags);
1197 if (status & ATA_ERR) { 1172 ap->ops->tf_read(ap, &qc->tf);
1173 spin_unlock_irqrestore(&ap->host_set->lock, flags);
1174
1175 if (qc->tf.command & ATA_ERR) {
1198 /* 1176 /*
1199 * arg! EDD works for all test cases, but seems to return 1177 * arg! EDD works for all test cases, but seems to return
1200 * the ATA signature for some ATAPI devices. Until the 1178 * the ATA signature for some ATAPI devices. Until the
@@ -1207,7 +1185,7 @@ retry:
1207 * to have this problem. 1185 * to have this problem.
1208 */ 1186 */
1209 if ((using_edd) && (qc->tf.command == ATA_CMD_ID_ATA)) { 1187 if ((using_edd) && (qc->tf.command == ATA_CMD_ID_ATA)) {
1210 u8 err = ata_chk_err(ap); 1188 u8 err = qc->tf.feature;
1211 if (err & ATA_ABORTED) { 1189 if (err & ATA_ABORTED) {
1212 dev->class = ATA_DEV_ATAPI; 1190 dev->class = ATA_DEV_ATAPI;
1213 qc->cursg = 0; 1191 qc->cursg = 0;
@@ -4873,7 +4851,6 @@ EXPORT_SYMBOL_GPL(ata_tf_to_fis);
4873EXPORT_SYMBOL_GPL(ata_tf_from_fis); 4851EXPORT_SYMBOL_GPL(ata_tf_from_fis);
4874EXPORT_SYMBOL_GPL(ata_check_status); 4852EXPORT_SYMBOL_GPL(ata_check_status);
4875EXPORT_SYMBOL_GPL(ata_altstatus); 4853EXPORT_SYMBOL_GPL(ata_altstatus);
4876EXPORT_SYMBOL_GPL(ata_chk_err);
4877EXPORT_SYMBOL_GPL(ata_exec_command); 4854EXPORT_SYMBOL_GPL(ata_exec_command);
4878EXPORT_SYMBOL_GPL(ata_port_start); 4855EXPORT_SYMBOL_GPL(ata_port_start);
4879EXPORT_SYMBOL_GPL(ata_port_stop); 4856EXPORT_SYMBOL_GPL(ata_port_stop);