mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Add sysctl to not reset the device on clear stall failures, to
temporarily mitigate problems with VMs. Approved by: re (kib) MFC after: 1 week
This commit is contained in:
parent
311fa10b52
commit
9465dbeb5c
1 changed files with 13 additions and 1 deletions
|
|
@ -67,6 +67,11 @@
|
|||
#include <dev/usb/usb_bus.h>
|
||||
#include <sys/ctype.h>
|
||||
|
||||
static int usb_no_cs_fail;
|
||||
|
||||
SYSCTL_INT(_hw_usb, OID_AUTO, no_cs_fail, CTLFLAG_RW,
|
||||
&usb_no_cs_fail, 0, "USB clear stall failures are ignored, if set");
|
||||
|
||||
#ifdef USB_DEBUG
|
||||
static int usb_pr_poll_delay = USB_PORT_RESET_DELAY;
|
||||
static int usb_pr_recovery_delay = USB_PORT_RESET_RECOVERY;
|
||||
|
|
@ -238,7 +243,7 @@ usb_do_clear_stall_callback(struct usb_xfer *xfer, usb_error_t error)
|
|||
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
case USB_ST_TRANSFERRED:
|
||||
|
||||
tr_transferred:
|
||||
/* reset error counter */
|
||||
udev->clear_stall_errors = 0;
|
||||
|
||||
|
|
@ -297,6 +302,13 @@ tr_setup:
|
|||
break;
|
||||
|
||||
DPRINTF("Clear stall failed.\n");
|
||||
|
||||
/*
|
||||
* Some VMs like VirtualBox always return failure on
|
||||
* clear-stall which we sometimes should just ignore.
|
||||
*/
|
||||
if (usb_no_cs_fail)
|
||||
goto tr_transferred;
|
||||
if (udev->clear_stall_errors == USB_CS_RESET_LIMIT)
|
||||
goto tr_setup;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue