Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic revert the conversion to STAILQ, it broke executi...



details:   https://anonhg.NetBSD.org/src/rev/63fd0cb98cc4
branches:  trunk
changeset: 936033:63fd0cb98cc4
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Thu Jul 16 14:39:33 2020 +0000

description:
revert the conversion to STAILQ, it broke execution of commands

diffstat:

 sys/dev/ic/ciss.c    |  42 +++++++++++++++++++++---------------------
 sys/dev/ic/cissreg.h |   6 +++---
 2 files changed, 24 insertions(+), 24 deletions(-)

diffs (167 lines):

diff -r 580118d74ba8 -r 63fd0cb98cc4 sys/dev/ic/ciss.c
--- a/sys/dev/ic/ciss.c Thu Jul 16 13:32:05 2020 +0000
+++ b/sys/dev/ic/ciss.c Thu Jul 16 14:39:33 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ciss.c,v 1.49 2020/07/14 12:04:46 jdolecek Exp $       */
+/*     $NetBSD: ciss.c,v 1.50 2020/07/16 14:39:33 jdolecek Exp $       */
 /*     $OpenBSD: ciss.c,v 1.68 2013/05/30 16:15:02 deraadt Exp $       */
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.49 2020/07/14 12:04:46 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.50 2020/07/16 14:39:33 jdolecek Exp $");
 
 #include "bio.h"
 
@@ -104,8 +104,8 @@
        struct ciss_ccb *ccb;
 
        mutex_enter(&sc->sc_mutex);
-       if ((ccb = STAILQ_FIRST(&sc->sc_free_ccb))) {
-               STAILQ_REMOVE_HEAD(&sc->sc_free_ccb, ccb_link);
+       if ((ccb = TAILQ_LAST(&sc->sc_free_ccb, ciss_queue_head))) {
+               TAILQ_REMOVE(&sc->sc_free_ccb, ccb, ccb_link);
                ccb->ccb_state = CISS_CCB_READY;
        }
        mutex_exit(&sc->sc_mutex);
@@ -117,7 +117,7 @@
 {
        ccb->ccb_state = CISS_CCB_FREE;
        mutex_enter(&sc->sc_mutex);
-       STAILQ_INSERT_HEAD(&sc->sc_free_ccb, ccb, ccb_link);
+       TAILQ_INSERT_TAIL(&sc->sc_free_ccb, ccb, ccb_link);
        mutex_exit(&sc->sc_mutex);
 }
 
@@ -339,7 +339,7 @@
                return -1;
        }
 
-       STAILQ_INIT(&sc->sc_free_ccb);
+       TAILQ_INIT(&sc->sc_free_ccb);
 
        maxfer = sc->maxsg * PAGE_SIZE;
        for (i = 0; total > 0 && i < sc->maxcmd; i++, total -= sc->ccblen) {
@@ -363,7 +363,7 @@
                    &ccb->ccb_dmamap)))
                        break;
 
-               STAILQ_INSERT_TAIL(&sc->sc_free_ccb, ccb, ccb_link);
+               TAILQ_INSERT_TAIL(&sc->sc_free_ccb, ccb, ccb_link);
        }
 
        if (i < sc->maxcmd) {
@@ -536,7 +536,7 @@
        ccb = (struct ciss_ccb *) ((char *)sc->ccbs + (id >> 2) * sc->ccblen);
        ccb->ccb_cmd.id = htole32(id);
        ccb->ccb_cmd.id_hi = htole32(0);
-       STAILQ_INSERT_TAIL(q, ccb, ccb_link);
+       TAILQ_INSERT_TAIL(q, ccb, ccb_link);
 }
 
 static void
@@ -606,7 +606,7 @@
        ciss_queue_head q;
        struct ciss_ccb *ccb1;
 
-       STAILQ_INIT(&q);
+       TAILQ_INIT(&q);
        ms /= 10;
 
        while (ms-- > 0) {
@@ -618,14 +618,14 @@
                        ciss_completed_simple(sc, &q);
                mutex_exit(&sc->sc_mutex);
 
-               while (!STAILQ_EMPTY(&q)) {
-                       ccb1 = STAILQ_FIRST(&q);
-                       STAILQ_REMOVE_HEAD(&q, ccb_link);
+               while (!TAILQ_EMPTY(&q)) {
+                       ccb1 = TAILQ_FIRST(&q);
+                       TAILQ_REMOVE(&q, ccb1, ccb_link);
 
                        KASSERT(ccb1->ccb_state == CISS_CCB_ONQ);
                        ciss_done(sc, ccb1);
                        if (ccb1 == ccb) {
-                               KASSERT(STAILQ_EMPTY(&q));
+                               KASSERT(TAILQ_EMPTY(&q));
                                return 0;
                        }
                }
@@ -1249,9 +1249,9 @@
 {
        struct ciss_ccb *ccb;
 
-       while (!STAILQ_EMPTY(q)) {
-               ccb = STAILQ_FIRST(q);
-               STAILQ_REMOVE_HEAD(q, ccb_link);
+       while (!TAILQ_EMPTY(q)) {
+               ccb = TAILQ_FIRST(q);
+               TAILQ_REMOVE(q, ccb, ccb_link);
 
                if (ccb->ccb_state == CISS_CCB_POLL) {
                        ccb->ccb_state = CISS_CCB_ONQ;
@@ -1276,15 +1276,15 @@
        if (!(bus_space_read_4(sc->sc_iot, sc->sc_ioh, CISS_ISR) & sc->iem))
                return 0;
 
-       STAILQ_INIT(&q);
+       TAILQ_INIT(&q);
        mutex_enter(&sc->sc_mutex);
        ciss_completed_simple(sc, &q);
        mutex_exit(&sc->sc_mutex);
 
-       hit = (!STAILQ_EMPTY(&q));
+       hit = (!TAILQ_EMPTY(&q));
        ciss_completed_process(sc, &q);
 
-       KASSERT(STAILQ_EMPTY(&q));
+       KASSERT(TAILQ_EMPTY(&q));
        CISS_DPRINTF(CISS_D_INTR, ("exit\n"));
 
        return hit;
@@ -1314,14 +1314,14 @@
 
        CISS_DPRINTF(CISS_D_INTR, ("intr "));
 
-       STAILQ_INIT(&q);
+       TAILQ_INIT(&q);
        mutex_enter(&sc->sc_mutex);
        ciss_completed_perf(sc, &q);
        mutex_exit(&sc->sc_mutex);
 
        ciss_completed_process(sc, &q);
 
-       KASSERT(STAILQ_EMPTY(&q));
+       KASSERT(TAILQ_EMPTY(&q));
        CISS_DPRINTF(CISS_D_INTR, ("exit"));
 
        return 1;
diff -r 580118d74ba8 -r 63fd0cb98cc4 sys/dev/ic/cissreg.h
--- a/sys/dev/ic/cissreg.h      Thu Jul 16 13:32:05 2020 +0000
+++ b/sys/dev/ic/cissreg.h      Thu Jul 16 14:39:33 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cissreg.h,v 1.8 2020/07/14 11:44:52 jdolecek Exp $     */
+/*     $NetBSD: cissreg.h,v 1.9 2020/07/16 14:39:33 jdolecek Exp $     */
 /*     $OpenBSD: cissreg.h,v 1.11 2010/06/03 01:02:13 dlg Exp $        */
 
 /*
@@ -516,7 +516,7 @@
 } __packed;
 
 struct ciss_ccb {
-       STAILQ_ENTRY(ciss_ccb)  ccb_link;
+       TAILQ_ENTRY(ciss_ccb)   ccb_link;
        paddr_t                 ccb_cmdpa;
        enum {
                CISS_CCB_FREE   = 0x01,
@@ -538,5 +538,5 @@
        struct ciss_cmd         ccb_cmd __aligned(8);   /* followed by sgl */
 };
 
-typedef STAILQ_HEAD(ciss_queue_head, ciss_ccb)     ciss_queue_head;
+typedef TAILQ_HEAD(ciss_queue_head, ciss_ccb)     ciss_queue_head;
 



Home | Main Index | Thread Index | Old Index