Author: hselasky Date: Wed Jan 22 07:48:39 2014 New Revision: 261005 URL: http://svnweb.freebsd.org/changeset/base/261005
Log: Ensure that the DMA delay does not get rounded down to zero ticks when a timeout value of a single tick is given. With FreeBSD-10 and newer the current system time is used as a starting point, and the minimum callout time of a single tick will be guaranteed. This patch mostly affect the DMA delay timeouts, which are typically in the range from 0.125 to 2ms. MFC after: 1 week Modified: head/sys/dev/usb/usb_freebsd.h head/sys/dev/usb/usb_freebsd_loader.h head/sys/dev/usb/usb_transfer.c Modified: head/sys/dev/usb/usb_freebsd.h ============================================================================== --- head/sys/dev/usb/usb_freebsd.h Wed Jan 22 07:32:55 2014 (r261004) +++ head/sys/dev/usb/usb_freebsd.h Wed Jan 22 07:48:39 2014 (r261005) @@ -50,6 +50,13 @@ #define USB_HAVE_FIXED_CONFIG 0 #define USB_HAVE_FIXED_PORT 0 +/* define zero ticks callout value */ +#if (__FreeBSD_version >= 1000029) +#define USB_CALLOUT_ZERO_TICKS 0 +#else +#define USB_CALLOUT_ZERO_TICKS 1 +#endif + #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid Modified: head/sys/dev/usb/usb_freebsd_loader.h ============================================================================== --- head/sys/dev/usb/usb_freebsd_loader.h Wed Jan 22 07:32:55 2014 (r261004) +++ head/sys/dev/usb/usb_freebsd_loader.h Wed Jan 22 07:48:39 2014 (r261005) @@ -50,6 +50,8 @@ #define USB_HAVE_FIXED_CONFIG 0 #define USB_HAVE_FIXED_PORT 0 +#define USB_CALLOUT_ZERO_TICKS 1 + #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Wed Jan 22 07:32:55 2014 (r261004) +++ head/sys/dev/usb/usb_transfer.c Wed Jan 22 07:48:39 2014 (r261005) @@ -2723,7 +2723,7 @@ usbd_transfer_timeout_ms(struct usb_xfer /* defer delay */ usb_callout_reset(&xfer->timeout_handle, - USB_MS_TO_TICKS(ms), cb, xfer); + USB_MS_TO_TICKS(ms) + USB_CALLOUT_ZERO_TICKS, cb, xfer); } /*------------------------------------------------------------------------* _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"