summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorjdolecek <jdolecek@NetBSD.org>2017-10-20 07:06:05 +0000
committerjdolecek <jdolecek@NetBSD.org>2017-10-20 07:06:05 +0000
commita1bf30e8664357bafc3ccae2f9fd0a82b80da38d (patch)
treebbe67330ed63b1c91a85eaa6f8e1a5164678e218 /sys/dev
parentad78d490fdb1c20addcc0d39920b7609a2133ad9 (diff)
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 (limited to 'sys/dev')
-rw-r--r--sys/dev/ata/ata.c8
-rw-r--r--sys/dev/ata/ata_subr.c14
-rw-r--r--sys/dev/ic/ahcisata_core.c6
-rw-r--r--sys/dev/ic/ninjaata32.c7
-rw-r--r--sys/dev/ic/siisata.c6
-rw-r--r--sys/dev/ic/wdc.c6
-rw-r--r--sys/dev/ic/wdc_upc.c5
-rw-r--r--sys/dev/isa/wdc_isa.c6
-rw-r--r--sys/dev/isapnp/wdc_isapnp.c6
-rw-r--r--sys/dev/ofisa/wdc_ofisa.c6
-rw-r--r--sys/dev/pci/artsata.c12
-rw-r--r--sys/dev/pci/cmdide.c19
-rw-r--r--sys/dev/pci/cypide.c12
-rw-r--r--sys/dev/pci/pciide_common.c15
-rw-r--r--sys/dev/pci/pdcsata.c13
-rw-r--r--sys/dev/pci/satalink.c12
-rw-r--r--sys/dev/pci/viaide.c12
-rw-r--r--sys/dev/pcmcia/wdc_pcmcia.c6
-rw-r--r--sys/dev/podulebus/dtide.c5
-rw-r--r--sys/dev/podulebus/hcide.c5
-rw-r--r--sys/dev/usb/umass_isdata.c8
21 files changed, 65 insertions, 124 deletions
diff --git a/sys/dev/ata/ata.c b/sys/dev/ata/ata.c
index 9315a4692d0..c5443e64980 100644
--- a/sys/dev/ata/ata.c
+++ b/sys/dev/ata/ata.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ata.c,v 1.139 2017/10/19 20:45:07 jdolecek Exp $ */
+/* $NetBSD: ata.c,v 1.140 2017/10/20 07:06:07 jdolecek Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.139 2017/10/19 20:45:07 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.140 2017/10/20 07:06:07 jdolecek Exp $");
#include "opt_ata.h"
@@ -196,10 +196,10 @@ ata_channel_attach(struct ata_channel *chp)
if (chp->ch_flags & ATACH_DISABLED)
return;
- KASSERT(chp->ch_queue != NULL);
-
ata_channel_init(chp);
+ KASSERT(chp->ch_queue != NULL);
+
chp->atabus = config_found_ia(chp->ch_atac->atac_dev, "ata", chp,
atabusprint);
}
diff --git a/sys/dev/ata/ata_subr.c b/sys/dev/ata/ata_subr.c
index 721f41c01e2..a94107dfeb7 100644
--- a/sys/dev/ata/ata_subr.c
+++ b/sys/dev/ata/ata_subr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ata_subr.c,v 1.3 2017/10/19 20:45:07 jdolecek Exp $ */
+/* $NetBSD: ata_subr.c,v 1.4 2017/10/20 07:06:07 jdolecek Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata_subr.c,v 1.3 2017/10/19 20:45:07 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata_subr.c,v 1.4 2017/10/20 07:06:07 jdolecek Exp $");
#include "opt_ata.h"
@@ -225,11 +225,21 @@ ata_channel_init(struct ata_channel *chp)
{
mutex_init(&chp->ch_lock, MUTEX_DEFAULT, IPL_BIO);
cv_init(&chp->ch_thr_idle, "atath");
+
+ /* Optionally setup the queue, too */
+ if (chp->ch_queue == NULL) {
+ chp->ch_queue = ata_queue_alloc(1);
+ }
}
void
ata_channel_destroy(struct ata_channel *chp)
{
+ if (chp->ch_queue != NULL) {
+ ata_queue_free(chp->ch_queue);
+ chp->ch_queue = NULL;
+ }
+
mutex_destroy(&chp->ch_lock);
cv_destroy(&chp->ch_thr_idle);
}
diff --git a/sys/dev/ic/ahcisata_core.c b/sys/dev/ic/ahcisata_core.c
index bcf098ed12c..3071997cc1e 100644
--- a/sys/dev/ic/ahcisata_core.c
+++ b/sys/dev/ic/ahcisata_core.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ahcisata_core.c,v 1.58 2017/10/07 16:05:32 jdolecek Exp $ */
+/* $NetBSD: ahcisata_core.c,v 1.59 2017/10/20 07:06:07 jdolecek Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.58 2017/10/07 16:05:32 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.59 2017/10/20 07:06:07 jdolecek Exp $");
#include <sys/types.h>
#include <sys/malloc.h>
@@ -516,8 +516,6 @@ ahci_detach(struct ahci_softc *sc, int flags)
bus_dmamem_free(sc->sc_dmat, &achp->ahcic_cmd_tbl_seg,
achp->ahcic_cmd_tbl_nseg);
- ata_queue_free(chp->ch_queue);
- chp->ch_queue = NULL;
chp->atabus = NULL;
ata_channel_detach(chp);
diff --git a/sys/dev/ic/ninjaata32.c b/sys/dev/ic/ninjaata32.c
index caf8ab7b592..73a80c8f92a 100644
--- a/sys/dev/ic/ninjaata32.c
+++ b/sys/dev/ic/ninjaata32.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ninjaata32.c,v 1.19 2017/10/07 16:05:32 jdolecek Exp $ */
+/* $NetBSD: ninjaata32.c,v 1.20 2017/10/20 07:06:07 jdolecek Exp $ */
/*
* Copyright (c) 2006 ITOH Yasufumi.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ninjaata32.c,v 1.19 2017/10/07 16:05:32 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ninjaata32.c,v 1.20 2017/10/20 07:06:07 jdolecek Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -191,7 +191,6 @@ njata32_attach(struct njata32_softc *sc)
sc->sc_wdc_chanarray[0] = &sc->sc_ch[0].ch_ata_channel;
sc->sc_ch[0].ch_ata_channel.ch_channel = 0;
sc->sc_ch[0].ch_ata_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
- sc->sc_ch[0].ch_ata_channel.ch_queue = ata_queue_alloc(1);
sc->sc_wdcdev.wdc_maxdrives = 2; /* max number of drives per channel */
/* map ATA registers */
@@ -264,8 +263,6 @@ njata32_detach(struct njata32_softc *sc, int flags)
bus_dmamem_unmap(sc->sc_dmat, (void *)sc->sc_sgtpg,
sizeof(struct njata32_dma_page));
bus_dmamem_free(sc->sc_dmat, &sc->sc_sgt_seg, sc->sc_sgt_nsegs);
-
- ata_queue_free(sc->sc_ch[0].ch_ata_channel.ch_queue);
}
return 0;
diff --git a/sys/dev/ic/siisata.c b/sys/dev/ic/siisata.c
index 068f4c5db33..ad3a98a2dcb 100644
--- a/sys/dev/ic/siisata.c
+++ b/sys/dev/ic/siisata.c
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.34 2017/10/07 16:05:32 jdolecek Exp $ */
+/* $NetBSD: siisata.c,v 1.35 2017/10/20 07:06:07 jdolecek Exp $ */
/* from ahcisata_core.c */
@@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.34 2017/10/07 16:05:32 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.35 2017/10/20 07:06:07 jdolecek Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -432,8 +432,6 @@ siisata_detach(struct siisata_softc *sc, int flags)
bus_dmamem_free(sc->sc_dmat,
&schp->sch_prb_seg, schp->sch_prb_nseg);
- ata_queue_free(chp->ch_queue);
- chp->ch_queue = NULL;
chp->atabus = NULL;
ata_channel_detach(chp);
diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c
index 4b7b285d09e..7dc36a5712f 100644
--- a/sys/dev/ic/wdc.c
+++ b/sys/dev/ic/wdc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc.c,v 1.287 2017/10/17 18:52:50 jdolecek Exp $ */
+/* $NetBSD: wdc.c,v 1.288 2017/10/20 07:06:07 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.287 2017/10/17 18:52:50 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.288 2017/10/20 07:06:07 jdolecek Exp $");
#include "opt_ata.h"
#include "opt_wdc.h"
@@ -484,7 +484,6 @@ wdcprobe(struct wdc_regs *wdr)
memset(&ch, 0, sizeof(ch));
ata_channel_init(&ch);
ch.ch_atac = &wdc.sc_atac;
- ch.ch_queue = ata_queue_alloc(1);
wdc.regs = wdr;
/* default reset method */
@@ -493,7 +492,6 @@ wdcprobe(struct wdc_regs *wdr)
rv = wdcprobe1(&ch, 1);
- ata_queue_free(ch.ch_queue);
ata_channel_destroy(&ch);
return rv;
diff --git a/sys/dev/ic/wdc_upc.c b/sys/dev/ic/wdc_upc.c
index 1c685e933ac..f50f26b3efe 100644
--- a/sys/dev/ic/wdc_upc.c
+++ b/sys/dev/ic/wdc_upc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_upc.c,v 1.30 2017/10/07 19:52:11 jdolecek Exp $ */
+/* $NetBSD: wdc_upc.c,v 1.31 2017/10/20 07:06:07 jdolecek Exp $ */
/*-
* Copyright (c) 2000 Ben Harris
* All rights reserved.
@@ -28,7 +28,7 @@
/* This file is part of NetBSD/arm26 -- a port of NetBSD to ARM2/3 machines. */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_upc.c,v 1.30 2017/10/07 19:52:11 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_upc.c,v 1.31 2017/10/20 07:06:07 jdolecek Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -87,7 +87,6 @@ wdc_upc_attach(device_t parent, device_t self, void *aux)
wdr->ctl_ioh = ua->ua_ioh2;
sc->sc_channel.ch_channel = 0;
sc->sc_channel.ch_atac = &sc->sc_wdc.sc_atac;
- sc->sc_channel.ch_queue = ata_queue_alloc(1);
sc->sc_wdc.wdc_maxdrives = 2;
for (i = 0; i < WDC_NREG; i++) {
if (bus_space_subregion(ua->ua_iot, ua->ua_ioh, i,
diff --git a/sys/dev/isa/wdc_isa.c b/sys/dev/isa/wdc_isa.c
index 5445a4cbda8..659e67bb2c1 100644
--- a/sys/dev/isa/wdc_isa.c
+++ b/sys/dev/isa/wdc_isa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_isa.c,v 1.60 2017/10/07 16:05:32 jdolecek Exp $ */
+/* $NetBSD: wdc_isa.c,v 1.61 2017/10/20 07:06:07 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.60 2017/10/07 16:05:32 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_isa.c,v 1.61 2017/10/20 07:06:07 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -219,7 +219,7 @@ wdc_isa_attach(device_t parent, device_t self, void *aux)
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 --git a/sys/dev/isapnp/wdc_isapnp.c b/sys/dev/isapnp/wdc_isapnp.c
index 5dec27b9130..4647f57f0cc 100644
--- a/sys/dev/isapnp/wdc_isapnp.c
+++ b/sys/dev/isapnp/wdc_isapnp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_isapnp.c,v 1.43 2017/10/07 20:02:07 jdolecek Exp $ */
+/* $NetBSD: wdc_isapnp.c,v 1.44 2017/10/20 07:06:07 jdolecek Exp $ */
/*-
* Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_isapnp.c,v 1.43 2017/10/07 20:02:07 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_isapnp.c,v 1.44 2017/10/20 07:06:07 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -158,7 +158,7 @@ wdc_isapnp_attach(device_t parent, device_t self, void *aux)
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);
wdcattach(&sc->ata_channel);
diff --git a/sys/dev/ofisa/wdc_ofisa.c b/sys/dev/ofisa/wdc_ofisa.c
index 5ab1a4c5ced..dae83e4edf2 100644
--- a/sys/dev/ofisa/wdc_ofisa.c
+++ b/sys/dev/ofisa/wdc_ofisa.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_ofisa.c,v 1.35 2017/10/10 05:35:15 jdolecek Exp $ */
+/* $NetBSD: wdc_ofisa.c,v 1.36 2017/10/20 07:06:07 jdolecek Exp $ */
/*
* Copyright 1997, 1998
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_ofisa.c,v 1.35 2017/10/10 05:35:15 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_ofisa.c,v 1.36 2017/10/20 07:06:07 jdolecek Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -160,7 +160,7 @@ wdc_ofisa_attach(device_t parent, device_t self, void *aux)
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);
wdcattach(&sc->sc_channel);
diff --git a/sys/dev/pci/artsata.c b/sys/dev/pci/artsata.c
index b0e305f54f2..12dd6ca4aa6 100644
--- a/sys/dev/pci/artsata.c
+++ b/sys/dev/pci/artsata.c
@@ -1,4 +1,4 @@
-/* $NetBSD: artsata.c,v 1.27 2017/10/07 16:05:33 jdolecek Exp $ */
+/* $NetBSD: artsata.c,v 1.28 2017/10/20 07:06:08 jdolecek Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: artsata.c,v 1.27 2017/10/07 16:05:33 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: artsata.c,v 1.28 2017/10/20 07:06:08 jdolecek Exp $");
#include "opt_pciide.h"
@@ -231,13 +231,7 @@ artisea_chansetup(struct pciide_softc *sc, int channel,
cp->name = PCIIDE_CHANNEL_NAME(channel);
cp->ata_channel.ch_channel = channel;
cp->ata_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
- cp->ata_channel.ch_queue = ata_queue_alloc(1);
- if (cp->ata_channel.ch_queue == NULL) {
- aprint_error("%s %s channel: "
- "can't allocate memory for command queue",
- device_xname(sc->sc_wdcdev.sc_atac.atac_dev), cp->name);
- return 0;
- }
+
return 1;
}
diff --git a/sys/dev/pci/cmdide.c b/sys/dev/pci/cmdide.c
index 508890a3fc8..e26808a7972 100644
--- a/sys/dev/pci/cmdide.c
+++ b/sys/dev/pci/cmdide.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cmdide.c,v 1.40 2017/10/19 20:11:38 jdolecek Exp $ */
+/* $NetBSD: cmdide.c,v 1.41 2017/10/20 07:06:08 jdolecek Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cmdide.c,v 1.40 2017/10/19 20:11:38 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cmdide.c,v 1.41 2017/10/20 07:06:08 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -154,14 +154,9 @@ cmd_channel_map(const struct pci_attach_args *pa, struct pciide_softc *sc,
cp->ata_channel.ch_queue =
sc->pciide_channels[0].ata_channel.ch_queue;
} else {
+ /* XXX */
cp->ata_channel.ch_queue = ata_queue_alloc(1);
}
- if (cp->ata_channel.ch_queue == NULL) {
- aprint_error("%s %s channel: "
- "can't allocate memory for command queue",
- device_xname(sc->sc_wdcdev.sc_atac.atac_dev), cp->name);
- return;
- }
aprint_normal_dev(sc->sc_wdcdev.sc_atac.atac_dev,
"%s channel %s to %s mode%s\n", cp->name,
@@ -510,14 +505,6 @@ cmd680_channel_map(const struct pci_attach_args *pa, struct pciide_softc *sc,
cp->ata_channel.ch_channel = channel;
cp->ata_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
- cp->ata_channel.ch_queue = ata_queue_alloc(1);
- if (cp->ata_channel.ch_queue == NULL) {
- aprint_error("%s %s channel: "
- "can't allocate memory for command queue",
- device_xname(sc->sc_wdcdev.sc_atac.atac_dev), cp->name);
- return;
- }
-
/* XXX */
reg = 0xa2 + channel * 16;
for (i = 0; i < sizeof(init_val); i++)
diff --git a/sys/dev/pci/cypide.c b/sys/dev/pci/cypide.c
index 5f013e80866..b05df6d39c5 100644
--- a/sys/dev/pci/cypide.c
+++ b/sys/dev/pci/cypide.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cypide.c,v 1.31 2017/10/07 16:05:33 jdolecek Exp $ */
+/* $NetBSD: cypide.c,v 1.32 2017/10/20 07:06:08 jdolecek Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cypide.c,v 1.31 2017/10/07 16:05:33 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cypide.c,v 1.32 2017/10/20 07:06:08 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -148,13 +148,7 @@ cy693_chip_map(struct pciide_softc *sc, const struct pci_attach_args *pa)
cp->name = PCIIDE_CHANNEL_NAME(0);
cp->ata_channel.ch_channel = 0;
cp->ata_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
- cp->ata_channel.ch_queue = ata_queue_alloc(1);
- if (cp->ata_channel.ch_queue == NULL) {
- aprint_error("%s primary channel: "
- "can't allocate memory for command queue",
- device_xname(sc->sc_wdcdev.sc_atac.atac_dev));
- return;
- }
+
aprint_normal_dev(sc->sc_wdcdev.sc_atac.atac_dev,
"primary channel %s to ",
(interface & PCIIDE_INTERFACE_SETTABLE(0)) ?
diff --git a/sys/dev/pci/pciide_common.c b/sys/dev/pci/pciide_common.c
index ab7a215d621..665d6ae238b 100644
--- a/sys/dev/pci/pciide_common.c
+++ b/sys/dev/pci/pciide_common.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pciide_common.c,v 1.64 2017/10/17 18:52:50 jdolecek Exp $ */
+/* $NetBSD: pciide_common.c,v 1.65 2017/10/20 07:06:08 jdolecek Exp $ */
/*
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pciide_common.c,v 1.64 2017/10/17 18:52:50 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pciide_common.c,v 1.65 2017/10/20 07:06:08 jdolecek Exp $");
#include <sys/param.h>
@@ -208,9 +208,6 @@ pciide_common_detach(struct pciide_softc *sc, int flags)
pciide_dma_table_teardown(sc, channel, drive);
#endif
}
-
- ata_queue_free(cp->ata_channel.ch_queue);
- cp->ata_channel.atabus = NULL;
}
#if NATA_DMA
@@ -877,13 +874,7 @@ pciide_chansetup(struct pciide_softc *sc, int channel, pcireg_t interface)
cp->name = PCIIDE_CHANNEL_NAME(channel);
cp->ata_channel.ch_channel = channel;
cp->ata_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
- cp->ata_channel.ch_queue = ata_queue_alloc(1);
- if (cp->ata_channel.ch_queue == NULL) {
- aprint_error("%s %s channel: "
- "can't allocate memory for command queue",
- device_xname(sc->sc_wdcdev.sc_atac.atac_dev), cp->name);
- return 0;
- }
+
aprint_verbose_dev(sc->sc_wdcdev.sc_atac.atac_dev,
"%s channel %s to %s mode\n", cp->name,
(interface & PCIIDE_INTERFACE_SETTABLE(channel)) ?
diff --git a/sys/dev/pci/pdcsata.c b/sys/dev/pci/pdcsata.c
index bda379dbe86..25c2dd3353b 100644
--- a/sys/dev/pci/pdcsata.c
+++ b/sys/dev/pci/pdcsata.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pdcsata.c,v 1.28 2017/10/07 16:05:33 jdolecek Exp $ */
+/* $NetBSD: pdcsata.c,v 1.29 2017/10/20 07:06:08 jdolecek Exp $ */
/*
* Copyright (c) 2004, Manuel Bouyer.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pdcsata.c,v 1.28 2017/10/07 16:05:33 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pdcsata.c,v 1.29 2017/10/20 07:06:08 jdolecek Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -374,14 +374,7 @@ pdcsata_chip_map(struct pciide_softc *sc, const struct pci_attach_args *pa)
cp->name = NULL;
cp->ata_channel.ch_channel = channel;
cp->ata_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
- cp->ata_channel.ch_queue = ata_queue_alloc(1);
- if (cp->ata_channel.ch_queue == NULL) {
- aprint_error("%s channel %d: "
- "can't allocate memory for command queue\n",
- device_xname(sc->sc_wdcdev.sc_atac.atac_dev),
- channel);
- goto next_channel;
- }
+
wdc_cp = &cp->ata_channel;
wdr = CHAN_TO_WDC_REGS(wdc_cp);
diff --git a/sys/dev/pci/satalink.c b/sys/dev/pci/satalink.c
index c25a4aaa50d..7554c52cee1 100644
--- a/sys/dev/pci/satalink.c
+++ b/sys/dev/pci/satalink.c
@@ -1,4 +1,4 @@
-/* $NetBSD: satalink.c,v 1.54 2017/10/07 16:05:33 jdolecek Exp $ */
+/* $NetBSD: satalink.c,v 1.55 2017/10/20 07:06:08 jdolecek Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: satalink.c,v 1.54 2017/10/07 16:05:33 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: satalink.c,v 1.55 2017/10/20 07:06:08 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -600,13 +600,7 @@ sii3114_chansetup(struct pciide_softc *sc, int channel)
cp->name = channel_names[channel];
cp->ata_channel.ch_channel = channel;
cp->ata_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
- cp->ata_channel.ch_queue = ata_queue_alloc(1);
- if (cp->ata_channel.ch_queue == NULL) {
- aprint_error("%s %s channel: "
- "can't allocate memory for command queue",
- device_xname(sc->sc_wdcdev.sc_atac.atac_dev), cp->name);
- return (0);
- }
+
return (1);
}
diff --git a/sys/dev/pci/viaide.c b/sys/dev/pci/viaide.c
index 036d21d8cc6..baba8a7cf18 100644
--- a/sys/dev/pci/viaide.c
+++ b/sys/dev/pci/viaide.c
@@ -1,4 +1,4 @@
-/* $NetBSD: viaide.c,v 1.85 2017/10/07 16:05:33 jdolecek Exp $ */
+/* $NetBSD: viaide.c,v 1.86 2017/10/20 07:06:08 jdolecek Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: viaide.c,v 1.85 2017/10/07 16:05:33 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: viaide.c,v 1.86 2017/10/20 07:06:08 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1070,13 +1070,7 @@ via_vt6421_chansetup(struct pciide_softc *sc, int channel)
cp->ata_channel.ch_channel = channel;
cp->ata_channel.ch_atac = &sc->sc_wdcdev.sc_atac;
- cp->ata_channel.ch_queue = ata_queue_alloc(1);
- if (cp->ata_channel.ch_queue == NULL) {
- aprint_error("%s channel %d: "
- "can't allocate memory for command queue",
- device_xname(sc->sc_wdcdev.sc_atac.atac_dev), channel);
- return 0;
- }
+
return 1;
}
diff --git a/sys/dev/pcmcia/wdc_pcmcia.c b/sys/dev/pcmcia/wdc_pcmcia.c
index dab3d2fd400..6ae327e2f1f 100644
--- a/sys/dev/pcmcia/wdc_pcmcia.c
+++ b/sys/dev/pcmcia/wdc_pcmcia.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wdc_pcmcia.c,v 1.125 2017/10/07 16:05:33 jdolecek Exp $ */
+/* $NetBSD: wdc_pcmcia.c,v 1.126 2017/10/20 07:06:08 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.125 2017/10/07 16:05:33 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_pcmcia.c,v 1.126 2017/10/20 07:06:08 jdolecek Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -295,7 +295,7 @@ wdc_pcmcia_attach(device_t parent, device_t self, void *aux)
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 = 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;
diff --git a/sys/dev/podulebus/dtide.c b/sys/dev/podulebus/dtide.c
index 7d4c33e365a..d6986a2cd07 100644
--- a/sys/dev/podulebus/dtide.c
+++ b/sys/dev/podulebus/dtide.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dtide.c,v 1.29 2017/10/07 19:52:11 jdolecek Exp $ */
+/* $NetBSD: dtide.c,v 1.30 2017/10/20 07:06:08 jdolecek Exp $ */
/*-
* Copyright (c) 2000, 2001 Ben Harris
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dtide.c,v 1.29 2017/10/07 19:52:11 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dtide.c,v 1.30 2017/10/20 07:06:08 jdolecek Exp $");
#include <sys/param.h>
@@ -105,7 +105,6 @@ dtide_attach(device_t parent, device_t self, void *aux)
ch->ch_atac = &sc->sc_wdc.sc_atac;
wdr->cmd_iot = bst;
wdr->ctl_iot = bst;
- ch->ch_queue = ata_queue_alloc(1);
bus_space_map(pa->pa_fast_t,
pa->pa_fast_base + dtide_cmdoffsets[i], 0, 8,
&wdr->cmd_baseioh);
diff --git a/sys/dev/podulebus/hcide.c b/sys/dev/podulebus/hcide.c
index f1d24dd645e..2e6d408f0a9 100644
--- a/sys/dev/podulebus/hcide.c
+++ b/sys/dev/podulebus/hcide.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hcide.c,v 1.26 2017/10/07 19:52:11 jdolecek Exp $ */
+/* $NetBSD: hcide.c,v 1.27 2017/10/20 07:06:08 jdolecek Exp $ */
/*-
* Copyright (c) 2000, 2001 Ben Harris
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hcide.c,v 1.26 2017/10/07 19:52:11 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hcide.c,v 1.27 2017/10/20 07:06:08 jdolecek Exp $");
#include <sys/param.h>
@@ -100,7 +100,6 @@ hcide_attach(device_t parent, device_t self, void *aux)
ch->ch_atac = &sc->sc_wdc.sc_atac;
wdr->cmd_iot = pa->pa_mod_t;
wdr->ctl_iot = pa->pa_mod_t;
- ch->ch_queue = ata_queue_alloc(1);
bus_space_map(pa->pa_fast_t,
pa->pa_fast_base + hcide_cmdoffsets[i], 0, 8,
&wdr->cmd_baseioh);
diff --git a/sys/dev/usb/umass_isdata.c b/sys/dev/usb/umass_isdata.c
index 2796b3d849f..87e729a4dcf 100644
--- a/sys/dev/usb/umass_isdata.c
+++ b/sys/dev/usb/umass_isdata.c
@@ -1,4 +1,4 @@
-/* $NetBSD: umass_isdata.c,v 1.35 2017/10/10 16:44:24 jdolecek Exp $ */
+/* $NetBSD: umass_isdata.c,v 1.36 2017/10/20 07:06:08 jdolecek Exp $ */
/*
* TODO:
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: umass_isdata.c,v 1.35 2017/10/10 16:44:24 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: umass_isdata.c,v 1.36 2017/10/20 07:06:08 jdolecek Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -223,7 +223,6 @@ umass_isdata_attach(struct umass_softc *sc)
/* Fake ATA channel so wd(4) ata_{get,free}_xfer() work */
ata_channel_init(&scbus->sc_channel);
scbus->sc_channel.atabus = (device_t)scbus;
- scbus->sc_channel.ch_queue = ata_queue_alloc(1);
scbus->sc_drv_data.drive_type = ATA_DRIVET_ATA;
scbus->sc_drv_data.chnl_softc = &scbus->sc_channel;
@@ -238,9 +237,6 @@ umass_isdata_detach(struct umass_softc *sc)
{
struct uisdata_softc *scbus = (struct uisdata_softc *)sc->bus;
- ata_queue_free(scbus->sc_channel.ch_queue);
- scbus->sc_channel.ch_queue = NULL;
-
ata_channel_destroy(&scbus->sc_channel);
}