Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-4]: src/sys/arch/macppc/dev Pull up revision 1.3 (requested by ...
details: https://anonhg.NetBSD.org/src/rev/9e9a89f8ad51
branches: netbsd-1-4
changeset: 470395:9e9a89f8ad51
user: he <he%NetBSD.org@localhost>
date: Tue Feb 22 22:31:31 2000 +0000
description:
Pull up revision 1.3 (requested by tsubai):
Fix the ``panic: mesh: FIFO != 0'' on some models.
diffstat:
sys/arch/macppc/dev/mesh.c | 25 ++++++++++++++++++++-----
1 files changed, 20 insertions(+), 5 deletions(-)
diffs (53 lines):
diff -r 44e5ae9f545d -r 9e9a89f8ad51 sys/arch/macppc/dev/mesh.c
--- a/sys/arch/macppc/dev/mesh.c Tue Feb 22 22:27:30 2000 +0000
+++ b/sys/arch/macppc/dev/mesh.c Tue Feb 22 22:31:31 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mesh.c,v 1.1 1999/02/19 13:06:03 tsubai Exp $ */
+/* $NetBSD: mesh.c,v 1.1.2.1 2000/02/22 22:31:31 he Exp $ */
/*-
* Copyright (C) 1999 Internet Research Institute, Inc.
@@ -303,6 +303,7 @@
{
struct mesh_softc *sc = arg;
struct mesh_scb *scb;
+ int fifocnt;
u_char intr, exception, error, status0, status1;
int i;
@@ -337,8 +338,16 @@
sc->sc_flags &= ~MESH_DMA_ACTIVE;
scb->resid = MESH_GET_XFER(sc);
- if (mesh_read_reg(sc, MESH_FIFO_COUNT) != 0)
- panic("mesh: FIFO != 0"); /* XXX */
+ fifocnt = mesh_read_reg(sc, MESH_FIFO_COUNT);
+ if (fifocnt != 0 && (scb->flags & MESH_READ)) {
+ char *cp = (char *)scb->daddr + scb->dlen - fifocnt;
+
+ while (fifocnt > 0) {
+ *cp++ = mesh_read_reg(sc, MESH_FIFO);
+ fifocnt--;
+ }
+ } else
+ mesh_set_reg(sc, MESH_SEQUENCE, MESH_CMD_FLUSH_FIFO);
}
if (intr & MESH_INTR_ERROR) {
@@ -1026,8 +1035,14 @@
}
if (scb->status == SCSI_CHECK) {
- if (scb->flags & MESH_SENSE)
- panic("SCSI_CHECK && MESH_SENSE?");
+ if (scb->flags & MESH_SENSE) {
+ printf("mesh: SCSI_CHECK && MESH_SENSE?\n");
+ xs->xs_status |= XS_STS_DONE;
+ xs->error = XS_DRIVER_STUFFUP;
+ scsipi_done(xs);
+ mesh_free_scb(sc, scb);
+ return;
+ }
xs->resid = scb->resid;
mesh_sense(sc, scb);
return;
Home |
Main Index |
Thread Index |
Old Index