Source-Changes-HG archive

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

[src/jdolecek-ncq]: src/sys/dev actually remove the KASSERT() for queue_activ...



details:   https://anonhg.NetBSD.org/src/rev/e22e00c9b257
branches:  jdolecek-ncq
changeset: 822934:e22e00c9b257
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Wed Jun 21 19:21:25 2017 +0000

description:
actually remove the KASSERT() for queue_active in wdc.c as it's superfluous,
and make struct ata_queue completly opaque to attachment code; fix two other
places which were not converted to ata_queue_alloc() which were surfaced
by this change

diffstat:

 sys/dev/ata/atavar.h        |  8 +++++---
 sys/dev/ic/wdc.c            |  5 ++---
 sys/dev/isa/wdc_isa.c       |  7 +++----
 sys/dev/pcmcia/wdc_pcmcia.c |  7 +++----
 4 files changed, 13 insertions(+), 14 deletions(-)

diffs (131 lines):

diff -r 1d291b1847fa -r e22e00c9b257 sys/dev/ata/atavar.h
--- a/sys/dev/ata/atavar.h      Tue Jun 20 21:55:09 2017 +0000
+++ b/sys/dev/ata/atavar.h      Wed Jun 21 19:21:25 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atavar.h,v 1.92.8.11 2017/06/20 20:58:22 jdolecek Exp $        */
+/*     $NetBSD: atavar.h,v 1.92.8.12 2017/06/21 19:21:25 jdolecek Exp $        */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -191,12 +191,14 @@
 #define ATA_MAX_OPENINGS       31
 
 /* Per-channel queue of ata_xfers */
+#ifndef ATABUS_PRIVATE
+struct ata_queue;
+#else
 struct ata_queue {
        int8_t queue_flags;             /* flags for this queue */
 #define QF_IDLE_WAIT   0x01            /* someone wants the controller idle */
 #define QF_NEED_XFER   0x02            /* someone wants xfer */
        int8_t queue_active;            /* number of active transfers */
-#ifdef ATABUS_PRIVATE
        int8_t queue_openings;                  /* max number of active xfers */
        TAILQ_HEAD(, ata_xfer) queue_xfer;      /* queue of pending commands */
        int queue_freeze;                       /* freeze count for the queue */
@@ -205,8 +207,8 @@
        uint32_t active_xfers_used;             /* mask of active commands */
        uint32_t queue_xfers_avail;             /* available xfers mask */
        struct ata_xfer queue_xfers[0];         /* xfers */
+};
 #endif
-};
 
 /* ATA bus instance state information. */
 struct atabus_softc {
diff -r 1d291b1847fa -r e22e00c9b257 sys/dev/ic/wdc.c
--- a/sys/dev/ic/wdc.c  Tue Jun 20 21:55:09 2017 +0000
+++ b/sys/dev/ic/wdc.c  Wed Jun 21 19:21:25 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc.c,v 1.283.2.7 2017/06/20 20:58:22 jdolecek Exp $ */
+/*     $NetBSD: wdc.c,v 1.283.2.8 2017/06/21 19:21:25 jdolecek Exp $ */
 
 /*
  * Copyright (c) 1998, 2001, 2003 Manuel Bouyer.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.283.2.7 2017/06/20 20:58:22 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.283.2.8 2017/06/21 19:21:25 jdolecek Exp $");
 
 #include "opt_ata.h"
 #include "opt_wdc.h"
@@ -873,7 +873,6 @@
        }
 
        ATADEBUG_PRINT(("wdcintr\n"), DEBUG_INTR);
-       KASSERT(chp->ch_queue->queue_active == 1);
        xfer = ata_queue_get_active_xfer(chp->ch_queue);
        KASSERT(xfer != NULL);
 #ifdef DIAGNOSTIC
diff -r 1d291b1847fa -r e22e00c9b257 sys/dev/isa/wdc_isa.c
--- a/sys/dev/isa/wdc_isa.c     Tue Jun 20 21:55:09 2017 +0000
+++ b/sys/dev/isa/wdc_isa.c     Wed Jun 21 19:21:25 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_isa.c,v 1.59 2012/07/31 15:50:35 bouyer Exp $ */
+/*     $NetBSD: wdc_isa.c,v 1.59.28.1 2017/06/21 19:21:25 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_isa.c,v 1.59 2012/07/31 15:50:35 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_isa.c,v 1.59.28.1 2017/06/21 19:21:25 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -60,7 +60,6 @@
        struct  wdc_softc sc_wdcdev;
        struct  ata_channel *wdc_chanlist[1];
        struct  ata_channel ata_channel;
-       struct  ata_queue wdc_chqueue;
        struct  wdc_regs wdc_regs;
        isa_chipset_tag_t sc_ic;
        void    *sc_ih;
@@ -227,7 +226,7 @@
        sc->sc_wdcdev.wdc_maxdrives = 2;
        sc->ata_channel.ch_channel = 0;
        sc->ata_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
-       sc->ata_channel.ch_queue = &sc->wdc_chqueue;
+       sc->ata_channel.ch_queue = ata_queue_alloc(1);
        wdc_init_shadow_regs(&sc->ata_channel);
 
        aprint_normal("\n");
diff -r 1d291b1847fa -r e22e00c9b257 sys/dev/pcmcia/wdc_pcmcia.c
--- a/sys/dev/pcmcia/wdc_pcmcia.c       Tue Jun 20 21:55:09 2017 +0000
+++ b/sys/dev/pcmcia/wdc_pcmcia.c       Wed Jun 21 19:21:25 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_pcmcia.c,v 1.124 2013/10/12 16:49:01 christos Exp $ */
+/*     $NetBSD: wdc_pcmcia.c,v 1.124.18.1 2017/06/21 19:21:25 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_pcmcia.c,v 1.124 2013/10/12 16:49:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_pcmcia.c,v 1.124.18.1 2017/06/21 19:21:25 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -65,7 +65,6 @@
        struct wdc_softc sc_wdcdev;
        struct ata_channel *wdc_chanlist[1];
        struct ata_channel ata_channel;
-       struct ata_queue wdc_chqueue;
        struct wdc_regs wdc_regs;
 
        struct pcmcia_function *sc_pf;
@@ -296,7 +295,7 @@
        sc->sc_wdcdev.sc_atac.atac_nchannels = 1;
        sc->ata_channel.ch_channel = 0;
        sc->ata_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
-       sc->ata_channel.ch_queue = &sc->wdc_chqueue;
+       sc->ata_channel.ch_queue = ata_queue_alloc(1);
        wdcp = pcmcia_product_lookup(pa, wdc_pcmcia_products,
            wdc_pcmcia_nproducts, sizeof(wdc_pcmcia_products[0]), NULL);
        sc->sc_wdcdev.wdc_maxdrives = wdcp ? wdcp->wdc_ndrive : 2;



Home | Main Index | Thread Index | Old Index