diff options
| author | ad <ad@NetBSD.org> | 2007-07-09 20:51:58 +0000 |
|---|---|---|
| committer | ad <ad@NetBSD.org> | 2007-07-09 20:51:58 +0000 |
| commit | 88ab7da936c561aba9ff7492617ffb08f8d08ece (patch) | |
| tree | d9d78b17ff651178241606f2e7766abdd0f15137 /sys/dev/ata | |
| parent | 317bac119f13240650ea6882854b381cf1024fa1 (diff) | |
Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
Diffstat (limited to 'sys/dev/ata')
| -rw-r--r-- | sys/dev/ata/ata.c | 31 | ||||
| -rw-r--r-- | sys/dev/ata/ata_raid.c | 5 | ||||
| -rw-r--r-- | sys/dev/ata/atavar.h | 4 | ||||
| -rw-r--r-- | sys/dev/ata/wd.c | 6 |
4 files changed, 17 insertions, 29 deletions
diff --git a/sys/dev/ata/ata.c b/sys/dev/ata/ata.c index bd9dfd0d471..1d611336e4c 100644 --- a/sys/dev/ata/ata.c +++ b/sys/dev/ata/ata.c @@ -1,4 +1,4 @@ -/* $NetBSD: ata.c,v 1.89 2007/07/01 09:47:19 dsl Exp $ */ +/* $NetBSD: ata.c,v 1.90 2007/07/09 21:00:30 ad Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.89 2007/07/01 09:47:19 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.90 2007/07/09 21:00:30 ad Exp $"); #include "opt_ata.h" @@ -155,7 +155,7 @@ ata_channel_attach(struct ata_channel *chp) if (chp->ch_flags & ATACH_DISABLED) return; - callout_init(&chp->ch_callout); + callout_init(&chp->ch_callout, 0); TAILQ_INIT(&chp->ch_queue->queue_xfer); chp->ch_queue->queue_freeze = 0; @@ -366,24 +366,6 @@ atabus_thread(void *arg) } /* - * atabus_create_thread: - * - * Helper routine to create the ATA bus worker thread. - */ -static void -atabus_create_thread(void *arg) -{ - struct atabus_softc *sc = arg; - struct ata_channel *chp = sc->sc_chan; - int error; - - if ((error = kthread_create1(atabus_thread, sc, &chp->ch_thread, - "%s", sc->sc_dev.dv_xname)) != 0) - aprint_error("%s: unable to create kernel thread: error %d\n", - sc->sc_dev.dv_xname, error); -} - -/* * atabus_match: * * Autoconfiguration match routine. @@ -414,6 +396,7 @@ atabus_attach(struct device *parent, struct device *self, void *aux) struct atabus_softc *sc = (void *) self; struct ata_channel *chp = aux; struct atabus_initq *initq; + int error; sc->sc_chan = chp; @@ -427,7 +410,11 @@ atabus_attach(struct device *parent, struct device *self, void *aux) initq->atabus_sc = sc; TAILQ_INSERT_TAIL(&atabus_initq_head, initq, atabus_initq); config_pending_incr(); - kthread_create(atabus_create_thread, sc); + + if ((error = kthread_create(PRI_NONE, 0, NULL, atabus_thread, sc, + &chp->ch_thread, "%s", sc->sc_dev.dv_xname)) != 0) + aprint_error("%s: unable to create kernel thread: error %d\n", + sc->sc_dev.dv_xname, error); sc->sc_powerhook = powerhook_establish(sc->sc_dev.dv_xname, atabus_powerhook, sc); diff --git a/sys/dev/ata/ata_raid.c b/sys/dev/ata/ata_raid.c index 94f70fc3172..7049f288816 100644 --- a/sys/dev/ata/ata_raid.c +++ b/sys/dev/ata/ata_raid.c @@ -1,4 +1,4 @@ -/* $NetBSD: ata_raid.c,v 1.22 2007/03/27 00:10:20 garbled Exp $ */ +/* $NetBSD: ata_raid.c,v 1.23 2007/07/09 21:00:30 ad Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.22 2007/03/27 00:10:20 garbled Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.23 2007/07/09 21:00:30 ad Exp $"); #include <sys/param.h> #include <sys/buf.h> @@ -52,6 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: ata_raid.c,v 1.22 2007/03/27 00:10:20 garbled Exp $" #include <sys/fcntl.h> #include <sys/malloc.h> #include <sys/vnode.h> +#include <sys/proc.h> #include <miscfs/specfs/specdev.h> diff --git a/sys/dev/ata/atavar.h b/sys/dev/ata/atavar.h index b15d2628286..3460505104a 100644 --- a/sys/dev/ata/atavar.h +++ b/sys/dev/ata/atavar.h @@ -1,4 +1,4 @@ -/* $NetBSD: atavar.h,v 1.73 2006/09/30 15:56:18 itohy Exp $ */ +/* $NetBSD: atavar.h,v 1.74 2007/07/09 21:00:31 ad Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. @@ -369,7 +369,7 @@ struct ata_channel { struct ata_queue *ch_queue; /* The channel kernel thread */ - struct proc *ch_thread; + struct lwp *ch_thread; }; /* diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c index 8b87c7f0335..eea6bac1799 100644 --- a/sys/dev/ata/wd.c +++ b/sys/dev/ata/wd.c @@ -1,4 +1,4 @@ -/* $NetBSD: wd.c,v 1.339 2007/07/01 09:48:37 dsl Exp $ */ +/* $NetBSD: wd.c,v 1.340 2007/07/09 21:00:31 ad Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.339 2007/07/01 09:48:37 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.340 2007/07/09 21:00:31 ad Exp $"); #include "opt_ata.h" @@ -301,7 +301,7 @@ wdattach(struct device *parent, struct device *self, void *aux) const struct wd_quirk *wdq; ATADEBUG_PRINT(("wdattach\n"), DEBUG_FUNCS | DEBUG_PROBE); - callout_init(&wd->sc_restart_ch); + callout_init(&wd->sc_restart_ch, 0); bufq_alloc(&wd->sc_q, BUFQ_DISK_DEFAULT_STRAT, BUFQ_SORT_RAWBLOCK); #ifdef WD_SOFTBADSECT SLIST_INIT(&wd->sc_bslist); |
