freebsd-dev/sys
Bill Paul 134164f8d3 Fix a problem with the way we schedule work on the NDIS worker threads.
The Am1771 driver will sometimes do the following:

- Some thread-> NdisScheduleWorkItem(some work)
- Worker thread -> do some work, KeWaitForSingleObject(some event)
- Some other thread -> NdisScheduleWorkItem(some other work)

When the second call to NdisScheduleWorkItem() occurs, the NDIS worker
thread (in our case ndis taskqueue) is suspended in KeWaitForSingleObject()
and waiting for an event to be signaled. This is different from when
the worker thread is idle and waiting on NdisScheduleWorkItem() to
send it more jobs. However, the ndis_sched() function in kern_ndis.c
always calls kthread_resume() when queueing a new job. Normally this
would be ok, but here this causes KeWaitForSingleObject() to return
prematurely, which is not what we want.

To fix this, the NDIS threads created by kern_ndis.c maintain a state
variable to indicate whether they are running (scanning the job list
and executing jobs) or sleeping (blocked on kthread_suspend() in
ndis_runq()), and ndis_sched() will only call kthread_resume() if
the thread is in the sleeping state.

Note that we can't just check to see if the thread is on the run queue:
in both cases, the thread is sleeping, but it's sleeping for different
reasons.

This stops the Am1771 driver from emitting various "NDIS ERROR" messages
and fixes some cases where it crashes.
2004-02-14 20:57:32 +00:00
..
alpha Regen. 2004-02-04 22:00:44 +00:00
amd64 I forgot to add the NO_MODULES override for NOTES 2004-02-08 00:39:38 +00:00
arm Add sysentvec->sv_fixlimits() hook so that we can catch cases on 64 bit 2003-09-25 01:10:26 +00:00
boot Fix hw.acpi.os_name by renaming it to hw.acpi.osname. The "_name" suffix 2004-02-14 03:17:30 +00:00
cam Fix type in comment, 's/writtent/written/' 2004-01-18 00:17:14 +00:00
coda - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
compat Fix a problem with the way we schedule work on the NDIS worker threads. 2004-02-14 20:57:32 +00:00
conf Merged from kmod.mk,v 1.152: strip debugging symbols even when not 2004-02-13 13:21:41 +00:00
contrib This commit was generated by cvs2svn to compensate for changes in r124528, 2004-01-14 18:54:22 +00:00
crypto Fix a reentrancy issue in md5_calc(). 2004-01-27 18:57:21 +00:00
ddb If not in the debugger or if the user requests it with the 2004-01-28 06:51:18 +00:00
dev Fixing memory deallocation 2004-02-14 20:56:09 +00:00
fs Fixed some style bugs: 2004-02-14 04:41:13 +00:00
geom Do not check error code from closing ->access() calls, we know they succeed. 2004-02-14 17:59:44 +00:00
gnu MFffs (ffs_vfsops.c 1.76 (part of the big soft updates commit): lock 2004-02-13 20:23:16 +00:00
i4b Based on an excellent suggestion from tanimura@ define I4BPRI and use it 2003-11-10 14:20:34 +00:00
i386 Fixed a misplaced ifdef that prevented npx.c building without "device isa" 2004-02-13 18:04:51 +00:00
ia64 Sort PFIL_HOOKS. 2004-01-27 20:22:53 +00:00
isa Significantly reduce the "jitter" that is typical for PS/2 mice 2003-12-11 11:28:11 +00:00
isofs/cd9660 Spell magic '16' number as IO_SEQSHIFT. 2004-01-19 20:03:43 +00:00
kern Use standard style for cdevsw initialization. 2004-02-14 20:03:36 +00:00
libkern Remove register keyword and constify tmp values. This fixes 2004-02-12 03:23:13 +00:00
modules Removed -g from CFLAGS. There is a better way to build debugging 2004-02-13 10:11:01 +00:00
net This set of changes eliminates the use of MT_TAG "pseudo mbufs", replacing 2004-02-13 19:14:16 +00:00
net80211 Change WI_RID_SCAN_RES compatibility interface to return the result after 2004-01-19 05:25:43 +00:00
netatalk Eliminate a duplicate free when deleting an interface address. This 2003-11-28 04:19:41 +00:00
netatm Introduce a MAC label reference in 'struct inpcb', which caches 2003-11-18 00:39:07 +00:00
netgraph Use the official ng_timeout function to trigger sending. This means, 2004-01-30 15:34:57 +00:00
netinet Do not expose ip_dn_find_rule inline function to userland and unbreak world. 2004-02-13 22:26:36 +00:00
netinet6 - wrap mappedaddr block by #ifdef INET for IPv6-only kernel in future. 2004-02-13 15:11:47 +00:00
netipsec Initial import of RFC 2385 (TCP-MD5) digest support. 2004-02-11 04:26:04 +00:00
netipx Introduce a MAC label reference in 'struct inpcb', which caches 2003-11-18 00:39:07 +00:00
netkey avoid duplicate free. 2004-01-25 17:18:12 +00:00
netnatm Introduce a MAC label reference in 'struct inpcb', which caches 2003-11-18 00:39:07 +00:00
netncp The present defaults for the open and close for device drivers which 2003-09-27 12:01:01 +00:00
netsmb Use automatic major number allocation for nsmb devices. 2004-02-11 12:49:49 +00:00
nfs University of Michigan's Citi NFSv4 kernel client code. 2003-11-14 20:54:10 +00:00
nfs4client Use consistent style for cdevsw initialization 2004-02-14 20:04:25 +00:00
nfsclient Locking for the per-process resource limits structure. 2004-02-04 21:52:57 +00:00
nfsserver Fix some becuase -> because typos. 2003-12-17 16:12:01 +00:00
opencrypto Do not aggressively unroll the AES implementation, in non-benchmarking use 2004-02-04 08:44:10 +00:00
pc98 MFi386: revision 1.397 (cosmetic changes) 2004-01-30 13:15:42 +00:00
pccard - Implement selwakeuppri() which allows raising the priority of a 2003-11-09 09:17:26 +00:00
pci Fix multicast and promiscuous mode handling for Yukon devices. 2004-01-21 22:32:15 +00:00
posix4 The sem_timedwait() and ksem_timedwait() functions both 2004-02-03 22:27:03 +00:00
powerpc Work-in-progress for the 'Kauai' ATA device in Mac notebooks. The 2004-02-12 09:17:16 +00:00
rpc Don't panic because of RPC proto mismatches. Whitespace cleanup. 2004-01-17 21:25:05 +00:00
security Commit file missed in last pass: MAC api uses 'struct pipepair', not 2004-02-01 21:52:09 +00:00
sparc64 - Fix for sparc64 to use new __panic() function 2004-01-27 15:02:18 +00:00
sys By default, when a process in jail calls getfsstat(), only return the 2004-02-14 18:31:11 +00:00
tools Attempt to clean up the emu10k1-alsa.h stuff so that config doesn't 2004-02-05 22:51:16 +00:00
ufs Fixed some style bugs: 2004-02-14 04:41:13 +00:00
vm - Correct a long-standing race condition in vm_page_try_to_cache() that 2004-02-14 08:54:37 +00:00
Makefile Replaced outdated comment. 2004-01-17 03:28:27 +00:00