1. 18 3月, 2020 1 次提交
  2. 12 3月, 2020 1 次提交
  3. 04 3月, 2020 1 次提交
  4. 13 2月, 2020 1 次提交
  5. 11 2月, 2020 2 次提交
    • J
      USB: quirks: blacklist duplicate ep on Sound Devices USBPre2 · bdd1b147
      Johan Hovold 提交于
      This device has a broken vendor-specific altsetting for interface 1,
      where endpoint 0x85 is declared as an isochronous endpoint despite being
      used by interface 2 for audio capture.
      
      Device Descriptor:
        bLength                18
        bDescriptorType         1
        bcdUSB               2.00
        bDeviceClass          239 Miscellaneous Device
        bDeviceSubClass         2
        bDeviceProtocol         1 Interface Association
        bMaxPacketSize0        64
        idVendor           0x0926
        idProduct          0x0202
        bcdDevice            1.00
        iManufacturer           1 Sound Devices
        iProduct                2 USBPre2
        iSerial                 3 [...]
        bNumConfigurations      1
      
      [...]
      
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        1
            bAlternateSetting       3
            bNumEndpoints           2
            bInterfaceClass       255 Vendor Specific Class
            bInterfaceSubClass      0
            bInterfaceProtocol      0
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x85  EP 5 IN
              bmAttributes            5
                Transfer Type            Isochronous
                Synch Type               Asynchronous
                Usage Type               Data
              wMaxPacketSize     0x0126  1x 294 bytes
              bInterval               1
      
      [...]
      
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        2
            bAlternateSetting       1
            bNumEndpoints           1
            bInterfaceClass         1 Audio
            bInterfaceSubClass      2 Streaming
            bInterfaceProtocol      0
            iInterface              0
            AudioStreaming Interface Descriptor:
              bLength                 7
              bDescriptorType        36
              bDescriptorSubtype      1 (AS_GENERAL)
              bTerminalLink           4
              bDelay                  1 frames
              wFormatTag         0x0001 PCM
            AudioStreaming Interface Descriptor:
              bLength                26
              bDescriptorType        36
              bDescriptorSubtype      2 (FORMAT_TYPE)
              bFormatType             1 (FORMAT_TYPE_I)
              bNrChannels             2
              bSubframeSize           2
              bBitResolution         16
              bSamFreqType            6 Discrete
              tSamFreq[ 0]         8000
              tSamFreq[ 1]        16000
              tSamFreq[ 2]        24000
              tSamFreq[ 3]        32000
              tSamFreq[ 4]        44100
              tSamFreq[ 5]        48000
            Endpoint Descriptor:
              bLength                 9
              bDescriptorType         5
              bEndpointAddress     0x85  EP 5 IN
              bmAttributes            5
                Transfer Type            Isochronous
                Synch Type               Asynchronous
                Usage Type               Data
              wMaxPacketSize     0x0126  1x 294 bytes
              bInterval               4
              bRefresh                0
              bSynchAddress           0
              AudioStreaming Endpoint Descriptor:
                bLength                 7
                bDescriptorType        37
                bDescriptorSubtype      1 (EP_GENERAL)
                bmAttributes         0x01
                  Sampling Frequency
                bLockDelayUnits         2 Decoded PCM samples
                wLockDelay         0x0000
      
      Since commit 3e4f8e21 ("USB: core: fix check for duplicate
      endpoints") USB core ignores any duplicate endpoints found during
      descriptor parsing, but in this case we need to ignore the first
      instance in order to avoid breaking the audio capture interface.
      
      Fixes: 3e4f8e21 ("USB: core: fix check for duplicate endpoints")
      Cc: stable <stable@vger.kernel.org>
      Reported-by: Nedes <edes@gmx.net>
      Tested-by: Nedes <edes@gmx.net>
      Link: https://lore.kernel.org/r/20200201105829.5682c887@acme7.acmenetSigned-off-by: NJohan Hovold <johan@kernel.org>
      Link: https://lore.kernel.org/r/20200203153830.26394-3-johan@kernel.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bdd1b147
    • J
      USB: core: add endpoint-blacklist quirk · 73f8bda9
      Johan Hovold 提交于
      Add a new device quirk that can be used to blacklist endpoints.
      
      Since commit 3e4f8e21 ("USB: core: fix check for duplicate
      endpoints") USB core ignores any duplicate endpoints found during
      descriptor parsing.
      
      In order to handle devices where the first interfaces with duplicate
      endpoints are the ones that should have their endpoints ignored, we need
      to add a blacklist.
      Tested-by: Nedes <edes@gmx.net>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      Link: https://lore.kernel.org/r/20200203153830.26394-2-johan@kernel.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      73f8bda9
  6. 05 6月, 2019 1 次提交
  7. 21 5月, 2019 1 次提交
  8. 08 1月, 2019 1 次提交
  9. 05 12月, 2018 1 次提交
    • H
      usb: quirk: add no-LPM quirk on SanDisk Ultra Flair device · 2f2dde6b
      Harry Pan 提交于
      Some lower volume SanDisk Ultra Flair in 16GB, which the VID:PID is
      in 0781:5591, will aggressively request LPM of U1/U2 during runtime,
      when using this thumb drive as the OS installation key we found the
      device will generate failure during U1 exit path making it dropped
      from the USB bus, this causes a corrupted installation in system at
      the end.
      
      i.e.,
      [  166.918296] hub 2-0:1.0: state 7 ports 7 chg 0000 evt 0004
      [  166.918327] usb usb2-port2: link state change
      [  166.918337] usb usb2-port2: do warm reset
      [  166.970039] usb usb2-port2: not warm reset yet, waiting 50ms
      [  167.022040] usb usb2-port2: not warm reset yet, waiting 200ms
      [  167.276043] usb usb2-port2: status 02c0, change 0041, 5.0 Gb/s
      [  167.276050] usb 2-2: USB disconnect, device number 2
      [  167.276058] usb 2-2: unregistering device
      [  167.276060] usb 2-2: unregistering interface 2-2:1.0
      [  167.276170] xhci_hcd 0000:00:15.0: shutdown urb ffffa3c7cc695cc0 ep1in-bulk
      [  167.284055] sd 0:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
      [  167.284064] sd 0:0:0:0: [sda] tag#0 CDB: Read(10) 28 00 00 33 04 90 00 01 00 00
      ...
      
      Analyzed the USB trace in the link layer we realized it is because
      of the 6-ms timer of tRecoveryConfigurationTimeout which documented
      on the USB 3.2 Revision 1.0, the section 7.5.10.4.2 of "Exit from
      Recovery.Configuration"; device initiates U1 exit -> Recovery.Active
      -> Recovery.Configuration, then the host timer timeout makes the link
      transits to eSS.Inactive -> Rx.Detect follows by a Warm Reset.
      
      Interestingly, the other higher volume of SanDisk Ultra Flair sharing
      the same VID:PID, such as 64GB, would not request LPM during runtime,
      it sticks at U0 always, thus disabling LPM does not affect those thumb
      drives at all.
      
      The same odd occures in SanDisk Ultra Fit 16GB, VID:PID in 0781:5583.
      Signed-off-by: NHarry Pan <harry.pan@intel.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2f2dde6b
  10. 26 11月, 2018 1 次提交
  11. 07 11月, 2018 3 次提交
  12. 20 9月, 2018 1 次提交
    • H
      usb: core: safely deal with the dynamic quirk lists · 16c4cb19
      Harry Pan 提交于
      Applying dynamic usbcore quirks in early booting when the slab is
      not yet ready would cause kernel panic of null pointer dereference
      because the quirk_count has been counted as 1 while the quirk_list
      was failed to allocate.
      
      i.e.,
      [    1.044970] BUG: unable to handle kernel NULL pointer dereference at           (null)
      [    1.044995] IP: [<ffffffffb0953ec7>] usb_detect_quirks+0x88/0xd1
      [    1.045016] PGD 0
      [    1.045026] Oops: 0000 [#1] PREEMPT SMP
      [    1.046986] gsmi: Log Shutdown Reason 0x03
      [    1.046995] Modules linked in:
      [    1.047008] CPU: 0 PID: 81 Comm: kworker/0:3 Not tainted 4.4.154 #28
      [    1.047016] Hardware name: Google Coral/Coral, BIOS Google_Coral.10068.27.0 12/04/2017
      [    1.047028] Workqueue: usb_hub_wq hub_event
      [    1.047037] task: ffff88017a321c80 task.stack: ffff88017a384000
      [    1.047044] RIP: 0010:[<ffffffffb0953ec7>]  [<ffffffffb0953ec7>] usb_detect_quirks+0x88/0xd1
      
      To tackle this odd, let's balance the quirk_count to 0 when the kcalloc
      call fails, and defer the quirk setting into a lower level callback
      which ensures that the kernel memory management has been initialized.
      
      Fixes: 027bd6ca ("usb: core: Add "quirks" parameter for usbcore")
      Signed-off-by: NHarry Pan <harry.pan@intel.com>
      Acked-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      16c4cb19
  13. 05 9月, 2018 2 次提交
  14. 06 7月, 2018 1 次提交
  15. 22 4月, 2018 1 次提交
  16. 25 3月, 2018 2 次提交
  17. 20 3月, 2018 1 次提交
    • K
      usb: core: Add "quirks" parameter for usbcore · 027bd6ca
      Kai-Heng Feng 提交于
      Trying quirks in usbcore needs to rebuild the driver or the entire
      kernel if it's builtin. It can save a lot of time if usbcore has similar
      ability like "usbhid.quirks=" and "usb-storage.quirks=".
      
      Rename the original quirk detection function to "static" as we introduce
      this new "dynamic" function.
      
      Now users can use "usbcore.quirks=" as short term workaround before the
      next kernel release. Also, the quirk parameter can XOR the builtin
      quirks for debugging purpose.
      
      This is inspired by usbhid and usb-storage.
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      027bd6ca
  18. 12 3月, 2018 1 次提交
    • G
      Revert "usb: core: Add "quirks" parameter for usbcore" · 95713fb8
      Greg Kroah-Hartman 提交于
      This reverts commit b27560e4 as it
      breaks the build for some arches :(
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
      index 1d1d53f85ddd..70a7398c20e2 100644
      --- a/Documentation/admin-guide/kernel-parameters.txt
      +++ b/Documentation/admin-guide/kernel-parameters.txt
      @@ -4368,6 +4368,61 @@
      
       	usbcore.nousb	[USB] Disable the USB subsystem
      
      +	usbcore.quirks=
      +			[USB] A list of quirks entries to supplement or
      +			override the built-in usb core quirk list.  List
      +			entries are separated by commas.  Each entry has
      +			the form VID:PID:Flags where VID and PID are Vendor
      +			and Product ID values (4-digit hex numbers) and
      +			Flags is a set of characters, each corresponding
      +			to a common usb core quirk flag as follows:
      +				a = USB_QUIRK_STRING_FETCH_255 (string
      +					descriptors must not be fetched using
      +					a 255-byte read);
      +				b = USB_QUIRK_RESET_RESUME (device can't resume
      +					correctly so reset it instead);
      +				c = USB_QUIRK_NO_SET_INTF (device can't handle
      +					Set-Interface requests);
      +				d = USB_QUIRK_CONFIG_INTF_STRINGS (device can't
      +					handle its Configuration or Interface
      +					strings);
      +				e = USB_QUIRK_RESET (device can't be reset
      +					(e.g morph devices), don't use reset);
      +				f = USB_QUIRK_HONOR_BNUMINTERFACES (device has
      +					more interface descriptions than the
      +					bNumInterfaces count, and can't handle
      +					talking to these interfaces);
      +				g = USB_QUIRK_DELAY_INIT (device needs a pause
      +					during initialization, after we read
      +					the device descriptor);
      +				h = USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL (For
      +					high speed and super speed interrupt
      +					endpoints, the USB 2.0 and USB 3.0 spec
      +					require the interval in microframes (1
      +					microframe = 125 microseconds) to be
      +					calculated as interval = 2 ^
      +					(bInterval-1).
      +					Devices with this quirk report their
      +					bInterval as the result of this
      +					calculation instead of the exponent
      +					variable used in the calculation);
      +				i = USB_QUIRK_DEVICE_QUALIFIER (device can't
      +					handle device_qualifier descriptor
      +					requests);
      +				j = USB_QUIRK_IGNORE_REMOTE_WAKEUP (device
      +					generates spurious wakeup, ignore
      +					remote wakeup capability);
      +				k = USB_QUIRK_NO_LPM (device can't handle Link
      +					Power Management);
      +				l = USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL
      +					(Device reports its bInterval as linear
      +					frames instead of the USB 2.0
      +					calculation);
      +				m = USB_QUIRK_DISCONNECT_SUSPEND (Device needs
      +					to be disconnected before suspend to
      +					prevent spurious wakeup)
      +			Example: quirks=0781:5580:bk,0a5c:5834:gij
      +
       	usbhid.mousepoll=
       			[USBHID] The interval which mice are to be polled at.
      
      diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
      index f4a548471f0f..42faaeead81b 100644
      --- a/drivers/usb/core/quirks.c
      +++ b/drivers/usb/core/quirks.c
      @@ -11,6 +11,143 @@
       #include <linux/usb/hcd.h>
       #include "usb.h"
      
      +struct quirk_entry {
      +	u16 vid;
      +	u16 pid;
      +	u32 flags;
      +};
      +
      +static DEFINE_MUTEX(quirk_mutex);
      +
      +static struct quirk_entry *quirk_list;
      +static unsigned int quirk_count;
      +
      +static char quirks_param[128];
      +
      +static int quirks_param_set(const char *val, const struct kernel_param *kp)
      +{
      +	char *p, *field;
      +	u16 vid, pid;
      +	u32 flags;
      +	size_t i;
      +
      +	mutex_lock(&quirk_mutex);
      +
      +	if (!val || !*val) {
      +		quirk_count = 0;
      +		kfree(quirk_list);
      +		quirk_list = NULL;
      +		goto unlock;
      +	}
      +
      +	for (quirk_count = 1, i = 0; val[i]; i++)
      +		if (val[i] == ',')
      +			quirk_count++;
      +
      +	if (quirk_list) {
      +		kfree(quirk_list);
      +		quirk_list = NULL;
      +	}
      +
      +	quirk_list = kcalloc(quirk_count, sizeof(struct quirk_entry),
      +			     GFP_KERNEL);
      +	if (!quirk_list) {
      +		mutex_unlock(&quirk_mutex);
      +		return -ENOMEM;
      +	}
      +
      +	for (i = 0, p = (char *)val; p && *p;) {
      +		/* Each entry consists of VID:PID:flags */
      +		field = strsep(&p, ":");
      +		if (!field)
      +			break;
      +
      +		if (kstrtou16(field, 16, &vid))
      +			break;
      +
      +		field = strsep(&p, ":");
      +		if (!field)
      +			break;
      +
      +		if (kstrtou16(field, 16, &pid))
      +			break;
      +
      +		field = strsep(&p, ",");
      +		if (!field || !*field)
      +			break;
      +
      +		/* Collect the flags */
      +		for (flags = 0; *field; field++) {
      +			switch (*field) {
      +			case 'a':
      +				flags |= USB_QUIRK_STRING_FETCH_255;
      +				break;
      +			case 'b':
      +				flags |= USB_QUIRK_RESET_RESUME;
      +				break;
      +			case 'c':
      +				flags |= USB_QUIRK_NO_SET_INTF;
      +				break;
      +			case 'd':
      +				flags |= USB_QUIRK_CONFIG_INTF_STRINGS;
      +				break;
      +			case 'e':
      +				flags |= USB_QUIRK_RESET;
      +				break;
      +			case 'f':
      +				flags |= USB_QUIRK_HONOR_BNUMINTERFACES;
      +				break;
      +			case 'g':
      +				flags |= USB_QUIRK_DELAY_INIT;
      +				break;
      +			case 'h':
      +				flags |= USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL;
      +				break;
      +			case 'i':
      +				flags |= USB_QUIRK_DEVICE_QUALIFIER;
      +				break;
      +			case 'j':
      +				flags |= USB_QUIRK_IGNORE_REMOTE_WAKEUP;
      +				break;
      +			case 'k':
      +				flags |= USB_QUIRK_NO_LPM;
      +				break;
      +			case 'l':
      +				flags |= USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL;
      +				break;
      +			case 'm':
      +				flags |= USB_QUIRK_DISCONNECT_SUSPEND;
      +				break;
      +			/* Ignore unrecognized flag characters */
      +			}
      +		}
      +
      +		quirk_list[i++] = (struct quirk_entry)
      +			{ .vid = vid, .pid = pid, .flags = flags };
      +	}
      +
      +	if (i < quirk_count)
      +		quirk_count = i;
      +
      +unlock:
      +	mutex_unlock(&quirk_mutex);
      +
      +	return param_set_copystring(val, kp);
      +}
      +
      +static const struct kernel_param_ops quirks_param_ops = {
      +	.set = quirks_param_set,
      +	.get = param_get_string,
      +};
      +
      +static struct kparam_string quirks_param_string = {
      +	.maxlen = sizeof(quirks_param),
      +	.string = quirks_param,
      +};
      +
      +module_param_cb(quirks, &quirks_param_ops, &quirks_param_string, 0644);
      +MODULE_PARM_DESC(quirks, "Add/modify USB quirks by specifying quirks=vendorID:productID:quirks");
      +
       /* Lists of quirky USB devices, split in device quirks and interface quirks.
        * Device quirks are applied at the very beginning of the enumeration process,
        * right after reading the device descriptor. They can thus only match on device
      @@ -320,8 +457,8 @@ static int usb_amd_resume_quirk(struct usb_device *udev)
       	return 0;
       }
      
      -static u32 __usb_detect_quirks(struct usb_device *udev,
      -			       const struct usb_device_id *id)
      +static u32 usb_detect_static_quirks(struct usb_device *udev,
      +				    const struct usb_device_id *id)
       {
       	u32 quirks = 0;
      
      @@ -339,21 +476,43 @@ static u32 __usb_detect_quirks(struct usb_device *udev,
       	return quirks;
       }
      
      +static u32 usb_detect_dynamic_quirks(struct usb_device *udev)
      +{
      +	u16 vid = le16_to_cpu(udev->descriptor.idVendor);
      +	u16 pid = le16_to_cpu(udev->descriptor.idProduct);
      +	int i, flags = 0;
      +
      +	mutex_lock(&quirk_mutex);
      +
      +	for (i = 0; i < quirk_count; i++) {
      +		if (vid == quirk_list[i].vid && pid == quirk_list[i].pid) {
      +			flags = quirk_list[i].flags;
      +			break;
      +		}
      +	}
      +
      +	mutex_unlock(&quirk_mutex);
      +
      +	return flags;
      +}
      +
       /*
        * Detect any quirks the device has, and do any housekeeping for it if needed.
        */
       void usb_detect_quirks(struct usb_device *udev)
       {
      -	udev->quirks = __usb_detect_quirks(udev, usb_quirk_list);
      +	udev->quirks = usb_detect_static_quirks(udev, usb_quirk_list);
      
       	/*
       	 * Pixart-based mice would trigger remote wakeup issue on AMD
       	 * Yangtze chipset, so set them as RESET_RESUME flag.
       	 */
       	if (usb_amd_resume_quirk(udev))
      -		udev->quirks |= __usb_detect_quirks(udev,
      +		udev->quirks |= usb_detect_static_quirks(udev,
       				usb_amd_resume_quirk_list);
      
      +	udev->quirks ^= usb_detect_dynamic_quirks(udev);
      +
       	if (udev->quirks)
       		dev_dbg(&udev->dev, "USB quirks for this device: %x\n",
       			udev->quirks);
      @@ -372,7 +531,7 @@ void usb_detect_interface_quirks(struct usb_device *udev)
       {
       	u32 quirks;
      
      -	quirks = __usb_detect_quirks(udev, usb_interface_quirk_list);
      +	quirks = usb_detect_static_quirks(udev, usb_interface_quirk_list);
       	if (quirks == 0)
       		return;
      
      @@ -380,3 +539,11 @@ void usb_detect_interface_quirks(struct usb_device *udev)
       		quirks);
       	udev->quirks |= quirks;
       }
      +
      +void usb_release_quirk_list(void)
      +{
      +	mutex_lock(&quirk_mutex);
      +	kfree(quirk_list);
      +	quirk_list = NULL;
      +	mutex_unlock(&quirk_mutex);
      +}
      diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
      index 2f5fbc56a9dd..0adb6345ff2e 100644
      --- a/drivers/usb/core/usb.c
      +++ b/drivers/usb/core/usb.c
      @@ -1259,6 +1259,7 @@ static void __exit usb_exit(void)
       	if (usb_disabled())
       		return;
      
      +	usb_release_quirk_list();
       	usb_deregister_device_driver(&usb_generic_driver);
       	usb_major_cleanup();
       	usb_deregister(&usbfs_driver);
      diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
      index 149cc7480971..546a2219454b 100644
      --- a/drivers/usb/core/usb.h
      +++ b/drivers/usb/core/usb.h
      @@ -36,6 +36,7 @@ extern void usb_deauthorize_interface(struct usb_interface *);
       extern void usb_authorize_interface(struct usb_interface *);
       extern void usb_detect_quirks(struct usb_device *udev);
       extern void usb_detect_interface_quirks(struct usb_device *udev);
      +extern void usb_release_quirk_list(void);
       extern int usb_remove_device(struct usb_device *udev);
      
       extern int usb_get_device_descriptor(struct usb_device *dev,
      95713fb8
  19. 10 3月, 2018 1 次提交
    • K
      usb: core: Add "quirks" parameter for usbcore · b27560e4
      Kai-Heng Feng 提交于
      Trying quirks in usbcore needs to rebuild the driver or the entire
      kernel if it's builtin. It can save a lot of time if usbcore has similar
      ability like "usbhid.quirks=" and "usb-storage.quirks=".
      
      Rename the original quirk detection function to "static" as we introduce
      this new "dynamic" function.
      
      Now users can use "usbcore.quirks=" as short term workaround before the
      next kernel release. Also, the quirk parameter can XOR the builtin
      quirks for debugging purpose.
      
      This is inspired by usbhid and usb-storage.
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b27560e4
  20. 07 3月, 2018 1 次提交
    • D
      usb: quirks: add control message delay for 1b1c:1b20 · cb88a058
      Danilo Krummrich 提交于
      Corsair Strafe RGB keyboard does not respond to usb control messages
      sometimes and hence generates timeouts.
      
      Commit de3af5bf ("usb: quirks: add delay init quirk for Corsair
      Strafe RGB keyboard") tried to fix those timeouts by adding
      USB_QUIRK_DELAY_INIT.
      
      Unfortunately, even with this quirk timeouts of usb_control_msg()
      can still be seen, but with a lower frequency (approx. 1 out of 15):
      
      [   29.103520] usb 1-8: string descriptor 0 read error: -110
      [   34.363097] usb 1-8: can't set config #1, error -110
      
      Adding further delays to different locations where usb control
      messages are issued just moves the timeouts to other locations,
      e.g.:
      
      [   35.400533] usbhid 1-8:1.0: can't add hid device: -110
      [   35.401014] usbhid: probe of 1-8:1.0 failed with error -110
      
      The only way to reliably avoid those issues is having a pause after
      each usb control message. In approx. 200 boot cycles no more timeouts
      were seen.
      
      Addionaly, keep USB_QUIRK_DELAY_INIT as it turned out to be necessary
      to have the delay in hub_port_connect() after hub_port_init().
      
      The overall boot time seems not to be influenced by these additional
      delays, even on fast machines and lightweight distributions.
      
      Fixes: de3af5bf ("usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard")
      Cc: stable@vger.kernel.org
      Signed-off-by: NDanilo Krummrich <danilokrummrich@dk-develop.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cb88a058
  21. 16 2月, 2018 1 次提交
  22. 19 12月, 2017 2 次提交
  23. 28 11月, 2017 1 次提交
  24. 04 11月, 2017 3 次提交
  25. 23 10月, 2017 1 次提交
    • D
      USB: Force disconnect Huawei 4G modem during suspend · 8dd8d2c9
      Daniel Drake 提交于
      When going into S3 suspend, the Acer TravelMate P648-M and P648-G3
      laptops immediately wake up 3-4 seconds later for no obvious reason.
      
      Unbinding the integrated Huawei 4G LTE modem before suspend avoids
      the issue, even though we are not using the modem at all (checked
      from rescue.target/runlevel1). The problem also occurs when the option
      and cdc-ether modem drivers aren't loaded; it reproduces just with the
      base usb driver. Under Windows the system can suspend fine.
      
      Seeking a better fix, we've tried a lot of things, including:
       - Check that the device's power/wakeup is disabled
       - Check that remote wakeup is off at the USB level
       - All the quirks in drivers/usb/core/quirks.c e.g. USB_QUIRK_RESET_RESUME,
         USB_QUIRK_RESET, USB_QUIRK_IGNORE_REMOTE_WAKEUP, USB_QUIRK_NO_LPM.
      
      but none of that makes any difference.
      
      There are no errors in the logs showing any suspend/resume-related issues.
      When the system wakes up due to the modem, log-wise it appears to be a
      normal resume.
      
      Introduce a quirk to disable the port during suspend when the modem is
      detected.
      
      The modem from the P648-G3 model is:
      T:  Bus=01 Lev=01 Prnt=01 Port=08 Cnt=04 Dev#=  5 Spd=480  MxCh= 0
      D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=ff MxPS=64 #Cfgs=  3
      P:  Vendor=12d1 ProdID=15c3 Rev= 1.02
      S:  Manufacturer=Huawei Technologies Co., Ltd.
      S:  Product=HUAWEI Mobile
      S:  SerialNumber=0123456789ABCDEF
      C:  #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=  2mA
      I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=06 Prot=10 Driver=
      E:  Ad=82(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=13 Driver=
      E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=12 Driver=
      E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:  If#= 3 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=06 Prot=16 Driver=
      E:  Ad=86(I) Atr=03(Int.) MxPS=  16 Ivl=2ms
      I:  If#= 3 Alt= 1 #EPs= 3 Cls=ff(vend.) Sub=06 Prot=16 Driver=
      E:  Ad=86(I) Atr=03(Int.) MxPS=  16 Ivl=2ms
      E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:  If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=1b Driver=
      E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      C:* #Ifs= 6 Cfg#= 2 Atr=a0 MxPwr=  2mA
      I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether
      E:  Ad=82(I) Atr=03(Int.) MxPS=  16 Ivl=2ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=06 Prot=00 Driver=cdc_ether
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=06 Prot=10 Driver=option
      E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
      E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=13 Driver=option
      E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=12 Driver=option
      E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=06 Prot=1b Driver=option
      E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      C:  #Ifs= 2 Cfg#= 3 Atr=a0 MxPwr=  2mA
      A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
      I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=
      E:  Ad=82(I) Atr=03(Int.) MxPS=  16 Ivl=2ms
      I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=
      E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
      
      Based on an earlier patch by Chris Chiu.
      Signed-off-by: NDaniel Drake <drake@endlessm.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8dd8d2c9
  26. 17 10月, 2017 1 次提交
  27. 28 8月, 2017 2 次提交
    • D
      usb: Add device quirk for Logitech HD Pro Webcam C920-C · a1279ef7
      Dmitry Fleytman 提交于
      Commit e0429362
      ("usb: Add device quirk for Logitech HD Pro Webcams C920 and C930e")
      introduced quirk to workaround an issue with some Logitech webcams.
      
      Apparently model C920-C has the same issue so applying
      the same quirk as well.
      
      See aforementioned commit message for detailed explanation of the problem.
      Signed-off-by: NDmitry Fleytman <dmitry@daynix.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a1279ef7
    • K
      usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard · de3af5bf
      Kai-Heng Feng 提交于
      Corsair Strafe RGB keyboard has trouble to initialize:
      
      [ 1.679455] usb 3-6: new full-speed USB device number 4 using xhci_hcd
      [ 6.871136] usb 3-6: unable to read config index 0 descriptor/all
      [ 6.871138] usb 3-6: can't read configurations, error -110
      [ 6.991019] usb 3-6: new full-speed USB device number 5 using xhci_hcd
      [ 12.246642] usb 3-6: unable to read config index 0 descriptor/all
      [ 12.246644] usb 3-6: can't read configurations, error -110
      [ 12.366555] usb 3-6: new full-speed USB device number 6 using xhci_hcd
      [ 17.622145] usb 3-6: unable to read config index 0 descriptor/all
      [ 17.622147] usb 3-6: can't read configurations, error -110
      [ 17.742093] usb 3-6: new full-speed USB device number 7 using xhci_hcd
      [ 22.997715] usb 3-6: unable to read config index 0 descriptor/all
      [ 22.997716] usb 3-6: can't read configurations, error -110
      
      Although it may work after several times unpluging/pluging:
      
      [ 68.195240] usb 3-6: new full-speed USB device number 11 using xhci_hcd
      [ 68.337459] usb 3-6: New USB device found, idVendor=1b1c, idProduct=1b20
      [ 68.337463] usb 3-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      [ 68.337466] usb 3-6: Product: Corsair STRAFE RGB Gaming Keyboard
      [ 68.337468] usb 3-6: Manufacturer: Corsair
      [ 68.337470] usb 3-6: SerialNumber: 0F013021AEB8046755A93ED3F5001941
      
      Tried three quirks: USB_QUIRK_DELAY_INIT, USB_QUIRK_NO_LPM and
      USB_QUIRK_DEVICE_QUALIFIER, user confirmed that USB_QUIRK_DELAY_INIT alone
      can workaround this issue. Hence add the quirk for Corsair Strafe RGB.
      
      BugLink: https://bugs.launchpad.net/bugs/1678477Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      de3af5bf
  28. 11 8月, 2017 2 次提交
  29. 29 6月, 2017 1 次提交
    • D
      Add USB quirk for HVR-950q to avoid intermittent device resets · 6836796d
      Devin Heitmueller 提交于
      The USB core and sysfs will attempt to enumerate certain parameters
      which are unsupported by the au0828 - causing inconsistent behavior
      and sometimes causing the chip to reset.  Avoid making these calls.
      
      This problem manifested as intermittent cases where the au8522 would
      be reset on analog video startup, in particular when starting up ALSA
      audio streaming in parallel - the sysfs entries created by
      snd-usb-audio on streaming startup would result in unsupported control
      messages being sent during tuning which would put the chip into an
      unknown state.
      Signed-off-by: NDevin Heitmueller <dheitmueller@kernellabs.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6836796d
  30. 14 3月, 2017 1 次提交
    • S
      usb-core: Add LINEAR_FRAME_INTR_BINTERVAL USB quirk · 3243367b
      Samuel Thibault 提交于
      Some USB 2.0 devices erroneously report millisecond values in
      bInterval. The generic config code manages to catch most of them,
      but in some cases it's not completely enough.
      
      The case at stake here is a USB 2.0 braille device, which wants to
      announce 10ms and thus sets bInterval to 10, but with the USB 2.0
      computation that yields to 64ms.  It happens that one can type fast
      enough to reach this interval and get the device buffers overflown,
      leading to problematic latencies.  The generic config code does not
      catch this case because the 64ms is considered a sane enough value.
      
      This change thus adds a USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL quirk
      to mark devices which actually report milliseconds in bInterval,
      and marks Vario Ultra devices as needing it.
      Signed-off-by: NSamuel Thibault <samuel.thibault@ens-lyon.org>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3243367b