From be4003f042ed9e94a96ea33b4699ab576af838ae Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Thu, 27 Mar 2014 07:06:34 +0000 Subject: you want the ring to wrap when it gets to the size of the ring, not one after it. jmatthew@ figured out i am bad at c. --- sys/dev/pci/mpii.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/mpii.c b/sys/dev/pci/mpii.c index 31dbe9bf87c..1cea9b9d75e 100644 --- a/sys/dev/pci/mpii.c +++ b/sys/dev/pci/mpii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpii.c,v 1.85 2014/03/27 05:53:37 dlg Exp $ */ +/* $OpenBSD: mpii.c,v 1.86 2014/03/27 07:06:33 dlg Exp $ */ /* * Copyright (c) 2010, 2012 Mike Belopuhov * Copyright (c) 2009 James Giannoules @@ -1331,7 +1331,7 @@ mpii_push_reply(struct mpii_softc *sc, struct mpii_rcb *rcb) rfp = MPII_DMA_KVA(sc->sc_reply_freeq); htolem32(&rfp[idx], rcb->rcb_reply_dva); - if (++idx > sc->sc_reply_free_qdepth) + if (++idx >= sc->sc_reply_free_qdepth) idx = 0; mpii_write_reply_free(sc, sc->sc_reply_free_host_index = idx); -- cgit v1.2.3