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/pdc_adma.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/pdc_adma.c')
-rw-r--r-- | drivers/scsi/pdc_adma.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/scsi/pdc_adma.c b/drivers/scsi/pdc_adma.c index af99feb9d237..74b3b2c629b6 100644 --- a/drivers/scsi/pdc_adma.c +++ b/drivers/scsi/pdc_adma.c | |||
@@ -451,7 +451,7 @@ static inline unsigned int adma_intr_pkt(struct ata_host_set *host_set) | |||
451 | struct adma_port_priv *pp; | 451 | struct adma_port_priv *pp; |
452 | struct ata_queued_cmd *qc; | 452 | struct ata_queued_cmd *qc; |
453 | void __iomem *chan = ADMA_REGS(mmio_base, port_no); | 453 | void __iomem *chan = ADMA_REGS(mmio_base, port_no); |
454 | u8 drv_stat = 0, status = readb(chan + ADMA_STATUS); | 454 | u8 status = readb(chan + ADMA_STATUS); |
455 | 455 | ||
456 | if (status == 0) | 456 | if (status == 0) |
457 | continue; | 457 | continue; |
@@ -464,11 +464,14 @@ static inline unsigned int adma_intr_pkt(struct ata_host_set *host_set) | |||
464 | continue; | 464 | continue; |
465 | qc = ata_qc_from_tag(ap, ap->active_tag); | 465 | qc = ata_qc_from_tag(ap, ap->active_tag); |
466 | if (qc && (!(qc->tf.ctl & ATA_NIEN))) { | 466 | if (qc && (!(qc->tf.ctl & ATA_NIEN))) { |
467 | unsigned int err_mask = 0; | ||
468 | |||
467 | if ((status & (aPERR | aPSD | aUIRQ))) | 469 | if ((status & (aPERR | aPSD | aUIRQ))) |
468 | drv_stat = ATA_ERR; | 470 | err_mask = AC_ERR_OTHER; |
469 | else if (pp->pkt[0] != cDONE) | 471 | else if (pp->pkt[0] != cDONE) |
470 | drv_stat = ATA_ERR; | 472 | err_mask = AC_ERR_OTHER; |
471 | ata_qc_complete(qc, drv_stat); | 473 | |
474 | ata_qc_complete(qc, err_mask); | ||
472 | } | 475 | } |
473 | } | 476 | } |
474 | return handled; | 477 | return handled; |
@@ -498,7 +501,7 @@ static inline unsigned int adma_intr_mmio(struct ata_host_set *host_set) | |||
498 | 501 | ||
499 | /* complete taskfile transaction */ | 502 | /* complete taskfile transaction */ |
500 | pp->state = adma_state_idle; | 503 | pp->state = adma_state_idle; |
501 | ata_qc_complete(qc, status); | 504 | ata_qc_complete(qc, ac_err_mask(status)); |
502 | handled = 1; | 505 | handled = 1; |
503 | } | 506 | } |
504 | } | 507 | } |