aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound
diff options
context:
space:
mode:
authorAttilio Rao <attilio@FreeBSD.org>2009-08-02 14:28:40 +0000
committerAttilio Rao <attilio@FreeBSD.org>2009-08-02 14:28:40 +0000
commit444b91868b5294e3a2151fffa3b063763a562448 (patch)
treec00d808d1df8000c2086c86613be9ec8536a5e28 /sys/dev/sound
parentd40b91cb1354e9bae491567cc88c215eda16d649 (diff)
downloadsrc-444b91868b5294e3a2151fffa3b063763a562448.tar.gz
src-444b91868b5294e3a2151fffa3b063763a562448.zip
Make the newbus subsystem Giant free by adding the new newbus sxlock.
The newbus lock is responsible for protecting newbus internIal structures, device states and devclass flags. It is necessary to hold it when all such datas are accessed. For the other operations, softc locking should ensure enough protection to avoid races. Newbus lock is automatically held when virtual operations on the device and bus are invoked when loading the driver or when the suspend/resume take place. For other 'spourious' operations trying to access/modify the newbus topology, newbus lock needs to be automatically acquired and dropped. For the moment Giant is also acquired in some key point (modules subsystem) in order to avoid problems before the 8.0 release as module handlers could make assumptions about it. This Giant locking should go just after the release happens. Please keep in mind that the public interface can be expanded in order to provide more support, if there are really necessities at some point and also some bugs could arise as long as the patch needs a bit of further testing. Bump __FreeBSD_version in order to reflect the newbus lock introduction. Reviewed by: ed, hps, jhb, imp, mav, scottl No answer by: ariff, thompsa, yongari Tested by: pho, G. Trematerra <giovanni dot trematerra at gmail dot com>, Brandon Gooch <jamesbrandongooch at gmail dot com> Sponsored by: Yahoo! Incorporated Approved by: re (ksmith)
Notes
Notes: svn path=/head/; revision=196037
Diffstat (limited to 'sys/dev/sound')
-rw-r--r--sys/dev/sound/pci/hda/hdac.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c
index 9f4264d98ec0..bf99d54ea1f9 100644
--- a/sys/dev/sound/pci/hda/hdac.c
+++ b/sys/dev/sound/pci/hda/hdac.c
@@ -7435,6 +7435,7 @@ hdac_attach2(void *arg)
quirks_on, quirks_off);
);
+ newbus_xlock();
hdac_lock(sc);
/* Remove ourselves from the config hooks */
@@ -7674,6 +7675,7 @@ hdac_attach2(void *arg)
SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), OID_AUTO,
"pindump", CTLTYPE_INT | CTLFLAG_RW, sc->dev, sizeof(sc->dev),
sysctl_hdac_pindump, "I", "Dump pin states/data");
+ newbus_xunlock();
}
/****************************************************************************