Source-Changes-HG archive

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

[src/trunk]: src/sys move ata_queue_alloc(1) and ata_queue_free() calls to at...



details:   https://anonhg.NetBSD.org/src/rev/a88e3fff1cbd
branches:  trunk
changeset: 827207:a88e3fff1cbd
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Fri Oct 20 07:06:05 2017 +0000

description:
move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606

diffstat:

 sys/arch/acorn32/eb7500atx/rside.c     |   5 ++---
 sys/arch/acorn32/mainbus/wdc_pioc.c    |   5 ++---
 sys/arch/acorn32/podulebus/icside.c    |   5 ++---
 sys/arch/acorn32/podulebus/rapide.c    |   5 ++---
 sys/arch/acorn32/podulebus/simide.c    |   5 ++---
 sys/arch/amiga/dev/efa.c               |   3 +--
 sys/arch/amiga/dev/wdc_acafh.c         |   5 ++---
 sys/arch/amiga/dev/wdc_amiga.c         |   5 ++---
 sys/arch/amiga/dev/wdc_buddha.c        |   8 +-------
 sys/arch/amiga/dev/wdc_xsurf.c         |   3 +--
 sys/arch/arm/gemini/obio_wdc.c         |   6 +++---
 sys/arch/atari/dev/wdc_mb.c            |   6 +++---
 sys/arch/dreamcast/dev/g1/wdc_g1.c     |   4 ++--
 sys/arch/evbarm/iq31244/wdc_obio.c     |   6 +++---
 sys/arch/evbarm/tsarm/wdc_ts.c         |   6 +++---
 sys/arch/evbppc/mpc85xx/wdc_obio.c     |   5 ++---
 sys/arch/i386/pnpbios/pciide_pnpbios.c |  10 ++--------
 sys/arch/landisk/dev/wdc_obio.c        |   5 ++---
 sys/arch/mac68k/obio/wdc_obio.c        |   6 +++---
 sys/arch/macppc/dev/kauai.c            |   6 +++---
 sys/arch/macppc/dev/wdc_obio.c         |   6 +++---
 sys/arch/mips/adm5120/dev/wdc_extio.c  |   6 +++---
 sys/arch/mmeye/dev/wdc_mainbus.c       |   6 +++---
 sys/arch/playstation2/dev/wdc_spd.c    |   5 ++---
 sys/arch/prep/pnpbus/wdc_pnpbus.c      |   6 +++---
 sys/dev/ata/ata.c                      |   8 ++++----
 sys/dev/ata/ata_subr.c                 |  14 ++++++++++++--
 sys/dev/ic/ahcisata_core.c             |   6 ++----
 sys/dev/ic/ninjaata32.c                |   7 ++-----
 sys/dev/ic/siisata.c                   |   6 ++----
 sys/dev/ic/wdc.c                       |   6 ++----
 sys/dev/ic/wdc_upc.c                   |   5 ++---
 sys/dev/isa/wdc_isa.c                  |   6 +++---
 sys/dev/isapnp/wdc_isapnp.c            |   6 +++---
 sys/dev/ofisa/wdc_ofisa.c              |   6 +++---
 sys/dev/pci/artsata.c                  |  12 +++---------
 sys/dev/pci/cmdide.c                   |  19 +++----------------
 sys/dev/pci/cypide.c                   |  12 +++---------
 sys/dev/pci/pciide_common.c            |  15 +++------------
 sys/dev/pci/pdcsata.c                  |  13 +++----------
 sys/dev/pci/satalink.c                 |  12 +++---------
 sys/dev/pci/viaide.c                   |  12 +++---------
 sys/dev/pcmcia/wdc_pcmcia.c            |   6 +++---
 sys/dev/podulebus/dtide.c              |   5 ++---
 sys/dev/podulebus/hcide.c              |   5 ++---
 sys/dev/usb/umass_isdata.c             |   8 ++------
 46 files changed, 122 insertions(+), 205 deletions(-)

diffs (truncated from 1310 to 300 lines):

diff -r 389ff556c363 -r a88e3fff1cbd sys/arch/acorn32/eb7500atx/rside.c
--- a/sys/arch/acorn32/eb7500atx/rside.c        Fri Oct 20 03:45:47 2017 +0000
+++ b/sys/arch/acorn32/eb7500atx/rside.c        Fri Oct 20 07:06:05 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rside.c,v 1.15 2017/10/07 16:05:31 jdolecek Exp $      */
+/*     $NetBSD: rside.c,v 1.16 2017/10/20 07:06:05 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2004 Christopher Gilbert
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rside.c,v 1.15 2017/10/07 16:05:31 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rside.c,v 1.16 2017/10/20 07:06:05 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -198,7 +198,6 @@
 
                cp->ch_channel = channel;
                cp->ch_atac = &sc->sc_wdcdev.sc_atac;
-               cp->ch_queue = ata_queue_alloc(1);
                wdr->cmd_iot = wdr->ctl_iot = &sc->sc_tag;
                if (bus_space_map(wdr->cmd_iot,
                    rside_info[channel].drive_registers,
diff -r 389ff556c363 -r a88e3fff1cbd sys/arch/acorn32/mainbus/wdc_pioc.c
--- a/sys/arch/acorn32/mainbus/wdc_pioc.c       Fri Oct 20 03:45:47 2017 +0000
+++ b/sys/arch/acorn32/mainbus/wdc_pioc.c       Fri Oct 20 07:06:05 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_pioc.c,v 1.29 2017/10/07 16:05:31 jdolecek Exp $   */
+/*     $NetBSD: wdc_pioc.c,v 1.30 2017/10/20 07:06:06 jdolecek Exp $   */
 
 /*
  * Copyright (c) 1997-1998 Mark Brinicombe.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_pioc.c,v 1.29 2017/10/07 16:05:31 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_pioc.c,v 1.30 2017/10/20 07:06:06 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -179,7 +179,6 @@
        sc->sc_wdcdev.sc_atac.atac_nchannels = 1;
        sc->sc_wdcdev.wdc_maxdrives = 2;
        sc->sc_channel.ch_channel = 0;
-       sc->sc_channel.ch_queue = ata_queue_alloc(1);
 
        wdc_init_shadow_regs(wdr);
 
diff -r 389ff556c363 -r a88e3fff1cbd sys/arch/acorn32/podulebus/icside.c
--- a/sys/arch/acorn32/podulebus/icside.c       Fri Oct 20 03:45:47 2017 +0000
+++ b/sys/arch/acorn32/podulebus/icside.c       Fri Oct 20 07:06:05 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: icside.c,v 1.33 2017/10/07 16:05:31 jdolecek Exp $     */
+/*     $NetBSD: icside.c,v 1.34 2017/10/20 07:06:06 jdolecek Exp $     */
 
 /*
  * Copyright (c) 1997-1998 Mark Brinicombe
@@ -42,7 +42,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: icside.c,v 1.33 2017/10/07 16:05:31 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: icside.c,v 1.34 2017/10/20 07:06:06 jdolecek Exp $");
 
 #include <sys/systm.h>
 #include <sys/conf.h>
@@ -269,7 +269,6 @@
 
                cp->ch_channel = channel;
                cp->ch_atac = &sc->sc_wdcdev.sc_atac;
-               cp->ch_queue = ata_queue_alloc(1);
                wdr->cmd_iot = &sc->sc_tag;
                wdr->ctl_iot = &sc->sc_tag;
                if (ide->modspace)
diff -r 389ff556c363 -r a88e3fff1cbd sys/arch/acorn32/podulebus/rapide.c
--- a/sys/arch/acorn32/podulebus/rapide.c       Fri Oct 20 03:45:47 2017 +0000
+++ b/sys/arch/acorn32/podulebus/rapide.c       Fri Oct 20 07:06:05 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rapide.c,v 1.31 2017/10/07 16:05:31 jdolecek Exp $     */
+/*     $NetBSD: rapide.c,v 1.32 2017/10/20 07:06:06 jdolecek Exp $     */
 
 /*
  * Copyright (c) 1997-1998 Mark Brinicombe
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rapide.c,v 1.31 2017/10/07 16:05:31 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rapide.c,v 1.32 2017/10/20 07:06:06 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -258,7 +258,6 @@
 
                cp->ch_channel = channel;
                cp->ch_atac = &sc->sc_wdcdev.sc_atac;
-               cp->ch_queue = ata_queue_alloc(1);
                wdr->cmd_iot = iot;
                wdr->ctl_iot = iot;
                wdr->data32iot = iot;
diff -r 389ff556c363 -r a88e3fff1cbd sys/arch/acorn32/podulebus/simide.c
--- a/sys/arch/acorn32/podulebus/simide.c       Fri Oct 20 03:45:47 2017 +0000
+++ b/sys/arch/acorn32/podulebus/simide.c       Fri Oct 20 07:06:05 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: simide.c,v 1.30 2017/10/07 16:05:31 jdolecek Exp $     */
+/*     $NetBSD: simide.c,v 1.31 2017/10/20 07:06:06 jdolecek Exp $     */
 
 /*
  * Copyright (c) 1997-1998 Mark Brinicombe
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: simide.c,v 1.30 2017/10/07 16:05:31 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: simide.c,v 1.31 2017/10/20 07:06:06 jdolecek Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -257,7 +257,6 @@
 
                cp->ch_channel = channel;
                cp->ch_atac = &sc->sc_wdcdev.sc_atac;
-               cp->ch_queue = ata_queue_alloc(1);
                wdr->cmd_iot = wdr->ctl_iot = &sc->sc_tag;
                iobase = pa->pa_podule->mod_base;
                if (bus_space_map(wdr->cmd_iot, iobase +
diff -r 389ff556c363 -r a88e3fff1cbd sys/arch/amiga/dev/efa.c
--- a/sys/arch/amiga/dev/efa.c  Fri Oct 20 03:45:47 2017 +0000
+++ b/sys/arch/amiga/dev/efa.c  Fri Oct 20 07:06:05 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: efa.c,v 1.14 2017/10/07 16:05:31 jdolecek Exp $ */
+/*     $NetBSD: efa.c,v 1.15 2017/10/20 07:06:06 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -208,7 +208,6 @@
 
        sc->sc_ports[chnum].chan.ch_channel = chnum;
        sc->sc_ports[chnum].chan.ch_atac = &sc->sc_wdcdev.sc_atac;
-       sc->sc_ports[chnum].chan.ch_queue = ata_queue_alloc(1);
 
        if (!sc->sc_32bit_io)
                efa_select_regset(sc, chnum, 0); /* Start in PIO0. */
diff -r 389ff556c363 -r a88e3fff1cbd sys/arch/amiga/dev/wdc_acafh.c
--- a/sys/arch/amiga/dev/wdc_acafh.c    Fri Oct 20 03:45:47 2017 +0000
+++ b/sys/arch/amiga/dev/wdc_acafh.c    Fri Oct 20 07:06:05 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_acafh.c,v 1.5 2017/10/07 16:05:31 jdolecek Exp $ */
+/*     $NetBSD: wdc_acafh.c,v 1.6 2017/10/20 07:06:06 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 2000, 2003, 2013 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_acafh.c,v 1.5 2017/10/07 16:05:31 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_acafh.c,v 1.6 2017/10/20 07:06:06 jdolecek Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -153,7 +153,6 @@
        memset(&sc->sc_slots[chnum],0,sizeof(struct wdc_acafh_slot));
        sc->sc_slots[chnum].channel.ch_channel = chnum;
        sc->sc_slots[chnum].channel.ch_atac = &sc->sc_wdcdev.sc_atac;
-       sc->sc_slots[chnum].channel.ch_queue = ata_queue_alloc(1);
 
        wdc_acafh_map_channel(sc, chnum);
 
diff -r 389ff556c363 -r a88e3fff1cbd sys/arch/amiga/dev/wdc_amiga.c
--- a/sys/arch/amiga/dev/wdc_amiga.c    Fri Oct 20 03:45:47 2017 +0000
+++ b/sys/arch/amiga/dev/wdc_amiga.c    Fri Oct 20 07:06:05 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_amiga.c,v 1.39 2017/10/07 16:05:31 jdolecek Exp $ */
+/*     $NetBSD: wdc_amiga.c,v 1.40 2017/10/20 07:06:06 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_amiga.c,v 1.39 2017/10/07 16:05:31 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_amiga.c,v 1.40 2017/10/20 07:06:06 jdolecek Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -135,7 +135,6 @@
        sc->sc_wdcdev.wdc_maxdrives = 2;
        sc->sc_channel.ch_channel = 0;
        sc->sc_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
-       sc->sc_channel.ch_queue = ata_queue_alloc(1);
 
        wdc_init_shadow_regs(wdr);
 
diff -r 389ff556c363 -r a88e3fff1cbd sys/arch/amiga/dev/wdc_buddha.c
--- a/sys/arch/amiga/dev/wdc_buddha.c   Fri Oct 20 03:45:47 2017 +0000
+++ b/sys/arch/amiga/dev/wdc_buddha.c   Fri Oct 20 07:06:05 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_buddha.c,v 1.9 2017/10/07 16:05:31 jdolecek Exp $  */
+/*     $NetBSD: wdc_buddha.c,v 1.10 2017/10/20 07:06:06 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -128,12 +128,6 @@
 
                cp->ch_channel = ch;
                cp->ch_atac = &sc->sc_wdcdev.sc_atac;
-               cp->ch_queue = ata_queue_alloc(1);
-               if (cp->ch_queue == NULL) {
-                       aprint_error_dev(self,
-                           "can't allocate memory for command queue\n");
-                       return;
-               }
 
                /*
                 * XXX According to the Buddha docs, we should use a method
diff -r 389ff556c363 -r a88e3fff1cbd sys/arch/amiga/dev/wdc_xsurf.c
--- a/sys/arch/amiga/dev/wdc_xsurf.c    Fri Oct 20 03:45:47 2017 +0000
+++ b/sys/arch/amiga/dev/wdc_xsurf.c    Fri Oct 20 07:06:05 2017 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: wdc_xsurf.c,v 1.5 2017/10/07 16:05:31 jdolecek Exp $ */
+/*      $NetBSD: wdc_xsurf.c,v 1.6 2017/10/20 07:06:06 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -164,7 +164,6 @@
        memset(&sc->sc_ports[chnum],0,sizeof(struct wdc_xsurf_port));
        sc->sc_ports[chnum].channel.ch_channel = chnum;
        sc->sc_ports[chnum].channel.ch_atac = &sc->sc_wdcdev.sc_atac;
-       sc->sc_ports[chnum].channel.ch_queue = ata_queue_alloc(1);
 
        wdc_xsurf_map_channel(sc, chnum);       
 
diff -r 389ff556c363 -r a88e3fff1cbd sys/arch/arm/gemini/obio_wdc.c
--- a/sys/arch/arm/gemini/obio_wdc.c    Fri Oct 20 03:45:47 2017 +0000
+++ b/sys/arch/arm/gemini/obio_wdc.c    Fri Oct 20 07:06:05 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: obio_wdc.c,v 1.7 2017/10/07 19:58:53 jdolecek Exp $    */
+/*     $NetBSD: obio_wdc.c,v 1.8 2017/10/20 07:06:06 jdolecek Exp $    */
 
 /* adapted from iq31244/wdc_obio.c:
  *     NetBSD: wdc_obio.c,v 1.5 2008/04/28 20:23:16 martin Exp
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obio_wdc.c,v 1.7 2017/10/07 19:58:53 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio_wdc.c,v 1.8 2017/10/20 07:06:06 jdolecek Exp $");
 
 #include "locators.h"
 
@@ -140,7 +140,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 = ata_queue_alloc(1);
+
        wdc_init_shadow_regs(wdr);
 
        aprint_normal("\n");
diff -r 389ff556c363 -r a88e3fff1cbd sys/arch/atari/dev/wdc_mb.c
--- a/sys/arch/atari/dev/wdc_mb.c       Fri Oct 20 03:45:47 2017 +0000
+++ b/sys/arch/atari/dev/wdc_mb.c       Fri Oct 20 07:06:05 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_mb.c,v 1.39 2017/10/07 16:05:31 jdolecek Exp $     */
+/*     $NetBSD: wdc_mb.c,v 1.40 2017/10/20 07:06:06 jdolecek Exp $     */
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_mb.c,v 1.39 2017/10/07 16:05:31 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_mb.c,v 1.40 2017/10/20 07:06:06 jdolecek Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -199,7 +199,7 @@
        sc->sc_wdcdev.wdc_maxdrives = 2;
        sc->sc_channel.ch_channel = 0;
        sc->sc_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
-       sc->sc_channel.ch_queue = ata_queue_alloc(1);
+
        wdc_init_shadow_regs(wdr);
 
        /*
diff -r 389ff556c363 -r a88e3fff1cbd sys/arch/dreamcast/dev/g1/wdc_g1.c
--- a/sys/arch/dreamcast/dev/g1/wdc_g1.c        Fri Oct 20 03:45:47 2017 +0000
+++ b/sys/arch/dreamcast/dev/g1/wdc_g1.c        Fri Oct 20 07:06:05 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_g1.c,v 1.2 2017/10/07 19:58:53 jdolecek Exp $ */
+/* $NetBSD: wdc_g1.c,v 1.3 2017/10/20 07:06:06 jdolecek Exp $ */
 
 /*-



Home | Main Index | Thread Index | Old Index