aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sata_sx4.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-30 04:44:42 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-10-30 04:44:42 -0500
commita7dac447bb9cef27d4d29cdf63e2d7809c50b1f4 (patch)
treea8935490cdd374aba3a804ba9f79d1aed67db36d /drivers/scsi/sata_sx4.c
parent81cfb8864c73230eb1c37753aba517db15cf4d8f (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_sx4.c')
-rw-r--r--drivers/scsi/sata_sx4.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c
index af08f4f650c1..d9a8baff0d4d 100644
--- a/drivers/scsi/sata_sx4.c
+++ b/drivers/scsi/sata_sx4.c
@@ -718,7 +718,7 @@ static inline unsigned int pdc20621_host_intr( struct ata_port *ap,
718 VPRINTK("ata%u: read hdma, 0x%x 0x%x\n", ap->id, 718 VPRINTK("ata%u: read hdma, 0x%x 0x%x\n", ap->id,
719 readl(mmio + 0x104), readl(mmio + PDC_HDMA_CTLSTAT)); 719 readl(mmio + 0x104), readl(mmio + PDC_HDMA_CTLSTAT));
720 /* get drive status; clear intr; complete txn */ 720 /* get drive status; clear intr; complete txn */
721 ata_qc_complete(qc, ata_wait_idle(ap)); 721 ata_qc_complete(qc, ac_err_mask(ata_wait_idle(ap)));
722 pdc20621_pop_hdma(qc); 722 pdc20621_pop_hdma(qc);
723 } 723 }
724 724
@@ -756,7 +756,7 @@ static inline unsigned int pdc20621_host_intr( struct ata_port *ap,
756 VPRINTK("ata%u: write ata, 0x%x 0x%x\n", ap->id, 756 VPRINTK("ata%u: write ata, 0x%x 0x%x\n", ap->id,
757 readl(mmio + 0x104), readl(mmio + PDC_HDMA_CTLSTAT)); 757 readl(mmio + 0x104), readl(mmio + PDC_HDMA_CTLSTAT));
758 /* get drive status; clear intr; complete txn */ 758 /* get drive status; clear intr; complete txn */
759 ata_qc_complete(qc, ata_wait_idle(ap)); 759 ata_qc_complete(qc, ac_err_mask(ata_wait_idle(ap)));
760 pdc20621_pop_hdma(qc); 760 pdc20621_pop_hdma(qc);
761 } 761 }
762 handled = 1; 762 handled = 1;
@@ -766,7 +766,7 @@ static inline unsigned int pdc20621_host_intr( struct ata_port *ap,
766 766
767 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); 767 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
768 DPRINTK("BUS_NODATA (drv_stat 0x%X)\n", status); 768 DPRINTK("BUS_NODATA (drv_stat 0x%X)\n", status);
769 ata_qc_complete(qc, status); 769 ata_qc_complete(qc, ac_err_mask(status));
770 handled = 1; 770 handled = 1;
771 771
772 } else { 772 } else {
@@ -881,7 +881,7 @@ static void pdc_eng_timeout(struct ata_port *ap)
881 case ATA_PROT_DMA: 881 case ATA_PROT_DMA:
882 case ATA_PROT_NODATA: 882 case ATA_PROT_NODATA:
883 printk(KERN_ERR "ata%u: command timeout\n", ap->id); 883 printk(KERN_ERR "ata%u: command timeout\n", ap->id);
884 ata_qc_complete(qc, ata_wait_idle(ap) | ATA_ERR); 884 ata_qc_complete(qc, __ac_err_mask(ata_wait_idle(ap)));
885 break; 885 break;
886 886
887 default: 887 default:
@@ -890,7 +890,7 @@ static void pdc_eng_timeout(struct ata_port *ap)
890 printk(KERN_ERR "ata%u: unknown timeout, cmd 0x%x stat 0x%x\n", 890 printk(KERN_ERR "ata%u: unknown timeout, cmd 0x%x stat 0x%x\n",
891 ap->id, qc->tf.command, drv_stat); 891 ap->id, qc->tf.command, drv_stat);
892 892
893 ata_qc_complete(qc, drv_stat); 893 ata_qc_complete(qc, ac_err_mask(drv_stat));
894 break; 894 break;
895 } 895 }
896 896