summaryrefslogtreecommitdiffstats
path: root/sys/dev/aha
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1998-12-13 00:05:04 +0000
committergibbs <gibbs@FreeBSD.org>1998-12-13 00:05:04 +0000
commit9bdc2c6395f2a14cb3f64472024d64f663780251 (patch)
tree4be2cb9ea68b0689a4cd4acef50d6a21dbc01033 /sys/dev/aha
parent2b1b55401189f2d9aa79d72c43df5dbc776ae56b (diff)
downloadFreeBSD-src-9bdc2c6395f2a14cb3f64472024d64f663780251.zip
FreeBSD-src-9bdc2c6395f2a14cb3f64472024d64f663780251.tar.gz
Pull in fixes similar to those recently committed to the bt driver:
- For transactions of 0 length, us a non-residual checking CCB type. - Preserve command status if our interrupt handler completes a command while we are polling for completion in aha_cmd.
Diffstat (limited to 'sys/dev/aha')
-rw-r--r--sys/dev/aha/aha.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/aha/aha.c b/sys/dev/aha/aha.c
index 0fe69c0..82845c2 100644
--- a/sys/dev/aha/aha.c
+++ b/sys/dev/aha/aha.c
@@ -55,7 +55,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aha.c,v 1.13 1998/11/25 19:12:56 imp Exp $
+ * $Id: aha.c,v 1.14 1998/12/04 22:54:44 archie Exp $
*/
#include <sys/param.h>
@@ -1181,7 +1181,7 @@ ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
bus_dmamap_sync(aha->buffer_dmat, accb->dmamap, op);
} else {
- accb->hccb.opcode = INITIATOR_CCB_WRESID;
+ accb->hccb.opcode = INITIATOR_CCB;
ahautoa24(0, accb->hccb.data_len);
ahautoa24(0, accb->hccb.data_addr);
}
@@ -1547,11 +1547,13 @@ aha_cmd(struct aha_softc *aha, aha_op_t opcode, u_int8_t *params,
u_int intstat;
u_int reply_buf_size;
int s;
+ int cmd_complete;
/* No data returned to start */
reply_buf_size = reply_len;
reply_len = 0;
intstat = 0;
+ cmd_complete = 0;
aha->command_cmp = 0;
/*
@@ -1587,10 +1589,13 @@ aha_cmd(struct aha_softc *aha, aha_op_t opcode, u_int8_t *params,
status = aha_inb(aha, STATUS_REG);
intstat = aha_inb(aha, INTSTAT_REG);
if ((intstat & (INTR_PENDING|CMD_COMPLETE))
- == (INTR_PENDING|CMD_COMPLETE))
+ == (INTR_PENDING|CMD_COMPLETE)) {
+ cmd_complete = 1;
break;
+ }
if (aha->command_cmp != 0) {
status = aha->latched_status;
+ cmd_complete = 1;
break;
}
if ((status & DATAIN_REG_READY) != 0)
@@ -1610,7 +1615,7 @@ aha_cmd(struct aha_softc *aha, aha_op_t opcode, u_int8_t *params,
* For all other commands, we wait for any output data
* and the final comand completion interrupt.
*/
- while (--cmd_timeout) {
+ while (cmd_complete == 0 && --cmd_timeout) {
status = aha_inb(aha, STATUS_REG);
intstat = aha_inb(aha, INTSTAT_REG);
OpenPOWER on IntegriCloud