25 Dec, 2017

1 commit

  • [ Upstream commit deaba636997557fce46ca7bcb509bff5ea1b0558 ]

    Add quirks for several corsair gaming devices to avoid long delays on
    report initialization

    Supported devices:

    - Corsair K65RGB Rapidfire Gaming Keyboard
    - Corsair K70RGB Rapidfire Gaming Keyboard
    - Corsair Scimitar Pro RGB Gaming Mouse

    Signed-off-by: Oscar Campos
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Oscar Campos
     

18 Oct, 2017

1 commit

  • commit f043bfc98c193c284e2cd768fefabe18ac2fed9b upstream.

    The hid descriptor identifies the length and type of subordinate
    descriptors for a device. If the received hid descriptor is smaller than
    the size of the struct hid_descriptor, it is possible to cause
    out-of-bounds.

    In addition, if bNumDescriptors of the hid descriptor have an incorrect
    value, this can also cause out-of-bounds while approaching hdesc->desc[n].

    So check the size of hid descriptor and bNumDescriptors.

    BUG: KASAN: slab-out-of-bounds in usbhid_parse+0x9b1/0xa20
    Read of size 1 at addr ffff88006c5f8edf by task kworker/1:2/1261

    CPU: 1 PID: 1261 Comm: kworker/1:2 Not tainted
    4.14.0-rc1-42251-gebb2c2437d80 #169
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
    Workqueue: usb_hub_wq hub_event
    Call Trace:
    __dump_stack lib/dump_stack.c:16
    dump_stack+0x292/0x395 lib/dump_stack.c:52
    print_address_description+0x78/0x280 mm/kasan/report.c:252
    kasan_report_error mm/kasan/report.c:351
    kasan_report+0x22f/0x340 mm/kasan/report.c:409
    __asan_report_load1_noabort+0x19/0x20 mm/kasan/report.c:427
    usbhid_parse+0x9b1/0xa20 drivers/hid/usbhid/hid-core.c:1004
    hid_add_device+0x16b/0xb30 drivers/hid/hid-core.c:2944
    usbhid_probe+0xc28/0x1100 drivers/hid/usbhid/hid-core.c:1369
    usb_probe_interface+0x35d/0x8e0 drivers/usb/core/driver.c:361
    really_probe drivers/base/dd.c:413
    driver_probe_device+0x610/0xa00 drivers/base/dd.c:557
    __device_attach_driver+0x230/0x290 drivers/base/dd.c:653
    bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463
    __device_attach+0x26e/0x3d0 drivers/base/dd.c:710
    device_initial_probe+0x1f/0x30 drivers/base/dd.c:757
    bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523
    device_add+0xd0b/0x1660 drivers/base/core.c:1835
    usb_set_configuration+0x104e/0x1870 drivers/usb/core/message.c:1932
    generic_probe+0x73/0xe0 drivers/usb/core/generic.c:174
    usb_probe_device+0xaf/0xe0 drivers/usb/core/driver.c:266
    really_probe drivers/base/dd.c:413
    driver_probe_device+0x610/0xa00 drivers/base/dd.c:557
    __device_attach_driver+0x230/0x290 drivers/base/dd.c:653
    bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463
    __device_attach+0x26e/0x3d0 drivers/base/dd.c:710
    device_initial_probe+0x1f/0x30 drivers/base/dd.c:757
    bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523
    device_add+0xd0b/0x1660 drivers/base/core.c:1835
    usb_new_device+0x7b8/0x1020 drivers/usb/core/hub.c:2457
    hub_port_connect drivers/usb/core/hub.c:4903
    hub_port_connect_change drivers/usb/core/hub.c:5009
    port_event drivers/usb/core/hub.c:5115
    hub_event+0x194d/0x3740 drivers/usb/core/hub.c:5195
    process_one_work+0xc7f/0x1db0 kernel/workqueue.c:2119
    worker_thread+0x221/0x1850 kernel/workqueue.c:2253
    kthread+0x3a1/0x470 kernel/kthread.c:231
    ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431

    Reported-by: Andrey Konovalov
    Signed-off-by: Jaejoong Kim
    Tested-by: Andrey Konovalov
    Acked-by: Alan Stern
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Jaejoong Kim
     

29 Jun, 2017

1 commit


12 Apr, 2017

4 commits

  • [ Upstream commit 8aa2cc7e747881d1fd52db28261b201d4e3e5565 ]

    The DolphinBar by Mayflash (identified as Dragonrise) needs
    HID_QUIRK_MULTI_INPUT to split it up into four input devices. Without this
    quirk the adapter is falsely recognized as a tablet. See also bug 115841
    (https://bugzilla.kernel.org/show_bug.cgi?id=115841).

    Signed-off-by: Marcel Hasler
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Marcel Hasler
     
  • [ Upstream commit f83f90cf7ba68deb09406ea9da80852a64c4db29 ]

    The Futaba TOSD-5711BB VFD crashes when the initial HID report is requested,
    register the display in hid-ids and tell hid-quirks to not do the init.

    Signed-off-by: Alex Wood
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Alex Wood
     
  • [ Upstream commit 8fe89ef076fa104f514da6ef61d90f5bf93488e3 ]

    There is no reasons to filter out keyboard and consumer control collections
    in hid-multitouch.
    With the previous hid-input fix, there is now a full support of the Type
    Cover and we can remove all specific bits from hid-core and hid-microsoft.

    hid-multitouch will automatically set HID_QUIRK_NO_INIT_REPORTS so we can
    also remove it from the list of ushbid quirks.

    Signed-off-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Tissoires
     
  • [ Upstream commit b2554000f5b5d2a3a368d09c6debf7da64901fcf ]

    All known gamepad adapters by Mayflash (identified as Dragonrise) need
    HID_QUIRK_MULTI_INPUT to split them up into four input devices. Without this
    quirk those adapters are falsely recognized as tablets. Fixes bug 115841
    (https://bugzilla.kernel.org/show_bug.cgi?id=115841).

    Signed-off-by: Marcel Hasler
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Marcel Hasler
     

09 Feb, 2017

1 commit

  • commit ed9ab4287f96e66340e0390e2c583f2f9110cba0 upstream.

    Quirking the following AMI USB device with ALWAYS_POLL fixes an AMI
    virtual keyboard and mouse from not responding and timing out when
    it is attached to a ppc64el Power 8 system and when we have some
    rapid open/closes on the mouse device.

    usb 1-3: new high-speed USB device number 2 using xhci_hcd
    usb 1-3: New USB device found, idVendor=046b, idProduct=ff01
    usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    usb 1-3: Product: Virtual Hub
    usb 1-3: Manufacturer: American Megatrends Inc.
    usb 1-3: SerialNumber: serial
    usb 1-3.3: new high-speed USB device number 3 using xhci_hcd
    usb 1-3.3: New USB device found, idVendor=046b, idProduct=ff31
    usb 1-3.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    usb 1-3.3: Product: Virtual HardDisk Device
    usb 1-3.3: Manufacturer: American Megatrends Inc.
    usb 1-3.4: new low-speed USB device number 4 using xhci_hcd
    usb 1-3.4: New USB device found, idVendor=046b, idProduct=ff10
    usb 1-3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    usb 1-3.4: Product: Virtual Keyboard and Mouse
    usb 1-3.4: Manufacturer: American Megatrends Inc.

    With the quirk I have not been able to trigger the issue with
    half an hour of saturation soak testing.

    Signed-off-by: Colin Ian King
    Signed-off-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Colin Ian King
     

04 Nov, 2016

1 commit


10 Oct, 2016

1 commit

  • The Akai MIDImix (09e8:0031) is a MIDI fader controller that speaks
    regular MIDI and works well with Linux. However, initialization gets
    delayed due to reports timeout:

    [3643645.631124] hid-generic 0003:09E8:0031.0020: timeout initializing reports
    [3643645.632416] hid-generic 0003:09E8:0031.0020: hiddev0: USB HID v1.11 Device [AKAI MIDI Mix] on usb-0000:00:14.0-2/input0

    Adding "usbhid.quirks=0x09e8:0x0031:0x20000000" on the kernel
    command line makes the issues go away.

    Signed-off-by: Steinar H. Gunderson
    Signed-off-by: Jiri Kosina

    Steinar H. Gunderson
     

07 Oct, 2016

1 commit


19 Sep, 2016

2 commits

  • Add quirk for Corsair STRAFE keyboard, similarly to what we've been
    doing for other CORSAIR devices already, in order to avoid long delays
    during boot.

    [jkosina@suse.cz: reword changelog a little bit]
    Signed-off-by: Marian Krivos
    Signed-off-by: Jiri Kosina

    Marian Krivoš
     
  • Rename the device ID macro for the second version of KYE MousePen i608x
    graphics tablet to have "V" in its name to signify that "2" is a
    version.

    I.e. USB_DEVICE_ID_KYE_MOUSEPEN_I608X_2 ->
    USB_DEVICE_ID_KYE_MOUSEPEN_I608X_V2

    This also makes applying additional fixes from DIGImend easier.

    Signed-off-by: Nikolai Kondrashov
    Reviewed-by: Benjamin Tissoires
    Signed-off-by: Jiri Kosina

    Nikolai Kondrashov
     

17 Aug, 2016

1 commit


24 Jun, 2016

1 commit


17 May, 2016

1 commit


27 Apr, 2016

1 commit

  • These devices feature multiple interfaces/endpoints: a legacy BIOS/boot
    interface (endpoint 0x81), as well as 2 corsair-specific keyboard interfaces
    (endpoint 0x82, 0x83 IN/0x03 OUT) and an RGB LED control interface (endpoint
    0x84 IN/0x04 OUT)

    Because the extra 3 interfaces are not of subclass USB_INTERFACE_SUBCLASS_BOOT,
    HID_QUIRK_NOGET is not automatically set on them and a 10s timeout per-endpoint
    (30s per device) occurs initialising reports on boot. We configure
    HID_QUIRK_NO_INIT_REPORTS for these devices.

    Additionally the left-side G1-G18 macro keys on the K95RGB generate output on
    the un-opened 0x82/0x83 endpoints which causes the keyboard to stop responding
    waiting for this event to be collected. We enable HID_QUIRK_ALWAYS_POLL to
    prevent this situation from occurring.

    Signed-off-by: Trent Lloyd
    Tested-by: SUGNIAUX Wilfried
    Signed-off-by: Jiri Kosina

    Trent Lloyd
     

25 Apr, 2016

1 commit


24 Mar, 2016

1 commit

  • The usbhid driver has inconsistently duplicated code in its post-reset,
    resume, and reset-resume pathways.

    reset-resume doesn't check HID_STARTED before trying to
    restart the I/O queues.

    resume fails to clear the HID_SUSPENDED flag if HID_STARTED
    isn't set.

    resume calls usbhid_restart_queues() with usbhid->lock held
    and the others call it without holding the lock.

    The first item in particular causes a problem following a reset-resume
    if the driver hasn't started up its I/O. URB submission fails because
    usbhid->urbin is NULL, and this triggers an unending reset-retry loop.

    This patch fixes the problem by creating a new subroutine,
    hid_restart_io(), to carry out all the common activities. It also
    adds some checks that were missing in the original code:

    After a reset, there's no need to clear any halted endpoints.

    After a resume, if a reset is pending there's no need to
    restart any I/O until the reset is finished.

    After a resume, if the interrupt-IN endpoint is halted there's
    no need to submit the input URB until the halt has been
    cleared.

    Signed-off-by: Alan Stern
    Reported-by: Daniel Fraga
    Tested-by: Daniel Fraga
    CC:
    Signed-off-by: Jiri Kosina

    Alan Stern
     

11 Mar, 2016

1 commit

  • The device which identifies itself as a "USB Keykoard" (no typo)
    with VID:PID 1a2c:0027 does not seem to be handling the reports
    initialization very well.

    This results in a "usb_submit_urb(ctrl) failed: -1" message from the
    kernel when connected, and a delay before its initialization. It can
    also cause the hang the system.

    This patch adds the quirk for this device, which causes the delay
    to disappear. It is named as "USB Keykoard2" because the "USB Keykoard"
    already exists.

    Signed-off-by: Daniel Bristot de Oliveira
    Signed-off-by: Jiri Kosina

    Daniel Bristot de Oliveira
     

29 Jan, 2016

1 commit


21 Jan, 2016

1 commit

  • dmesg shows a lot of:
    [ 1374.890348] hid-multitouch 0003:0408:3003.0007: usb_submit_urb(ctrl) failed: -1
    [ 1384.916388] hid-multitouch 0003:0408:3003.0007: usb_submit_urb(ctrl) failed: -1
    [ 1384.916432] hid-multitouch 0003:0408:3003.0007: timeout initializing reports

    Add the quirk and make the touchscreen happy.

    Signed-off-by: Benjamin Tissoires
    Tested-by: Jim lovell
    Signed-off-by: Jiri Kosina

    Benjamin Tissoires
     

15 Jan, 2016

1 commit

  • Pull HID updates from Jiri Kosina:

    - appoint Benjamin Tissoires as co-maintainer / designated reviewer

    - sysfs report_descriptor visibility fix for unclaimed devices, from
    Andy Lutomirski

    - suspend/resume fixes for Sony driver from Frank Praznik

    - IRQ deadlock fix from Ioan-Adrian Ratiu

    - hid-i2c fixes affecting (at least) Yoga 900 from Mika Westerberg and
    Srinivas Pandruvada

    - a lot of new device support (especially, but not limited to, Wacom)
    and assorted small misc fixes

    - almost complete G920 support; the only bit that is missing is
    switching the device to HID mode automatically; Simon Wood and Michal
    Maly are working on it.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (46 commits)
    Revert "INPUT: xpad: switch Logitech G920 Wheel into HID mode"
    HID: sensor-hub: Add quirk for Lenovo Yoga 900 with ITE Chips
    HID: Add new PID for Microchip Pick16F1454
    HID: wacom: Use correct report to query pen ID from INTUOSHT2 devices
    HID: i2c-hid: Prevent sending reports from racing with device reset
    HID: use kobj_to_dev()
    HID: wiimote: use dev_to_wii()
    HID: add a new helper to_hid_driver()
    HID: use to_hid_device()
    HID: move to_hid_device() to hid.h
    HID: usbhid: use to_usb_device
    HID: corsair: Convert to use module_hid_driver
    HID: input: ignore the battery in OKLICK Laser BTmouse
    HID: wacom: Fix pad button range for CINTIQ_COMPANION_2
    HID: wacom: Fix touchring value reporting
    HID: wacom: Report 'strip2' values in ABS_RY
    HID: wacom: Limit touchstrip data to 13 bits
    HID: wacom: bitwise vs logical ORs
    HID: wacom: Apply lowres quirk to BAMBOO_TOUCH devices
    HID: enable hid device to suspend/resume asynchronously
    ...

    Linus Torvalds
     

14 Jan, 2016

1 commit


28 Dec, 2015

1 commit


14 Dec, 2015

1 commit

  • Pull USB driver fixes from Greg KH:
    "Here are a number of small USB fixes for 4.4-rc5. All of them have
    been in linux-next. The majority are gadget and phy issues, with a
    few new quirks and device ids added as well"

    * tag 'usb-4.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (32 commits)
    USB: add quirk for devices with broken LPM
    xhci: fix usb2 resume timing and races.
    usb: musb: fail with error when no DMA controller set
    usb: gadget: uvc: fix permissions of configfs attributes
    usb: musb: core: Fix pm runtime for deferred probe
    usb: phy: msm: fix a possible NULL dereference
    USB: host: ohci-at91: fix a crash in ohci_hcd_at91_overcurrent_irq
    usb: Quiet down false peer failure messages
    usb: xhci: fix config fail of FS hub behind a HS hub with MTT
    xhci: Fix memory leak in xhci_pme_acpi_rtd3_enable()
    usb: Use the USB_SS_MULT() macro to decode burst multiplier for log message
    USB: whci-hcd: add check for dma mapping error
    usb: core : hub: Fix BOS 'NULL pointer' kernel panic
    USB: quirks: Apply ALWAYS_POLL to all ELAN devices
    usb-storage: Fix scsi-sd failure "Invalid field in cdb" for USB adapter JMicron
    USB: quirks: Fix another ELAN touchscreen
    usb: dwc3: gadget: don't prestart interrupt endpoints
    USB: serial: Another Infineon flash loader USB ID
    USB: cdc_acm: Ignore Infineon Flash Loader utility
    USB: cp210x: Remove CP2110 ID from compatibility list
    ...

    Linus Torvalds
     

02 Dec, 2015

2 commits

  • All ELAN hid devices seem to require the ALWAYS_POLL quirk. Let's use
    this quirk for all devices from this vendor, rather than maintaining a
    list of all its known product IDs.

    Tested-by: Adrien Vergé
    Signed-off-by: Adrien Vergé
    Reviewed-by: Benjamin Tissoires
    Reviewed-by: Jiri Kosina
    Signed-off-by: Greg Kroah-Hartman

    Adrien Vergé
     
  • The critical section protected by usbhid->lock in hid_ctrl() is too
    big and because of this it causes a recursive deadlock. "Too big" means
    the case statement and the call to hid_input_report() do not need to be
    protected by the spinlock (no URB operations are done inside them).

    The deadlock happens because in certain rare cases drivers try to grab
    the lock while handling the ctrl irq which grabs the lock before them
    as described above. For example newer wacom tablets like 056a:033c try
    to reschedule proximity reads from wacom_intuos_schedule_prox_event()
    calling hid_hw_request() -> usbhid_request() -> usbhid_submit_report()
    which tries to grab the usbhid lock already held by hid_ctrl().

    There are two ways to get out of this deadlock:
    1. Make the drivers work "around" the ctrl critical region, in the
    wacom case for ex. by delaying the scheduling of the proximity read
    request itself to a workqueue.
    2. Shrink the critical region so the usbhid lock protects only the
    instructions which modify usbhid state, calling hid_input_report()
    with the spinlock unlocked, allowing the device driver to grab the
    lock first, finish and then grab the lock afterwards in hid_ctrl().

    This patch implements the 2nd solution.

    Signed-off-by: Ioan-Adrian Ratiu
    Signed-off-by: Jiri Kosina

    Ioan-Adrian Ratiu
     

23 Nov, 2015

1 commit


20 Nov, 2015

1 commit


07 Nov, 2015

1 commit


05 Oct, 2015

1 commit

  • The WiiU adapter from Mayflash (see
    http://www.mayflash.com/Products/NINTENDOWiiU/W009.html) is not
    working correctly.

    The "XInput" mode works fine, the controller is recognized as a xbox
    controller. But it is only possible to connect one controller with this method.

    In "DInput" mode the device is recognized as some kind of mouse input but no
    joystick is created. This commit will change this behavior with
    HID_QUIRK_MULTI_INPUT to split the device into 4 input devices so that it will
    also create joysticks in /dev/input/js*.

    Signed-off-by: Oliver Schmitt
    Reviewed-by: Felipe Balbi
    Signed-off-by: Jiri Kosina

    Oliver Schmitt
     

23 Sep, 2015

1 commit


01 Sep, 2015

2 commits


24 Aug, 2015

1 commit


19 Aug, 2015

1 commit

  • It was reported that after 10-20 reboots, a usb keyboard plugged
    into a docking station would not work unless it was replugged in.

    Using usbmon, it turns out the interrupt URBs were streaming with
    callback errors of -71 for some reason. The hid-core.c::hid_io_error was
    supposed to retry and then reset, but the reset wasn't really happening.

    The check for HID_NO_BANDWIDTH was inverted. Fix was simple.

    Tested by reporter and locally by me by unplugging a keyboard halfway until I
    could recreate a stream of errors but no disconnect.

    Signed-off-by: Don Zickus
    Cc: stable@vger.kernel.org
    Signed-off-by: Jiri Kosina

    Don Zickus
     

24 Jul, 2015

1 commit

  • Adding support for the Microsoft Surface 3 (non-pro) Type Cover.

    The existing definitions and quirks are actually for the Surface
    Pro 3 type covers. I've renamed the old constants to reflect that
    they belong to the Surface Pro 3, and added a new constant and
    matching code for the Surface 3.

    Signed-off-by: Stephen Just
    Signed-off-by: Jiri Kosina

    Stephen Just
     

08 Jul, 2015

1 commit


29 Jun, 2015

1 commit