Skip to content
  1. Nov 23, 2019
    • Lyude Paul's avatar
      Revert "Input: synaptics - enable RMI mode for X1 Extreme 2nd Generation" · 87916634
      Lyude Paul authored
      
      
      This reverts commit 68b9c5066e39af41d3448abfc887c77ce22dd64d.
      
      Ugh, I really dropped the ball on this one :\. So as it turns out RMI4
      works perfectly fine on the X1 Extreme Gen 2 except for one thing I
      didn't notice because I usually use the trackpoint: clicking with the
      touchpad. Somehow this is broken, in fact we don't even seem to indicate
      BTN_LEFT as a valid event type for the RMI4 touchpad. And, I don't even
      see any RMI4 events coming from the touchpad when I press down on it.
      This only seems to work for PS/2 mode.
      
      Since that means we have a regression, and PS/2 mode seems to work fine
      for the time being - revert this for now. We'll have to do a more
      thorough investigation on this.
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Link: https://lore.kernel.org/r/20191119234534.10725-1-lyude@redhat.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      87916634
  2. Nov 16, 2019
  3. Nov 13, 2019
  4. Nov 05, 2019
    • Andrew Duggan's avatar
      Input: synaptics-rmi4 - remove unused result_bits mask · 310ca2a6
      Andrew Duggan authored
      
      
      The result_bits mask is no longer used by the driver and should be
      removed.
      
      Signed-off-by: default avatarAndrew Duggan <aduggan@synaptics.com>
      Link: https://lore.kernel.org/r/20191025002527.3189-4-aduggan@synaptics.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      310ca2a6
    • Andrew Duggan's avatar
      Input: synaptics-rmi4 - do not consume more data than we have (F11, F12) · 5d40d95e
      Andrew Duggan authored
      
      
      Currently, rmi_f11_attention() and rmi_f12_attention() functions update
      the attn_data data pointer and size based on the size of the expected
      size of the attention data. However, if the actual valid data in the
      attn buffer is less then the expected value then the updated data
      pointer will point to memory beyond the end of the attn buffer. Using
      the calculated valid_bytes instead will prevent this from happening.
      
      Signed-off-by: default avatarAndrew Duggan <aduggan@synaptics.com>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20191025002527.3189-3-aduggan@synaptics.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      5d40d95e
    • Andrew Duggan's avatar
      Input: synaptics-rmi4 - disable the relative position IRQ in the F12 driver · f6aabe1f
      Andrew Duggan authored
      This patch fixes an issue seen on HID touchpads which report finger
      positions using RMI4 Function 12. The issue manifests itself as
      spurious button presses as described in:
      https://www.spinics.net/lists/linux-input/msg58618.html
      
      Commit 24d28e4f
      
       ("Input: synaptics-rmi4 - convert irq distribution
      to irq_domain") switched the RMI4 driver to using an irq_domain to handle
      RMI4 function interrupts. Functions with more then one interrupt now have
      each interrupt mapped to their own IRQ and IRQ handler. The result of
      this change is that the F12 IRQ handler was now getting called twice. Once
      for the absolute data interrupt and once for the relative data interrupt.
      For HID devices, calling rmi_f12_attention() a second time causes the
      attn_data data pointer and size to be set incorrectly. When the touchpad
      button is pressed, F30 will generate an interrupt and attempt to read the
      F30 data from the invalid attn_data data pointer and report incorrect
      button events.
      
      This patch disables the F12 relative interrupt which prevents
      rmi_f12_attention() from being called twice.
      
      Signed-off-by: default avatarAndrew Duggan <aduggan@synaptics.com>
      Reported-by: default avatarSimon Wood <simon@mungewell.org>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20191025002527.3189-2-aduggan@synaptics.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      f6aabe1f
    • Lucas Stach's avatar
      Input: synaptics-rmi4 - fix video buffer size · 003f01c7
      Lucas Stach authored
      
      
      The video buffer used by the queue is a vb2_v4l2_buffer, not a plain
      vb2_buffer. Using the wrong type causes the allocation of the buffer
      storage to be too small, causing a out of bounds write when
      __init_vb2_v4l2_buffer initializes the buffer.
      
      Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
      Fixes: 3a762dbd
      
       ("[media] Input: synaptics-rmi4 - add support for F54 diagnostics")
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20191104114454.10500-1-l.stach@pengutronix.de
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      003f01c7
  5. Oct 22, 2019
  6. Oct 16, 2019
  7. Oct 12, 2019
    • Evan Green's avatar
      Input: synaptics-rmi4 - avoid processing unknown IRQs · 363c5387
      Evan Green authored
      
      
      rmi_process_interrupt_requests() calls handle_nested_irq() for
      each interrupt status bit it finds. If the irq domain mapping for
      this bit had not yet been set up, then it ends up calling
      handle_nested_irq(0), which causes a NULL pointer dereference.
      
      There's already code that masks the irq_status bits coming out of the
      hardware with current_irq_mask, presumably to avoid this situation.
      However current_irq_mask seems to more reflect the actual mask set
      in the hardware rather than the IRQs software has set up and registered
      for. For example, in rmi_driver_reset_handler(), the current_irq_mask
      is initialized based on what is read from the hardware. If the reset
      value of this mask enables IRQs that Linux has not set up yet, then
      we end up in this situation.
      
      There appears to be a third unused bitmask that used to serve this
      purpose, fn_irq_bits. Use that bitmask instead of current_irq_mask
      to avoid calling handle_nested_irq() on IRQs that have not yet been
      set up.
      
      Signed-off-by: default avatarEvan Green <evgreen@chromium.org>
      Reviewed-by: default avatarAndrew Duggan <aduggan@synaptics.com>
      Link: https://lore.kernel.org/r/20191008223657.163366-1-evgreen@chromium.org
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      363c5387
  8. Oct 09, 2019
    • Hans de Goede's avatar
      Input: soc_button_array - partial revert of support for newer surface devices · bcf05957
      Hans de Goede authored
      Commit c3941593 ("Input: soc_button_array - add support for newer
      surface devices") not only added support for the MSHW0040 ACPI HID,
      but for some reason it also makes changes to the error handling of the
      soc_button_lookup_gpio() call in soc_button_device_create(). Note ideally
      this seamingly unrelated change would have been made in a separate commit,
      with a message explaining the what and why of this change.
      
      I guess this change may have been added to deal with -EPROBE_DEFER errors,
      but in case of the existing support for PNP0C40 devices, treating
      -EPROBE_DEFER as any other error is deliberate, see the comment this
      commit adds for why.
      
      The actual returning of -EPROBE_DEFER to the caller of soc_button_probe()
      introduced by the new error checking causes a serious regression:
      
      On devices with so called virtual GPIOs soc_button_lookup_gpio() will
      always return -EPROBE_DEFER for these fake GPIOs, when this happens
      during the second call of soc_button_device_create() we already have
      successfully registered our first child. This causes the kernel to think
      we are making progress with probing things even though we unregister the
      child before again before we return the -EPROBE_DEFER. Since we are making
      progress the kernel will retry deferred-probes again immediately ending
      up stuck in a loop with the following showing in dmesg:
      
      [  124.022697] input: gpio-keys as /devices/platform/INTCFD9:00/gpio-keys.0.auto/input/input6537
      [  124.040764] input: gpio-keys as /devices/platform/INTCFD9:00/gpio-keys.0.auto/input/input6538
      [  124.056967] input: gpio-keys as /devices/platform/INTCFD9:00/gpio-keys.0.auto/input/input6539
      [  124.072143] input: gpio-keys as /devices/platform/INTCFD9:00/gpio-keys.0.auto/input/input6540
      [  124.092373] input: gpio-keys as /devices/platform/INTCFD9:00/gpio-keys.0.auto/input/input6541
      [  124.108065] input: gpio-keys as /devices/platform/INTCFD9:00/gpio-keys.0.auto/input/input6542
      [  124.128483] input: gpio-keys as /devices/platform/INTCFD9:00/gpio-keys.0.auto/input/input6543
      [  124.147141] input: gpio-keys as /devices/platform/INTCFD9:00/gpio-keys.0.auto/input/input6544
      [  124.165070] input: gpio-keys as /devices/platform/INTCFD9:00/gpio-keys.0.auto/input/input6545
      [  124.179775] input: gpio-keys as /devices/platform/INTCFD9:00/gpio-keys.0.auto/input/input6546
      [  124.202726] input: gpio-keys as /devices/platform/INTCFD9:00/gpio-keys.0.auto/input/input6547
      <continues on and on and on>
      
      And 1 CPU core being stuck at 100% and udev hanging since it is waiting
      for the modprobe of soc_button_array to return.
      
      This patch reverts the soc_button_lookup_gpio() error handling changes,
      fixing this regression.
      
      Fixes: c3941593
      
       ("Input: soc_button_array - add support for newer surface devices")
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=205031
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Tested-by: default avatarMaximilian Luz <luzmaximilian@gmail.com>
      Acked-by: default avatarMaximilian Luz <luzmaximilian@gmail.com>
      Link: https://lore.kernel.org/r/20191005105551.353273-1-hdegoede@redhat.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      bcf05957
  9. Oct 03, 2019
  10. Sep 17, 2019
  11. Sep 07, 2019
  12. Sep 06, 2019
  13. Sep 03, 2019
  14. Aug 30, 2019
    • Stephen Boyd's avatar
      Input: i8042 - enable wakeup on a stable struct device · c8a144b2
      Stephen Boyd authored
      
      
      We don't know when the device will be added with device_add() in
      serio_add_port() because serio_add_port() is called from a workqueue
      that this driver schedules by calling serio_register_port(). The best we
      can know is that the device will definitely not have been added yet when
      the start callback is called on the serio device.
      
      While it hasn't been shown to be a problem, proactively move the wakeup
      enabling calls to the start hook so that we don't race with the
      workqueue calling device_add(). This will avoid racy situations where
      code tries to add wakeup sysfs attributes for this device from
      dpm_sysfs_add() but the path in device_set_wakeup_capable() has already
      done so.
      
      Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      c8a144b2
  15. Aug 21, 2019
  16. Aug 17, 2019
  17. Aug 15, 2019
    • Stephen Boyd's avatar
      Input: remove dev_err() usage after platform_get_irq() · 0bec8b7e
      Stephen Boyd authored
      
      
      We don't need dev_err() messages when platform_get_irq() fails now that
      platform_get_irq() prints an error message itself when something goes
      wrong. Let's remove these prints with a simple semantic patch.
      
      // <smpl>
      @@
      expression ret;
      struct platform_device *E;
      @@
      
      ret =
      (
      platform_get_irq(E, ...)
      |
      platform_get_irq_byname(E, ...)
      );
      
      if ( \( ret < 0 \| ret <= 0 \) )
      {
      (
      -if (ret != -EPROBE_DEFER)
      -{ ...
      -dev_err(...);
      -... }
      |
      ...
      -dev_err(...);
      )
      ...
      }
      // </smpl>
      
      While we're here, remove braces on if statements that only have one
      statement (manually).
      
      Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      0bec8b7e
  18. Aug 12, 2019