@@ -6183,6 +6183,8 @@
pause after every control message);
o = USB_QUIRK_HUB_SLOW_RESET (Hub needs extra
delay after resetting its port);
+ p = USB_QUIRK_SKIP_UNCONFIGURE (device doesn't
+ support unconfigure);
Example: quirks=0781:5580:bk,0a5c:5834:gij
usbhid.mousepoll=
@@ -2108,9 +2108,15 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
}
kfree(new_interfaces);
- ret = usb_control_msg_send(dev, 0, USB_REQ_SET_CONFIGURATION, 0,
- configuration, 0, NULL, 0,
- USB_CTRL_SET_TIMEOUT, GFP_NOIO);
+ if (configuration == 0 && !cp
+ && (dev->quirks & USB_QUIRK_SKIP_UNCONFIGURE)) {
+ dev_warn(&dev->dev, "device is not unconfigured!\n");
+ ret = 0;
+ } else
+ ret = usb_control_msg_send(dev, 0, USB_REQ_SET_CONFIGURATION, 0,
+ configuration, 0, NULL, 0,
+ USB_CTRL_SET_TIMEOUT, GFP_NOIO);
+
if (ret && cp) {
/*
* All the old state is gone, so what else can we do?
@@ -138,6 +138,9 @@ static int quirks_param_set(const char *value, const struct kernel_param *kp)
case 'o':
flags |= USB_QUIRK_HUB_SLOW_RESET;
break;
+ case 'p':
+ flags |= USB_QUIRK_SKIP_UNCONFIGURE;
+ break;
/* Ignore unrecognized flag characters */
}
}
@@ -510,6 +513,9 @@ static const struct usb_device_id usb_quirk_list[] = {
/* INTEL VALUE SSD */
{ USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
+ /* CSR Bluetooth */
+ { USB_DEVICE(0x0a12, 0x0001), .driver_info = USB_QUIRK_SKIP_UNCONFIGURE },
+
{ } /* terminating entry must be last */
};
@@ -72,4 +72,7 @@
/* device has endpoints that should be ignored */
#define USB_QUIRK_ENDPOINT_IGNORE BIT(15)
+/* device doesn't support unconfigure. */
+#define USB_QUIRK_SKIP_UNCONFIGURE BIT(16)
+
#endif /* __LINUX_USB_QUIRKS_H */
Bluetooth Dongles with CSR chip (i.e. USB Bluetooth V4.0 Dongle by Trust) hang when they are unbound from 'unbind' sysfs entry and can not be bound again. The reason is CSR chip hangs when usb configuration command with index 0 (used to unconfigure) is sent during disconnection. To avoid this unwanted result, it is necessary not to send this command for CSR chip, so a new quirk has been created. Athough device is not unconfigured, it is better to avoid device hanging to be able to operate. Even bluetooth can be previously turned off. On the other hand, this is not important if usb device is going to be bound again (normal behavior), i.e. with usbip. Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com> --- Documentation/admin-guide/kernel-parameters.txt | 2 ++ drivers/usb/core/message.c | 12 +++++++++--- drivers/usb/core/quirks.c | 6 ++++++ include/linux/usb/quirks.h | 3 +++ 4 files changed, 20 insertions(+), 3 deletions(-)