summaryrefslogtreecommitdiff
path: root/sys/dev/ic
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/ic
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/ic')
-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
5 files changed, 10 insertions, 20 deletions
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,