diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-30 04:44:42 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-30 04:44:42 -0500 |
commit | a7dac447bb9cef27d4d29cdf63e2d7809c50b1f4 (patch) | |
tree | a8935490cdd374aba3a804ba9f79d1aed67db36d /drivers/scsi/sata_sil24.c | |
parent | 81cfb8864c73230eb1c37753aba517db15cf4d8f (diff) |
[libata] change ata_qc_complete() to take error mask as second arg
The second argument to ata_qc_complete() was being used for two
purposes: communicate the ATA Status register to the completion
function, and indicate an error. On legacy PCI IDE hardware, the latter
is often implicit in the former. On more modern hardware, the driver
often completely emulated a Status register value, passing ATA_ERR as an
indication that something went wrong.
Now that previous code changes have eliminated the need to use drv_stat
arg to communicate the ATA Status register value, we can convert it to a
mask of possible error classes.
This will lead to more flexible error handling in the future.
Diffstat (limited to 'drivers/scsi/sata_sil24.c')
-rw-r--r-- | drivers/scsi/sata_sil24.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c index e18a1e2bb65e..4afe2b15b803 100644 --- a/drivers/scsi/sata_sil24.c +++ b/drivers/scsi/sata_sil24.c | |||
@@ -498,7 +498,7 @@ static void sil24_eng_timeout(struct ata_port *ap) | |||
498 | 498 | ||
499 | qc = ata_qc_from_tag(ap, ap->active_tag); | 499 | qc = ata_qc_from_tag(ap, ap->active_tag); |
500 | if (!qc) { | 500 | if (!qc) { |
501 | printk(KERN_ERR "ata%u: BUG: tiemout without command\n", | 501 | printk(KERN_ERR "ata%u: BUG: timeout without command\n", |
502 | ap->id); | 502 | ap->id); |
503 | return; | 503 | return; |
504 | } | 504 | } |
@@ -512,7 +512,7 @@ static void sil24_eng_timeout(struct ata_port *ap) | |||
512 | */ | 512 | */ |
513 | printk(KERN_ERR "ata%u: command timeout\n", ap->id); | 513 | printk(KERN_ERR "ata%u: command timeout\n", ap->id); |
514 | qc->scsidone = scsi_finish_command; | 514 | qc->scsidone = scsi_finish_command; |
515 | ata_qc_complete(qc, ATA_ERR); | 515 | ata_qc_complete(qc, AC_ERR_OTHER); |
516 | 516 | ||
517 | sil24_reset_controller(ap); | 517 | sil24_reset_controller(ap); |
518 | } | 518 | } |
@@ -523,6 +523,7 @@ static void sil24_error_intr(struct ata_port *ap, u32 slot_stat) | |||
523 | struct sil24_port_priv *pp = ap->private_data; | 523 | struct sil24_port_priv *pp = ap->private_data; |
524 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; | 524 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; |
525 | u32 irq_stat, cmd_err, sstatus, serror; | 525 | u32 irq_stat, cmd_err, sstatus, serror; |
526 | unsigned int err_mask; | ||
526 | 527 | ||
527 | irq_stat = readl(port + PORT_IRQ_STAT); | 528 | irq_stat = readl(port + PORT_IRQ_STAT); |
528 | writel(irq_stat, port + PORT_IRQ_STAT); /* clear irq */ | 529 | writel(irq_stat, port + PORT_IRQ_STAT); /* clear irq */ |
@@ -550,17 +551,18 @@ static void sil24_error_intr(struct ata_port *ap, u32 slot_stat) | |||
550 | * Device is reporting error, tf registers are valid. | 551 | * Device is reporting error, tf registers are valid. |
551 | */ | 552 | */ |
552 | sil24_update_tf(ap); | 553 | sil24_update_tf(ap); |
554 | err_mask = ac_err_mask(pp->tf.command); | ||
553 | } else { | 555 | } else { |
554 | /* | 556 | /* |
555 | * Other errors. libata currently doesn't have any | 557 | * Other errors. libata currently doesn't have any |
556 | * mechanism to report these errors. Just turn on | 558 | * mechanism to report these errors. Just turn on |
557 | * ATA_ERR. | 559 | * ATA_ERR. |
558 | */ | 560 | */ |
559 | pp->tf.command = ATA_ERR; | 561 | err_mask = AC_ERR_OTHER; |
560 | } | 562 | } |
561 | 563 | ||
562 | if (qc) | 564 | if (qc) |
563 | ata_qc_complete(qc, pp->tf.command); | 565 | ata_qc_complete(qc, err_mask); |
564 | 566 | ||
565 | sil24_reset_controller(ap); | 567 | sil24_reset_controller(ap); |
566 | } | 568 | } |
@@ -585,7 +587,7 @@ static inline void sil24_host_intr(struct ata_port *ap) | |||
585 | sil24_update_tf(ap); | 587 | sil24_update_tf(ap); |
586 | 588 | ||
587 | if (qc) | 589 | if (qc) |
588 | ata_qc_complete(qc, pp->tf.command); | 590 | ata_qc_complete(qc, ac_err_mask(pp->tf.command)); |
589 | } else | 591 | } else |
590 | sil24_error_intr(ap, slot_stat); | 592 | sil24_error_intr(ap, slot_stat); |
591 | } | 593 | } |