summaryrefslogtreecommitdiff
path: root/sys/dev/i2o
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2005-11-19 02:18:03 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2005-11-19 02:18:03 +0000
commit4e00bfe9e4fce563a74dcd487149539b6bc02ba9 (patch)
treea134970c4687287588758bb78c439e9cde819bb9 /sys/dev/i2o
parent16017b33d1fad6b6fd295f39b365b33719b42ae9 (diff)
Remove unnecessary lockmgr() archaism that was costing too much in terms
of panics and bugfixes. Access curproc directly, do not expect a process pointer as an argument. Should fix many "process context required" bugs. Incentive and okay millert@, okay marc@. Various testing, thanks.
Diffstat (limited to 'sys/dev/i2o')
-rw-r--r--sys/dev/i2o/iop.c15
-rw-r--r--sys/dev/i2o/iopsp.c6
2 files changed, 10 insertions, 11 deletions
diff --git a/sys/dev/i2o/iop.c b/sys/dev/i2o/iop.c
index 203801c57ad..7239d9b417e 100644
--- a/sys/dev/i2o/iop.c
+++ b/sys/dev/i2o/iop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iop.c,v 1.26 2005/01/06 11:06:13 miod Exp $ */
+/* $OpenBSD: iop.c,v 1.27 2005/11/19 02:18:00 pedro Exp $ */
/* $NetBSD: iop.c,v 1.12 2001/03/21 14:27:05 ad Exp $ */
/*-
@@ -545,12 +545,12 @@ iop_config_interrupts(struct device *self)
config_found_sm(self, &ia, iop_vendor_print, iop_submatch);
#endif
- lockmgr(&sc->sc_conflock, LK_EXCLUSIVE, NULL, curproc);
+ lockmgr(&sc->sc_conflock, LK_EXCLUSIVE, NULL);
if ((rv = iop_reconfigure(sc, 0)) == -1) {
printf("%s: configure failed (%d)\n", sc->sc_dv.dv_xname, rv);
return;
}
- lockmgr(&sc->sc_conflock, LK_RELEASE, NULL, curproc);
+ lockmgr(&sc->sc_conflock, LK_RELEASE, NULL);
kthread_create_deferred(iop_create_reconf_thread, sc);
}
@@ -584,7 +584,6 @@ void
iop_reconf_thread(void *cookie)
{
struct iop_softc *sc = cookie;
- struct proc *p = sc->sc_reconf_proc;
struct i2o_lct lct;
u_int32_t chgind;
int rv;
@@ -603,10 +602,10 @@ iop_reconf_thread(void *cookie)
sc->sc_dv.dv_xname, letoh32(lct.changeindicator), rv));
if (rv == 0 &&
- lockmgr(&sc->sc_conflock, LK_EXCLUSIVE, NULL, p) == 0) {
+ lockmgr(&sc->sc_conflock, LK_EXCLUSIVE, NULL) == 0) {
iop_reconfigure(sc, letoh32(lct.changeindicator));
chgind = sc->sc_chgind + 1;
- lockmgr(&sc->sc_conflock, LK_RELEASE, NULL, p);
+ lockmgr(&sc->sc_conflock, LK_RELEASE, NULL);
}
tsleep(iop_reconf_thread, PWAIT, "iopzzz", hz * 5);
@@ -2380,7 +2379,7 @@ iopioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
return (ENOTTY);
}
- if ((rv = lockmgr(&sc->sc_conflock, LK_SHARED, NULL, p)) != 0)
+ if ((rv = lockmgr(&sc->sc_conflock, LK_SHARED, NULL)) != 0)
return (rv);
switch (cmd) {
@@ -2409,7 +2408,7 @@ iopioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
break;
}
- lockmgr(&sc->sc_conflock, LK_RELEASE, NULL, p);
+ lockmgr(&sc->sc_conflock, LK_RELEASE, NULL);
return (rv);
}
diff --git a/sys/dev/i2o/iopsp.c b/sys/dev/i2o/iopsp.c
index 0626df4d9c5..4fc885728a7 100644
--- a/sys/dev/i2o/iopsp.c
+++ b/sys/dev/i2o/iopsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iopsp.c,v 1.7 2003/01/13 03:56:47 mickey Exp $ */
+/* $OpenBSD: iopsp.c,v 1.8 2005/11/19 02:18:00 pedro Exp $ */
/* $NetBSD$ */
/*-
@@ -376,7 +376,7 @@ iopsp_rescan(struct iopsp_softc *sc)
iop = (struct iop_softc *)sc->sc_dv.dv_parent;
- rv = lockmgr(&iop->sc_conflock, LK_EXCLUSIVE, NULL, curproc);
+ rv = lockmgr(&iop->sc_conflock, LK_EXCLUSIVE, NULL);
if (rv != 0) {
#ifdef I2ODEBUG
printf("iopsp_rescan: unable to acquire lock\n");
@@ -400,7 +400,7 @@ iopsp_rescan(struct iopsp_softc *sc)
if ((rv = iop_lct_get(iop)) == 0)
rv = iopsp_reconfig(&sc->sc_dv);
- lockmgr(&iop->sc_conflock, LK_RELEASE, NULL, curproc);
+ lockmgr(&iop->sc_conflock, LK_RELEASE, NULL);
return (rv);
}