freebsd-dev/sys/dev
Don Lewis 12e524a290 Change KASSERT() in feed_vchan16() into an explicit test and call to
panic() so that the buffer overflow just beyond this point is always
caught, even when the code is not compiled with INVARIANTS.

Change chn_setblocksize() buffer reallocation code to attempt to avoid
the feed_vchan16() buffer overflow by attempting to always keep the
bufsoft buffer at least as large as the bufhard buffer.

Print a diagnositic message
	Danger! %s bufsoft size increasing from %d to %d after CHANNEL_SETBLOCKSIZE()
if our best attempts fail.  If feed_vchan16() were to be called by
the interrupt handler while locks are dropped in chn_setblocksize()
to increase the size bufsoft to match the size of bufhard, the panic()
code in feed_vchan16() will be triggered.  If the diagnostic message
is printed, it is a warning that a panic is possible if the system
were to see events in an "unlucky" order.

Change the locking code to avoid the need for MTX_RECURSIVE mutexes.

Add the MTX_DUPOK option to the channel mutexes and change the locking
sequence to always lock the parent channel before its children to avoid
the possibility of deadlock.

Actually implement locking assertions for the channel mutexes and fix
the problems found by the resulting assertion violations.

Clean up the locking code in dsp_ioctl().

Allocate the channel buffers using the malloc() M_WAITOK option instead
of M_NOWAIT so that buffer allocation won't fail.  Drop locks across
the malloc() calls.

Add/modify KASSERTS() in attempt to detect problems early.

Abuse layering by adding a pointer to the snd_dbuf structure that points
back to the pcm_channel that owns it.  This allows sndbuf_resize() to do
proper locking without having to change the its API, which is used by
the hardware drivers.

Don't dereference a NULL pointer when setting hw.snd.maxautovchans
if a hardware driver is not loaded.  Noticed by Ryan Sommers
<ryans at gamersimpact.com>.

Tested by:	Stefan Ehmann <shoesoft AT gmx.net>
Tested by:	matk (Mathew Kanner)
Tested by:	Gordon Bergling <gbergling AT 0xfce3.net>
2004-01-28 08:02:15 +00:00
..
aac Temporary workaround for aac_cam to deal with CAM requiring Giant. This 2003-12-03 15:42:12 +00:00
acpi_support Only remove the handler if we installed it. 2004-01-12 19:35:31 +00:00
acpica Add an ACPI_FUNCTION_TRACE() to the newly-added acpi_Startup() routine 2004-01-28 07:48:03 +00:00
adlink The present defaults for the open and close for device drivers which 2003-09-27 12:01:01 +00:00
advansys Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
agp - Disable AGP on ALI chipsets if aperture size is 0. 2003-11-11 21:49:18 +00:00
aha Save the device so we can do a device_printf. 2003-11-13 04:14:53 +00:00
ahb Make this at least compile on 64 bit platforms. Its been breaking 2003-07-30 20:09:22 +00:00
aic Use __FBSDID(). 2003-08-24 17:55:58 +00:00
aic7xxx Move all of the recovery thread routines next 2003-12-19 18:34:30 +00:00
amd Setting pccb->ccb_h.status to CAM_REQ_CMP one time is enough. 2004-01-21 10:49:42 +00:00
amr crashdump support. 2003-10-10 22:49:40 +00:00
an Remove the HACK section it breaks the older firmware and doesn't totally 2004-01-10 03:02:04 +00:00
ar Get rid of the last two uses of NG_NODELEN + 1 in the base system by 2004-01-26 16:41:21 +00:00
asr Remove code previously under #ifdef ASR_VERY_BROKEN 2003-09-26 15:56:42 +00:00
ata Fix breakage in PIO multisector support. 2004-01-23 10:38:56 +00:00
ath When draining the tx queue reclaim any node references held in packets. 2004-01-07 19:16:49 +00:00
atkbdc Significantly reduce the "jitter" that is typical for PS/2 mice 2003-12-11 11:28:11 +00:00
awi Correct beacon (src/bssid) for hostap and adhoc mode. 2004-01-15 13:30:06 +00:00
bfe Drop the driver lock around calls to if_input to avoid a LOR when 2003-11-14 19:00:32 +00:00
bge Fix typo in a comment 2004-01-13 11:31:09 +00:00
bktr Use contigmalloc() instead of vm_page_alloc_contig(). 2004-01-14 00:52:53 +00:00
buslogic Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
cardbus Make the cardbus driver a derived class of the pci driver. In theory, this 2003-11-01 12:45:03 +00:00
ciss Fixed a memory leak. 2004-01-18 16:55:01 +00:00
cm Replace the if_name and if_unit members of struct ifnet with new members 2003-10-31 18:32:15 +00:00
cnw Replace the if_name and if_unit members of struct ifnet with new members 2003-10-31 18:32:15 +00:00
cs o Add sysctl to allow ignoring checksum of eeprom. 2003-11-04 02:59:57 +00:00
ct Use __FBSDID(). 2003-08-24 17:55:58 +00:00
cx Updated cx driver commit part 1: bring in the new kernel driver. 2003-12-03 07:29:38 +00:00
cy Fixed some minor indentation bugs. 2003-12-02 12:47:08 +00:00
dc Some integrated Davicom cards in sparc64 boxes have an all zeros 2004-01-08 19:08:27 +00:00
dcons Move post dmamap_load processes into the callback function. 2003-11-08 16:26:22 +00:00
de Replace the if_name and if_unit members of struct ifnet with new members 2003-10-31 18:32:15 +00:00
dec Use __FBSDID(). 2003-08-24 17:55:58 +00:00
digi Eliminate bogus use of makedev(): rather than synthesize the dev_t, use 2003-09-26 09:05:57 +00:00
dpt - Handle failure of cam_sim_alloc(). 2004-01-17 05:57:52 +00:00
drm Merge from DRI CVS. No longer maps the framebuffer into KVA on radeon, r128, 2004-01-06 04:34:53 +00:00
ed Added TDK LAK-CD031 (simple NE2000 device). 2003-12-31 04:25:00 +00:00
eisa Use __FBSDID(). 2003-08-24 17:55:58 +00:00
em Don't call em_stop() from the watchdog since it requires the controller 2003-12-07 06:50:04 +00:00
en Move the locking of the softc up to before the allocation of the 2003-12-17 10:01:46 +00:00
ep MFp4: 2003-11-02 20:13:39 +00:00
ex Replace the if_name and if_unit members of struct ifnet with new members 2003-10-31 18:32:15 +00:00
exca Card type stuff was backwards, so assume io for the moment. mem needs 2003-10-07 04:29:04 +00:00
fatm Fix 0 / NULL mixup (this module isn't in LINT!) 2003-12-24 05:24:24 +00:00
fb __powerpc__ conditional code for the syscons OpenFirmware/PPC framebuffer. 2004-01-21 05:08:51 +00:00
fdc Look at the equipment list for amd64 as well as i386 for autodetecting 2003-10-23 05:52:52 +00:00
fe Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
firewire * fwohci_pci.c 2004-01-23 17:37:09 +00:00
fxp Sometimes cardbus attachments don't attach, so while we track down 2003-11-28 05:28:29 +00:00
gem Properly initialize all members of the sentinel entry. 2003-12-26 05:36:08 +00:00
gfb Catch a few places where NULL (pointer) was used where 0 (integer) was 2003-12-23 02:36:43 +00:00
gx Avoid overwriting capability bits marked earlier 2004-01-18 10:15:48 +00:00
harp Replace the if_name and if_unit members of struct ifnet with new members 2003-10-31 18:32:15 +00:00
hatm change NULL to 0 to silence warning. 2003-12-24 18:23:02 +00:00
hfa Use __FBSDID(). 2003-08-24 17:55:58 +00:00
hifn NULL fallout 2003-12-25 01:23:38 +00:00
hme Replace the if_name and if_unit members of struct ifnet with new members 2003-10-31 18:32:15 +00:00
ic Add a header for the i8259A register definitions. This is based on 2004-01-06 18:59:37 +00:00
ichsmb Update the comment to indicate ICH5 support 2003-08-31 19:23:00 +00:00
ida Add a per controller IOCTL interface. 2004-01-15 06:37:52 +00:00
idt Use contigmalloc() instead of vm_page_alloc_contig(). Pass M_ZERO to 2004-01-14 06:14:35 +00:00
ie Replace the if_name and if_unit members of struct ifnet with new members 2003-10-31 18:32:15 +00:00
if_ndis This should have been checked in as part of the last update to if_ndis.c: 2004-01-27 09:08:12 +00:00
iicbus o eliminate widespread on-stack mbuf use for bpf by introducing 2003-12-28 03:56:00 +00:00
iir Update email addresses, copyrights, and tweak the management interface. 2003-09-26 15:36:47 +00:00
ips Fixed a memory leak. 2004-01-18 17:34:11 +00:00
isp If we have ISP_ROLE_INITIATOR set, make sure that we clear ICBOPT_INI_DISABLE 2004-01-23 23:23:31 +00:00
ispfw Update firmware sets for the 12160, 2200 and 2300 cards to the (more or 2004-01-14 18:38:03 +00:00
joy Use __FBSDID(). 2003-08-24 17:55:58 +00:00
kbd While USB keyboards attach as ukbd[0-9]+, the device node created by 2004-01-27 15:40:30 +00:00
led DUH! 2003-12-12 12:17:28 +00:00
lge Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
lnc Fix the PCI attach routine to properly setup the IRQ and port resource 2004-01-22 16:07:03 +00:00
matcd Discontinue bio_blkno, use bio_offset instead. 2003-10-18 17:44:01 +00:00
mc146818
mca Use __FBSDID(). 2003-08-24 17:55:58 +00:00
mcd Discontinue bio_blkno, use bio_offset instead. 2003-10-18 17:44:01 +00:00
md Allow specification of a geometry for vnode backed devices as well as 2004-01-12 10:52:00 +00:00
mii Make sure set the media type in the phy, we cannot trust it to have chosen 2004-01-17 10:44:39 +00:00
mk48txx Use __FBSDID(). 2003-08-24 17:55:58 +00:00
mlx Prepare for locking mlx(4) by cleaning up the use of busdma. No real 2003-09-02 08:30:31 +00:00
mly Fixed a memory leak. 2004-01-18 12:49:36 +00:00
mpt Catch a few places where NULL (pointer) was used where 0 (integer) was 2003-12-23 02:36:43 +00:00
mse - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
musycc Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
my Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
ncv Const poison string accessor functions. 2003-10-26 00:51:40 +00:00
nge Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
nmdm - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
nsp Use __FBSDID(). 2003-08-24 17:55:58 +00:00
null Shorten the code by removing one "do-nothing" function, replacing it 2003-11-01 09:31:54 +00:00
ofw - The last change conflicted with disks on a live system, as opposed to 2003-12-15 09:53:53 +00:00
owi Nursemaid: Fix compilation. 2003-12-10 15:09:38 +00:00
patm Replace the if_name and if_unit members of struct ifnet with new members 2003-10-31 18:32:15 +00:00
pccard Sync to pccarddevs 1.81. 2004-01-21 16:03:40 +00:00
pccbb MFp4: 2004-01-04 22:10:00 +00:00
pcf fix another LP64 problem. READ_IVAR takes a pointer to an uintptr_t, not 2003-06-20 07:22:54 +00:00
pci It appears that the changes in the resources allocated is causing much 2004-01-17 21:54:04 +00:00
pcic Use __FBSDID(). 2003-08-24 17:55:58 +00:00
pdq Use contigmalloc() and contigfree() instead of vm_page_alloc_contig() and 2004-01-13 20:36:03 +00:00
ppbus Apparently there's a good reason why M_WAITOK malloc() is done before 2004-01-18 13:09:38 +00:00
ppc Forgot an added file in the last commit. 2003-08-01 05:02:55 +00:00
pst Dont re-arm the timeout twice on a timeout error. 2003-09-08 06:28:50 +00:00
puc Add support for an non-branded SUN1889-based 2 port PCI serial card. 2003-12-31 17:51:18 +00:00
raidframe Fixed another 0 (actually '\0') vs / NULL mixup. This completes 2003-12-25 11:17:01 +00:00
random Fix a major faux pas of mine. I was causing 2 very bad things to 2003-11-20 15:35:48 +00:00
ray fix warnings. NULL -> 0 2003-12-24 19:00:49 +00:00
rc Consistently use the BSD u_int and u_short instead of the SYSV uint and 2003-08-07 15:04:27 +00:00
re Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
rndtest Use __FBSDID(). 2003-08-24 17:55:58 +00:00
rp Use __FBSDID(). 2003-08-24 17:55:58 +00:00
sab - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
safe Prefer new location of pci include files (which have only been in the 2003-08-22 07:08:17 +00:00
sbni Replace the if_name and if_unit members of struct ifnet with new members 2003-10-31 18:32:15 +00:00
sbsh Replace the if_name and if_unit members of struct ifnet with new members 2003-10-31 18:32:15 +00:00
scd Discontinue bio_blkno, use bio_offset instead. 2003-10-18 17:44:01 +00:00
sf Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
si Use __FBSDID(). 2003-08-24 18:03:45 +00:00
sio Fixed a memory leak. 2004-01-18 12:26:33 +00:00
sk Fix multicast and promiscuous mode handling for Yukon devices. 2004-01-21 22:32:15 +00:00
smbus No need for a separate nfpm driver now - amdpm handles both. 2003-09-06 13:58:06 +00:00
sn Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
snc Do if_xname conversion. I missed this one because it's pc98 only. 2003-11-01 23:24:38 +00:00
snp - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
sound Change KASSERT() in feed_vchan16() into an explicit test and call to 2004-01-28 08:02:15 +00:00
speaker Use __FBSDID(). 2003-06-02 16:32:55 +00:00
sr Get rid of the last two uses of NG_NODELEN + 1 in the base system by 2004-01-26 16:41:21 +00:00
stg Fix some becuase -> because typos. 2003-12-17 16:12:01 +00:00
streams falloc allocates a file structure and adds it to the file descriptor 2003-10-19 20:41:07 +00:00
sym unifdef old interface support out to prevent false positives. 2003-12-07 05:17:13 +00:00
syscons __powerpc__ conditional code for the syscons OpenFirmware/PPC framebuffer. 2004-01-21 05:08:51 +00:00
tdfx Use PCIR_BAR(x) instead of PCIR_MAPS. 2003-09-02 17:30:40 +00:00
tga Use __FBSDID(). 2003-08-24 17:55:58 +00:00
ti Drop the driver lock around calls to if_input to avoid a LOR when 2003-11-14 19:00:32 +00:00
trm Remove duplicate __FBSDID(). 2004-01-09 23:30:31 +00:00
twe After extensive QA cycles at 3ware, bring the driver in-line with all the 2003-12-02 07:57:20 +00:00
tx Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
txp Replace the if_name and if_unit members of struct ifnet with new members 2003-10-31 18:32:15 +00:00
uart Sometimes cardbus attachments don't attach, so while we track down 2003-11-28 05:28:29 +00:00
ubsec Use __FBSDID(). 2003-08-24 17:55:58 +00:00
usb Regen after rev. 1.161 of usbdevs. 2004-01-24 21:24:36 +00:00
utopia Generate events when the carrier goes up or down. 2003-07-30 08:35:58 +00:00
vinum initsd: For striped and RAID-[45] plexes, don't restrict the I/O 2003-12-15 00:45:53 +00:00
vr Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
vx Replace the if_name and if_unit members of struct ifnet with new members 2003-10-31 18:32:15 +00:00
wds Use __FBSDID(). 2003-08-24 17:55:58 +00:00
wi update radiotap support to reflect recent changes: 2003-12-28 06:58:52 +00:00
wl Drop the driver lock around calls to if_input to avoid a LOR when 2003-11-14 19:00:32 +00:00
xe Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones. 2003-12-08 07:54:15 +00:00
zs - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00