From de5d195f3cf2d500896c64b2c3851dcd5cd51da0 Mon Sep 17 00:00:00 2001 From: hselasky Date: Tue, 4 Feb 2014 08:44:12 +0000 Subject: [PATCH] MFC r261004, r261005 and r261033: Adjust the DMA delay logic so that the DMA delay does not become too small. git-svn-id: svn://svn.freebsd.org/base/stable/10@261465 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/dev/usb/controller/ehci.c | 2 +- sys/dev/usb/usb_freebsd.h | 3 +++ sys/dev/usb/usb_freebsd_loader.h | 2 ++ sys/dev/usb/usb_transfer.c | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/controller/ehci.c b/sys/dev/usb/controller/ehci.c index e930eacc1..fb4eecb51 100644 --- a/sys/dev/usb/controller/ehci.c +++ b/sys/dev/usb/controller/ehci.c @@ -3781,7 +3781,7 @@ ehci_get_dma_delay(struct usb_device *udev, uint32_t *pus) * Wait until the hardware has finished any possible use of * the transfer descriptor(s) and QH */ - *pus = (188); /* microseconds */ + *pus = (1125); /* microseconds */ } static void diff --git a/sys/dev/usb/usb_freebsd.h b/sys/dev/usb/usb_freebsd.h index 0ae453381..0c483e5a2 100644 --- a/sys/dev/usb/usb_freebsd.h +++ b/sys/dev/usb/usb_freebsd.h @@ -50,6 +50,9 @@ #define USB_HAVE_FIXED_CONFIG 0 #define USB_HAVE_FIXED_PORT 0 +/* define zero ticks callout value */ +#define USB_CALLOUT_ZERO_TICKS 1 + #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid diff --git a/sys/dev/usb/usb_freebsd_loader.h b/sys/dev/usb/usb_freebsd_loader.h index 2a1e1044b..68343d229 100644 --- a/sys/dev/usb/usb_freebsd_loader.h +++ b/sys/dev/usb/usb_freebsd_loader.h @@ -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 diff --git a/sys/dev/usb/usb_transfer.c b/sys/dev/usb/usb_transfer.c index 1de0f6dd4..5a99e5407 100644 --- a/sys/dev/usb/usb_transfer.c +++ b/sys/dev/usb/usb_transfer.c @@ -2723,7 +2723,7 @@ usbd_transfer_timeout_ms(struct usb_xfer *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); } /*------------------------------------------------------------------------* -- 2.45.0