diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2014-02-19 07:44:45 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2014-02-19 07:44:45 +0000 |
commit | 736e26624b426efb2f37ddaeec749e6861d96892 (patch) | |
tree | d193d0e846399babdb03aa6146b29ea50ad61418 /sys/dev | |
parent | 366d333c5522bf34280f241b237ec20c596defc6 (diff) |
massage the response queue handling a bit:
break if we've already handled the queue rather than printf something.
complete all the pending entries before posting what we've done instead
of after each entry.
ok jmatthew@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/qle.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/sys/dev/pci/qle.c b/sys/dev/pci/qle.c index 14ecaeaf59b..32b711b99f1 100644 --- a/sys/dev/pci/qle.c +++ b/sys/dev/pci/qle.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qle.c,v 1.8 2014/02/19 07:15:45 dlg Exp $ */ +/* $OpenBSD: qle.c,v 1.9 2014/02/19 07:44:44 dlg Exp $ */ /* * Copyright (c) 2013, 2014 Jonathan Matthew <jmatthew@openbsd.org> @@ -1036,23 +1036,19 @@ qle_handle_intr(struct qle_softc *sc, u_int16_t isr, u_int16_t info) case QLE_INT_TYPE_IO: rspin = qle_read(sc, QLE_RESP_IN); - if (rspin == sc->sc_last_resp_id) { - /* isp(4) has some weird magic for this case */ - printf("%s: nonsense interrupt (%x)\n", DEVNAME(sc), - rspin); - } else { - while (sc->sc_last_resp_id != rspin) { - ccb = qle_handle_resp(sc, sc->sc_last_resp_id); - if (ccb) - scsi_done(ccb->ccb_xs); - - sc->sc_last_resp_id++; - if (sc->sc_last_resp_id == sc->sc_maxcmds) - sc->sc_last_resp_id = 0; - } + if (rspin == sc->sc_last_resp_id) + break; - qle_write(sc, QLE_RESP_OUT, sc->sc_last_resp_id); - } + do { + ccb = qle_handle_resp(sc, sc->sc_last_resp_id); + if (ccb) + scsi_done(ccb->ccb_xs); + + sc->sc_last_resp_id++; + sc->sc_last_resp_id %= sc->sc_maxcmds; + } while (sc->sc_last_resp_id != rspin); + + qle_write(sc, QLE_RESP_OUT, sc->sc_last_resp_id); break; case QLE_INT_TYPE_MBOX: |