aboutsummaryrefslogtreecommitdiff
path: root/sys/pci/if_sf.c
diff options
context:
space:
mode:
authorBosko Milekic <bmilekic@FreeBSD.org>2001-01-19 01:59:14 +0000
committerBosko Milekic <bmilekic@FreeBSD.org>2001-01-19 01:59:14 +0000
commit08812b3925ae0a1a184e562499deb9a3cc59ec40 (patch)
tree5e46b9a4ade7937185420c854e4fd3b6644d343f /sys/pci/if_sf.c
parent5683c3dd1f2b4d138c72d854d553404f9e5a4100 (diff)
downloadsrc-08812b3925ae0a1a184e562499deb9a3cc59ec40.tar.gz
src-08812b3925ae0a1a184e562499deb9a3cc59ec40.zip
Implement MTX_RECURSE flag for mtx_init().
All calls to mtx_init() for mutexes that recurse must now include the MTX_RECURSE bit in the flag argument variable. This change is in preparation for an upcoming (further) mutex API cleanup. The witness code will call panic() if a lock is found to recurse but the MTX_RECURSE bit was not set during the lock's initialization. The old MTX_RECURSE "state" bit (in mtx_lock) has been renamed to MTX_RECURSED, which is more appropriate given its meaning. The following locks have been made "recursive," thus far: eventhandler, Giant, callout, sched_lock, possibly some others declared in the architecture-specific code, all of the network card driver locks in pci/, as well as some other locks in dev/ stuff that I've found to be recursive. Reviewed by: jhb
Notes
Notes: svn path=/head/; revision=71228
Diffstat (limited to 'sys/pci/if_sf.c')
-rw-r--r--sys/pci/if_sf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/pci/if_sf.c b/sys/pci/if_sf.c
index aa33e7d96fcd..d03934fa02db 100644
--- a/sys/pci/if_sf.c
+++ b/sys/pci/if_sf.c
@@ -679,7 +679,7 @@ static int sf_attach(dev)
unit = device_get_unit(dev);
bzero(sc, sizeof(struct sf_softc));
- mtx_init(&sc->sf_mtx, device_get_nameunit(dev), MTX_DEF);
+ mtx_init(&sc->sf_mtx, device_get_nameunit(dev), MTX_DEF | MTX_RECURSE);
SF_LOCK(sc);
/*
* Handle power management nonsense.