freebsd-skq/sys/dev/usb
Ian Dowse 0ce606de7c Attempt to fix a number of race conditions in the handling of
transfer timeouts that typically cause a transfer to be completed
twice, resulting in panics and page faults:

 o A transfer completion interrupt could arrive while an abort_task
   event was set up, so the transfer would be aborted after it had
   completed. This is very easy to reproduce. Fix this by setting
   the transfer status to USBD_TIMEOUT before scheduling the
   abort_task so that the transfer completion code will ignore it.

 o The transfer completion code could execute concurrently with the
   timeout callout, leaving the callout blocked (e.g. waiting for
   Giant) while the transfer completion code runs. In this case,
   callout_stop() does not prevent the callout from running, so
   again the timeout code would run after the transfer was complete.
   Handle this case by checking the return value from callout_stop(),
   and ignoring the transfer if the callout could not be removed.

 o Finally, protect against a timeout callout occurring while a
   transfer is being aborted by another process. Here we arrange
   for the timeout processing to ignore the transfer, and use
   callout_drain() to ensure that the callout has really gone before
   completing the transfer.

This was tested by repeatedly performing USB transfers with a timeout
set to approximately the same as the normal transfer completion
time. In the PR below, apparently this occurred by accident with a
particular printer and the default timeout.

PR:		kern/71491
2004-11-09 20:51:32 +00:00
..
dsbr100io.h
ehci_pci.c Make the USB subsystem unloadable and detachable, though currently 2004-08-02 15:37:35 +00:00
ehci.c Attempt to fix a number of race conditions in the handling of 2004-11-09 20:51:32 +00:00
ehcireg.h Merge recent USB2/EHCI related changes from NetBSD: 2004-11-03 01:52:50 +00:00
ehcivar.h Save and restore state across suspend/resume events. 2004-10-30 15:13:09 +00:00
FILES
hid.c
hid.h
if_aue.c Mark USB ethernet devices as IFF_NEEDSGIANT, since the USB framework 2004-08-11 03:38:55 +00:00
if_auereg.h Replace the static "qdat" structure with a per-instance softc field 2004-05-23 12:35:25 +00:00
if_axe.c Add Sitecom's LN-029 USB 2.0 Ethernet adapter. 2004-09-18 19:48:10 +00:00
if_axereg.h Replace the static "qdat" structure with a per-instance softc field 2004-05-23 12:35:25 +00:00
if_cue.c Mark USB ethernet devices as IFF_NEEDSGIANT, since the USB framework 2004-08-11 03:38:55 +00:00
if_cuereg.h Replace the static "qdat" structure with a per-instance softc field 2004-05-23 12:35:25 +00:00
if_kue.c Mark USB ethernet devices as IFF_NEEDSGIANT, since the USB framework 2004-08-11 03:38:55 +00:00
if_kuereg.h Replace the static "qdat" structure with a per-instance softc field 2004-05-23 12:35:25 +00:00
if_rue.c Mark USB ethernet devices as IFF_NEEDSGIANT, since the USB framework 2004-08-11 03:38:55 +00:00
if_ruereg.h Replace the static "qdat" structure with a per-instance softc field 2004-05-23 12:35:25 +00:00
if_udav.c Mark USB ethernet devices as IFF_NEEDSGIANT, since the USB framework 2004-08-11 03:38:55 +00:00
if_udavreg.h Replace the static "qdat" structure with a per-instance softc field 2004-05-23 12:35:25 +00:00
kue_fw.h
ohci_pci.c Make the USB subsystem unloadable and detachable, though currently 2004-08-02 15:37:35 +00:00
ohci.c Attempt to fix a number of race conditions in the handling of 2004-11-09 20:51:32 +00:00
ohcireg.h Remove "Scheduling overrun" interrupts from the set of normal interrupts 2004-05-06 09:21:05 +00:00
ohcivar.h Make the USB subsystem unloadable and detachable, though currently 2004-08-02 15:37:35 +00:00
rio500_usb.h
ubsa.c Add support for the Vodafone Mobile Connect 3G datacard. 2004-10-16 21:27:28 +00:00
ubser.c Use generic tty code instead of local copies. 2004-10-12 09:18:37 +00:00
ubser.h
ucom.c Use generic infrastructure for the ucom driver instead of local stuff. 2004-09-28 20:23:49 +00:00
ucomvar.h Use generic infrastructure for the ucom driver instead of local stuff. 2004-09-28 20:23:49 +00:00
ucycom.c Use generic tty code. 2004-10-12 09:21:03 +00:00
udbp.c Tweak the compatibility macros a little so that the device printing is 2004-08-15 23:39:18 +00:00
udbp.h
ufm.c Tweak the compatibility macros a little so that the device printing is 2004-08-15 23:39:18 +00:00
uftdi.c Add support for the B&B Electronics USB->RS422/485 adapter. 2004-10-30 09:21:44 +00:00
uftdireg.h Add support to the uftdi driver for Intrepid Control Systems' vehicle 2004-07-01 17:16:20 +00:00
ugen.c Permit fcntl(F_SETFL) to work on a ugen(4) device by not returning failure 2004-10-13 04:13:05 +00:00
ugraphire_rdesc.h
uhci_pci.c Add device IDs for Intel ICH6. 2004-10-13 14:51:42 +00:00
uhci.c Attempt to fix a number of race conditions in the handling of 2004-11-09 20:51:32 +00:00
uhcireg.h
uhcivar.h Make the USB subsystem unloadable and detachable, though currently 2004-08-02 15:37:35 +00:00
uhid.c Don't use matchlvl attach arg. It seems to be not initialized 2004-10-09 07:48:31 +00:00
uhub.c When a port cannot be set up, report the error code in the `disabling 2004-11-09 19:46:57 +00:00
ukbd.c Tweak the compatibility macros a little so that the device printing is 2004-08-15 23:39:18 +00:00
ulpt.c Tweak the compatibility macros a little so that the device printing is 2004-08-15 23:39:18 +00:00
umass.c Pass through the commands necessary to format USB floppy devices, 2004-10-12 08:58:57 +00:00
umct.c Use a taskqueue rather than an swi to handle deferred notifications. 2004-10-05 04:03:00 +00:00
umodem.c Overhaul ucom serial driver by using generic stuff instead of homerolled 2004-09-17 11:53:45 +00:00
ums.c Tweak the compatibility macros a little so that the device printing is 2004-08-15 23:39:18 +00:00
uplcom.c Add support for CTS modemsignal as well. 2004-10-02 12:47:30 +00:00
urio.c Tweak the compatibility macros a little so that the device printing is 2004-08-15 23:39:18 +00:00
usb_ethersubr.c
usb_ethersubr.h
usb_if.m
usb_mem.c When searching for a suitable block of memory on the free list, 2004-08-02 13:59:02 +00:00
usb_mem.h
usb_port.h Attempt to fix a number of race conditions in the handling of 2004-11-09 20:51:32 +00:00
usb_quirks.c Add support Qualcomm CDMA modem 2004-09-03 23:19:27 +00:00
usb_quirks.h
usb_subr.c Merge recent USB2/EHCI related changes from NetBSD: 2004-11-03 01:52:50 +00:00
usb.c Make the USB subsystem unloadable and detachable, though currently 2004-08-02 15:37:35 +00:00
usb.h
usbcdc.h
usbdevs Add support for the B&B Electronics USB->RS422/485 adapter. 2004-10-30 09:21:44 +00:00
usbdi_util.c Add missing <sys/module.h> includes 2004-05-30 20:08:47 +00:00
usbdi_util.h MFNetBSD. 2004-06-26 10:35:10 +00:00
usbdi.c Fix two cases where a successful return from usbd_transfer() would 2004-08-29 02:35:59 +00:00
usbdi.h Tweak the compatibility macros a little so that the device printing is 2004-08-15 23:39:18 +00:00
usbdivar.h Merge recent USB2/EHCI related changes from NetBSD: 2004-11-03 01:52:50 +00:00
usbhid.h
uscanner.c Add identifiers for the HP Laserjet 2300d USB 2004-10-24 11:16:29 +00:00
uvisor.c MFp4: First batch of dev/usb/usbdevs.h -> usbdevs.h changes. 2004-06-27 12:41:44 +00:00
uvscom.c Overhaul ucom serial driver by using generic stuff instead of homerolled 2004-09-17 11:53:45 +00:00