diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-01-16 23:57:46 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-01-16 23:57:46 +0000 |
commit | dafeddbcf0a0bf444d3152eead4a974d66b209ed (patch) | |
tree | a3f864e7968edd3705fe34bde33e1d355735ef0d /sys/arch | |
parent | 03f25f176239705e95cafed7e2cfb98a666c0cfd (diff) |
Set the number of openings to the number of ring descriptors minus one. For
some reason, setting it to the number of descriptors causes ring overruns.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc64/dev/vdsk.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/sys/arch/sparc64/dev/vdsk.c b/sys/arch/sparc64/dev/vdsk.c index 73cb229acf0..321a4890046 100644 --- a/sys/arch/sparc64/dev/vdsk.c +++ b/sys/arch/sparc64/dev/vdsk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vdsk.c,v 1.4 2009/01/16 17:50:55 kettenis Exp $ */ +/* $OpenBSD: vdsk.c,v 1.5 2009/01/16 23:57:45 kettenis Exp $ */ /* * Copyright (c) 2009 Mark Kettenis * @@ -340,7 +340,7 @@ vdsk_attach(struct device *parent, struct device *self, void *aux) sc->sc_link.adapter_buswidth = 2; sc->sc_link.luns = 1; /* XXX slices should be presented as luns? */ sc->sc_link.adapter_target = 2; - sc->sc_link.openings = 32; + sc->sc_link.openings = sc->sc_vd->vd_nentries - 1; bzero(&saa, sizeof(saa)); saa.saa_sc_link = &sc->sc_link; @@ -634,8 +634,6 @@ vdsk_rx_vio_data(struct vdsk_softc *sc, struct vio_msg *vm) void vdsk_rx_vio_dring_data(struct vdsk_softc *sc, struct vio_msg_tag *tag) { - struct vio_dring_msg *dm = (struct vio_dring_msg *)tag; - switch(tag->stype) { case VIO_SUBTYPE_INFO: DPRINTF(("DATA/INFO/DRING_DATA\n")); @@ -679,16 +677,6 @@ vdsk_rx_vio_dring_data(struct vdsk_softc *sc, struct vio_msg_tag *tag) case VIO_SUBTYPE_NACK: DPRINTF(("DATA/NACK/DRING_DATA\n")); - { - uint64_t *msg = (uint64_t *)tag; - int i, idx; - for (i = 0; i < 7; i++) - printf("word %d: %llx\n", i + 1, msg[i]); - idx = dm->start_idx; - printf("state 0x%02x\n", sc->sc_vd->vd_desc[idx].hdr.dstate); - printf("status 0x%04x\n", sc->sc_vd->vd_desc[idx].status); - printf("size 0x%04x\n", sc->sc_vd->vd_desc[idx].size); - } break; default: @@ -929,6 +917,8 @@ vdsk_scsi_cmd(struct scsi_xfer *xs) int len, ncookies; int desc; + KASSERT(sc->sc_tx_cnt < sc->sc_vd->vd_nentries); + desc = sc->sc_tx_prod; ncookies = 0; |