freebsd-dev/sys
Ian Dowse d63700b023 The ohci driver's processing of completed transfer descriptors (TDs)
appeared to rely on all kinds of non-guaranteed behaviours: the
transfer abort code assumed that TDs with no interrupt timeout
configured would end up on the done queue within 20ms, the done
queue processing assumed that all TDs from a transfer would appear
at the same time, and there were access-after-free bugs triggered
on failed transfers.

Attempt to fix these problems by the following changes:
 - Use a maximum (6-frame) interrupt delay instead of no interrupt
   delay to ensure that the 20ms wait in ohci_abort_xfer() is enough
   for the TDs to have been taken off the hardware done queue.
 - Defer cancellation of timeouts and freeing of TDs until we either
   hit an error or reach the final TD.
 - Remove TDs from the done queue before freeing them so that it
   is safe to continue traversing the done queue.

This appears to fix a hang that was reproducable with revision 1.67
or 1.68 of ulpt.c (earlier revisions had a different transfer
pattern). With certain HP printers, the command "true > /dev/ulpt0"
would cause ohci_add_done() to spin because the done queue had a
loop. The list corruption was caused by a 3-TD transfer where the
first TD completed but remained on the internal host controller
done queue because it had no interrupt timeout. When the transfer
timed out, the TD got freed and reused, so it caused a loop in the
done queue when it was inserted a second time from a different
transfer.

Reported by:	Alex Pivovarov
MFC after:	1 week
2005-11-27 09:05:37 +00:00
..
alpha Don't enable PUC_FASTINTR by default in the source. Instead, enable it 2005-11-21 20:22:35 +00:00
amd64 Fix typo. 2005-11-24 15:28:32 +00:00
arm Add missing "struct" in i386/i386/machdep.c,v 1.497 by deischen@. 2005-11-24 08:16:18 +00:00
boot -mdoc sweep. 2005-11-18 10:36:29 +00:00
bsm
cam Fix a bug that caused some /dev entries to continue to exist after 2005-11-18 02:43:49 +00:00
coda Normalize a significant number of kernel malloc type names: 2005-10-31 15:41:29 +00:00
compat Somehow memmove() got mapped to memset() in the patch table. Create a 2005-11-23 17:10:46 +00:00
conf Support for ATI IXP 200 / 300 / 400 series audio controllers. 2005-11-27 03:29:59 +00:00
contrib - Store pointer to the link-level address right in "struct ifnet" 2005-11-11 16:04:59 +00:00
crypto Add VIA/ACE "PadLock" support as a crypto(9) driver. 2005-08-18 00:30:22 +00:00
ddb - Rename 'traceall' to 'alltrace' so that the 'tr' shortcut for 'trace' 2005-10-24 15:21:36 +00:00
dev The ohci driver's processing of completed transfer descriptors (TDs) 2005-11-27 09:05:37 +00:00
doc
fs Fix interaction with Windows 2000/XP based servers: 2005-11-22 07:13:00 +00:00
gdb
geom Add sysctl descriptions. 2005-11-25 10:09:30 +00:00
gnu Normalize a significant number of kernel malloc type names: 2005-10-31 15:41:29 +00:00
i4b Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and 2005-08-09 10:20:02 +00:00
i386 Fix typo. 2005-11-24 15:28:32 +00:00
ia64 Don't enable PUC_FASTINTR by default in the source. Instead, enable it 2005-11-21 20:22:35 +00:00
isa Add support for XBOX to the FreeBSD port. The xbox architecture is 2005-11-09 03:55:40 +00:00
isofs/cd9660 Normalize a significant number of kernel malloc type names: 2005-10-31 15:41:29 +00:00
kern Change filesystem name from mqueue to mqueuefs for style consistent. 2005-11-27 08:30:12 +00:00
libkern Normalize a significant number of kernel malloc type names: 2005-10-31 15:41:29 +00:00
modules Change filesystem name from mqueue to mqueuefs for style consistent. 2005-11-27 08:30:12 +00:00
net Fix the following bugs: 2005-11-24 18:56:14 +00:00
net80211 Update ieee80211_mhz2ieee to understand public safety bands and spectrum 2005-11-15 05:56:32 +00:00
netatalk - Store pointer to the link-level address right in "struct ifnet" 2005-11-11 16:04:59 +00:00
netatm - Store pointer to the link-level address right in "struct ifnet" 2005-11-11 16:04:59 +00:00
netgraph - Update the flow sequence before converting count to 2005-11-27 02:43:08 +00:00
netinet Fix prototype. 2005-11-24 14:17:35 +00:00
netinet6 fixed a kernel crash due to an improper removal of callout-timer 2005-11-16 12:36:08 +00:00
netipsec Use sparse initializers for "struct domain" and "struct protosw", 2005-11-09 13:29:16 +00:00
netipx Include ip_options.h for IPX-IP encapsulation. 2005-11-20 16:17:12 +00:00
netkey Use sparse initializers for "struct domain" and "struct protosw", 2005-11-09 13:29:16 +00:00
netnatm Use sparse initializers for "struct domain" and "struct protosw", 2005-11-09 13:29:16 +00:00
netncp Normalize a significant number of kernel malloc type names: 2005-10-31 15:41:29 +00:00
netsmb Prevent module unloading if there are active connections. 2005-11-22 02:15:46 +00:00
nfs Fixes for NFS crashes on architectures that require strict alignment. 2005-07-14 20:08:27 +00:00
nfs4client Normalize a significant number of kernel malloc type names: 2005-10-31 15:41:29 +00:00
nfsclient Fix for a bug where NFS/TCP would not reconnect (in the case where 2005-11-21 19:25:24 +00:00
nfsserver Normalize a significant number of kernel malloc type names: 2005-10-31 15:41:29 +00:00
opencrypto Fix bogus check. It was possible to panic the kernel by giving 0 length. 2005-08-18 11:58:03 +00:00
pc98 Add missing "struct" in i386/i386/machdep.c,v 1.497 by deischen@. 2005-11-24 08:16:18 +00:00
pccard Remove the kernel portion of OLDCARD. I'm working on a replacement 2005-09-25 21:29:32 +00:00
pci Various fixes to make de(4) not panic after ru@'s IF_LLADDR() changes: 2005-11-21 21:50:07 +00:00
posix4 Const-qualify ksem_timedwait's parameter abstime as it's only passed in. 2005-10-18 11:46:24 +00:00
powerpc Create DEFAULTS files for alpha, ia64, powerpc, and sparc64 and move 2005-11-21 20:17:46 +00:00
rpc Add GIANT_REQUIRED and WITNESS sleep warnings to uprintf() and tprintf(), 2005-09-19 16:51:43 +00:00
security Normalize a significant number of kernel malloc type names: 2005-10-31 15:41:29 +00:00
sparc64 - Add a workaround (change the interrupt map mask to compare the full 2005-11-22 22:32:50 +00:00
sys Regen. 2005-11-27 01:23:31 +00:00
tools Add convenience macros for bus_space usage that doesn't require specification 2005-09-24 20:11:07 +00:00
ufs Fix parsing of atime, clusterr, clusterw, exec, suid, symfollow 2005-11-24 15:06:40 +00:00
vm Eliminate pmap_init2(). It's no longer used. 2005-11-20 06:09:49 +00:00
Makefile