1. 05 9月, 2019 1 次提交
  2. 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
  3. 31 5月, 2019 1 次提交
  4. 09 1月, 2019 2 次提交
  5. 09 7月, 2018 5 次提交
  6. 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
  7. 23 1月, 2018 2 次提交
  8. 09 11月, 2017 1 次提交
  9. 06 4月, 2017 7 次提交
  10. 21 3月, 2017 12 次提交
  11. 06 3月, 2017 2 次提交
  12. 19 12月, 2016 3 次提交
  13. 29 11月, 2016 1 次提交
  14. 28 11月, 2016 1 次提交
    • R
      HID: sony: Comply to Linux gamepad spec for DS4 · 9131f8cc
      Roderick Colenbrander 提交于
      The DS4 side of hid-sony used the hid-core layer to assign buttons
      and axes based on the HID report descriptors. The default mapping
      was strange e.g. right stick using ABS_Z/ABS_RZ or the physical
      'south button' being reported as BTN_EAST etcetera.
      
      This patch makes the DS4 side ofi the hid-sony driver comply to
      the Linux game controller spec as suggested in a discussion with
      Dmitry on the linux-input list.
      
      Currently the main user of the DS4 is the SDL2 library, which has
      a mapping table using vendor/device/version as a key. In order to
      not break SDL2 we discussed adjusting the version number, so it
      can have both mappings. This was discust on linux-input and we
      discussed privately with SDL2 developers.
      Signed-off-by: NRoderick Colenbrander <roderick.colenbrander@sony.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      9131f8cc