1. 02 12月, 2021 2 次提交
  2. 20 8月, 2021 2 次提交
  3. 15 6月, 2021 1 次提交
    • P
      HID: sony: fix freeze when inserting ghlive ps3/wii dongles · fb1a79a6
      Pascal Giard 提交于
      This commit fixes a freeze on insertion of a Guitar Hero Live PS3/WiiU
      USB dongle. Indeed, with the current implementation, inserting one of
      those USB dongles will lead to a hard freeze. I apologize for not
      catching this earlier, it didn't occur on my old laptop.
      
      While the issue was isolated to memory alloc/free, I could not figure
      out why it causes a freeze. So this patch fixes this issue by
      simplifying memory allocation and usage.
      
      We remind that for the dongle to work properly, a control URB needs to
      be sent periodically. We used to alloc/free the URB each time this URB
      needed to be sent.
      
      With this patch, the memory for the URB is allocated on the probe, reused
      for as long as the dongle is plugged in, and freed once the dongle is
      unplugged.
      Signed-off-by: NPascal Giard <pascal.giard@etsmtl.ca>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      fb1a79a6
  4. 18 1月, 2021 1 次提交
  5. 27 11月, 2020 1 次提交
  6. 25 11月, 2020 3 次提交
    • R
      HID: sony: Workaround for DS4 dongle hotplug kernel crash. · f5dc93b7
      Roderick Colenbrander 提交于
      The hid-sony driver has custom DS4 connect/disconnect logic for the
      DS4 dongle, which is a USB dongle acting as a proxy to Bluetooth
      connected DS4.
      
      The connect/disconnect logic works fine generally, however not in
      conjunction with Steam. Steam implements its own DS4 driver using
      hidraw. Both hid-sony and Steam are issuing their own HID requests
      and are racing each other during DS4 dongle connect/disconnect
      resulting in a kernel crash in hid-sony.
      
      The problem is that upon a DS4 connect to the dongle, hid-sony kicks
      of 'ds4_get_calibration_data' from within its dongle hotplug code.
      The calibration code issues raw HID feature report for reportID 0x02.
      When Steam is running, it issues a feature report for reportID 0x12
      typically just prior to hid-sony requesting feature reportID 0x02.
      The result is that 'ds4_get_calibration_data' receives the data Steam
      requested as that's the HID report returing first. Currently this
      results in it processing invalid data, which ultimately results in a
      divide by zero upon a future 'dualshock4_parse_report'.
      
      The solution for now is to check within 'ds4_get_calibration_data' to
      check if we received data for the feature report we issued and if not
      retry. This fixes bug 206785.
      Signed-off-by: NRoderick Colenbrander <roderick.colenbrander@sony.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      f5dc93b7
    • R
      HID: sony: Don't use fw_version/hw_version for sysfs cleanup. · 1a8212e8
      Roderick Colenbrander 提交于
      The DS4 dongle reports fw_version and hw_version as 0 when no actual
      DS4 is connected to it. This prevents cleaning up sysfs nodes upon
      device remove.
      
      This patch decouples sysfs cleanup from the fw_version and hw_version
      values by introducing boolean values.
      Signed-off-by: NRoderick Colenbrander <roderick.colenbrander@sony.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      1a8212e8
    • R
      HID: sony: Report more accurate DS4 power status. · a76a6c18
      Roderick Colenbrander 提交于
      This patch moves the power supply status logic to DS3/DS4 parse_report,
      to allow for more accurate DS4 status reporting.
      
      The DS4 power status code was actually incorrect, but reported okay'ish
      data in most cases. There was a different interpretation of the battery_info
      values 0-10 or 0-9 depending on cable state. It added +1 to extend the range
      to 0-10. This is actually incorrect, there is no different range. Values
      higher than 11 actually indicates 'full' and 14/15 'error' for which we
      reported 100% and a valid power state.
      
      Moving the status logic to parse_report avoids having to pass more state
      to the generic sony_battery_get_property and simplifies the code.
      Signed-off-by: NRoderick Colenbrander <roderick.colenbrander@sony.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      a76a6c18
  7. 26 5月, 2020 1 次提交
    • S
      HID: sony: Fix for broken buttons on DS3 USB dongles · e72455b8
      Scott Shumate 提交于
      Fix for non-working buttons on knock-off USB dongles for Sony
      controllers. These USB dongles are used to connect older Sony DA/DS1/DS2
      controllers via USB and are common on Amazon, AliExpress, etc.  Without
      the patch, the square, X, and circle buttons do not function.  These
      dongles used to work prior to kernel 4.10 but removing the global DS3
      report fixup in commit e19a267b ("HID: sony: DS3 comply to Linux gamepad
      spec") exposed the problem.
      
      Many people reported the problem on the Ubuntu forums and are working
      around the problem by falling back to the 4.9 hid-sony driver.
      
      The problem stems from these dongles incorrectly reporting their button
      count as 13 instead of 16.  This patch fixes up the report descriptor by
      changing the button report count to 16 and removing 3 padding bits.
      
      Cc: stable@vger.kernel.org
      Fixes: e19a267b ("HID: sony: DS3 comply to Linux gamepad spec")
      Signed-off-by: NScott Shumate <scott.shumate@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      e72455b8
  8. 04 10月, 2019 1 次提交
    • A
      HID: Fix assumption that devices have inputs · d9d4b1e4
      Alan Stern 提交于
      The syzbot fuzzer found a slab-out-of-bounds write bug in the hid-gaff
      driver.  The problem is caused by the driver's assumption that the
      device must have an input report.  While this will be true for all
      normal HID input devices, a suitably malicious device can violate the
      assumption.
      
      The same assumption is present in over a dozen other HID drivers.
      This patch fixes them by checking that the list of hid_inputs for the
      hid_device is nonempty before allowing it to be used.
      
      Reported-and-tested-by: syzbot+403741a091bf41d4ae79@syzkaller.appspotmail.com
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      d9d4b1e4
  9. 05 9月, 2019 1 次提交
  10. 06 8月, 2019 1 次提交
    • R
      HID: sony: Fix race condition between rumble and device remove. · e0f6974a
      Roderick Colenbrander 提交于
      Valve reported a kernel crash on Ubuntu 18.04 when disconnecting a DS4
      gamepad while rumble is enabled. This issue is reproducible with a
      frequency of 1 in 3 times in the game Borderlands 2 when using an
      automatic weapon, which triggers many rumble operations.
      
      We found the issue to be a race condition between sony_remove and the
      final device destruction by the HID / input system. The problem was
      that sony_remove didn't clean some of its work_item state in
      "struct sony_sc". After sony_remove work, the corresponding evdev
      node was around for sufficient time for applications to still queue
      rumble work after "sony_remove".
      
      On pre-4.19 kernels the race condition caused a kernel crash due to a
      NULL-pointer dereference as "sc->output_report_dmabuf" got freed during
      sony_remove. On newer kernels this crash doesn't happen due the buffer
      now being allocated using devm_kzalloc. However we can still queue work,
      while the driver is an undefined state.
      
      This patch fixes the described problem, by guarding the work_item
      "state_worker" with an initialized variable, which we are setting back
      to 0 on cleanup.
      Signed-off-by: NRoderick Colenbrander <roderick.colenbrander@sony.com>
      CC: stable@vger.kernel.org
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      e0f6974a
  11. 31 5月, 2019 1 次提交
  12. 09 1月, 2019 2 次提交
  13. 09 7月, 2018 5 次提交
  14. 06 3月, 2018 1 次提交
    • T
      HID: sony: Add touchpad support for NSG-MR5U and NSG-MR7U remotes · b7289cb1
      Todd Kelner 提交于
      Sony's NSG-MR5U and NSG-MR7U remote controls have a full keyboard and a
      touchpad.  The keyboard is already supported by the existing Linux
      kernel and drivers but the touchpad is not recognized.  This patch adds
      the coded needed to bring full functionality to the touchpad.
      
      Note that these remotes use the vendor code for SMK even though they are
      Sony branded.
      
      Known limitations
      - The built-in accelerometers are not supported by these changes
      - When the Drag (Fn) key is used as a mouse button, the button is
      automatically released when the key begins repeating.  There are two
        workarounds for this 1) Use the button behind the touchpad instead of
        the Drag (Fn) key or 2) Disable the key repeat functionality or
        increase the key repeat delay.
      Signed-off-by: NTodd Kelner <tsopdump@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      b7289cb1
  15. 23 1月, 2018 2 次提交
  16. 09 11月, 2017 1 次提交
  17. 06 4月, 2017 7 次提交
  18. 21 3月, 2017 7 次提交