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_mv.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_mv.c')
-rw-r--r-- | drivers/scsi/sata_mv.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c index dcef5fe8600b..936d1ce5575f 100644 --- a/drivers/scsi/sata_mv.c +++ b/drivers/scsi/sata_mv.c | |||
@@ -1065,6 +1065,7 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant, | |||
1065 | struct ata_queued_cmd *qc; | 1065 | struct ata_queued_cmd *qc; |
1066 | u32 hc_irq_cause; | 1066 | u32 hc_irq_cause; |
1067 | int shift, port, port0, hard_port, handled; | 1067 | int shift, port, port0, hard_port, handled; |
1068 | unsigned int err_mask; | ||
1068 | u8 ata_status = 0; | 1069 | u8 ata_status = 0; |
1069 | 1070 | ||
1070 | if (hc == 0) { | 1071 | if (hc == 0) { |
@@ -1100,15 +1101,15 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant, | |||
1100 | handled++; | 1101 | handled++; |
1101 | } | 1102 | } |
1102 | 1103 | ||
1104 | err_mask = ac_err_mask(ata_status); | ||
1105 | |||
1103 | shift = port << 1; /* (port * 2) */ | 1106 | shift = port << 1; /* (port * 2) */ |
1104 | if (port >= MV_PORTS_PER_HC) { | 1107 | if (port >= MV_PORTS_PER_HC) { |
1105 | shift++; /* skip bit 8 in the HC Main IRQ reg */ | 1108 | shift++; /* skip bit 8 in the HC Main IRQ reg */ |
1106 | } | 1109 | } |
1107 | if ((PORT0_ERR << shift) & relevant) { | 1110 | if ((PORT0_ERR << shift) & relevant) { |
1108 | mv_err_intr(ap); | 1111 | mv_err_intr(ap); |
1109 | /* OR in ATA_ERR to ensure libata knows we took one */ | 1112 | err_mask |= AC_ERR_OTHER; |
1110 | ata_status = readb((void __iomem *) | ||
1111 | ap->ioaddr.status_addr) | ATA_ERR; | ||
1112 | handled++; | 1113 | handled++; |
1113 | } | 1114 | } |
1114 | 1115 | ||
@@ -1118,7 +1119,7 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant, | |||
1118 | VPRINTK("port %u IRQ found for qc, " | 1119 | VPRINTK("port %u IRQ found for qc, " |
1119 | "ata_status 0x%x\n", port,ata_status); | 1120 | "ata_status 0x%x\n", port,ata_status); |
1120 | /* mark qc status appropriately */ | 1121 | /* mark qc status appropriately */ |
1121 | ata_qc_complete(qc, ata_status); | 1122 | ata_qc_complete(qc, err_mask); |
1122 | } | 1123 | } |
1123 | } | 1124 | } |
1124 | } | 1125 | } |
@@ -1294,7 +1295,7 @@ static void mv_eng_timeout(struct ata_port *ap) | |||
1294 | */ | 1295 | */ |
1295 | spin_lock_irqsave(&ap->host_set->lock, flags); | 1296 | spin_lock_irqsave(&ap->host_set->lock, flags); |
1296 | qc->scsidone = scsi_finish_command; | 1297 | qc->scsidone = scsi_finish_command; |
1297 | ata_qc_complete(qc, ATA_ERR); | 1298 | ata_qc_complete(qc, AC_ERR_OTHER); |
1298 | spin_unlock_irqrestore(&ap->host_set->lock, flags); | 1299 | spin_unlock_irqrestore(&ap->host_set->lock, flags); |
1299 | } | 1300 | } |
1300 | } | 1301 | } |