29 Jul, 2020

2 commits

  • [ Upstream commit 966334dfc472bdfa67bed864842943b19755d192 ]

    This moves the wakeup increment for elan devices to the touch report.
    This prevents the drivers from incorrectly reporting a wakeup when the
    resume callback resets then device, which causes an interrupt to
    occur.

    Signed-off-by: Derek Basehore
    Link: https://lore.kernel.org/r/20200706235046.1984283-1-dbasehore@chromium.org
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Derek Basehore
     
  • [ Upstream commit dcb00fc799dc03fd320e123e4c81b3278c763ea5 ]

    Tested on my own laptop, touchpad feels slightly more responsive with
    this on, though it might just be placebo.

    Signed-off-by: Ilya Katsnelson
    Reviewed-by: Lyude Paul
    Link: https://lore.kernel.org/r/20200703143457.132373-1-me@0upti.me
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Ilya Katsnelson
     

22 Jul, 2020

3 commits

  • commit 17d51429da722cd8fc77a365a112f008abf4f8b3 upstream.

    This fixes two finger trackpad scroll on the Lenovo XiaoXin Air 12.
    Without nomux, the trackpad behaves as if only one finger is present and
    moves the cursor when trying to scroll.

    Signed-off-by: David Pedersen
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20200625133754.291325-1-limero1337@gmail.com
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    David Pedersen
     
  • [ Upstream commit 7842087b0196d674ed877d768de8f2a34d7fdc53 ]

    MMS345L is another first generation touch screen from Melfas,
    which uses mostly the same registers as MMS152.

    However, there is some garbage printed during initialization.
    Apparently MMS345L does not have the MMS152_COMPAT_GROUP register
    that is read+printed during initialization.

    TSP FW Rev: bootloader 0x6 / core 0x26 / config 0x26, Compat group: \x06

    On earlier kernel versions the compat group was actually printed as
    an ASCII control character, seems like it gets escaped now.

    But we probably shouldn't print something from a random register.

    Add a separate "melfas,mms345l" compatible that avoids reading
    from the MMS152_COMPAT_GROUP register. This might also help in case
    there is some other device-specific quirk in the future.

    Signed-off-by: Stephan Gerhold
    Reviewed-by: Andi Shyti
    Link: https://lore.kernel.org/r/20200423102431.2715-1-stephan@gerhold.net
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Stephan Gerhold
     
  • [ Upstream commit 1dd5ddc125b4625c3beb8e644ae872445d739bbc ]

    The touchscreen on the Cube I15-TC don't match the default display,
    with 0,0 touches being reported when touching at the top-right of
    the screen.

    Add a quirk to invert the x coordinate.

    Reported-and-tested-by: Arkadiy
    Signed-off-by: Sergei A. Trusov
    Reviewed-by: Bastien Nocera
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Sergei A. Trusov
     

24 Jun, 2020

2 commits

  • [ Upstream commit e4f4ffa8a98c24a4ab482669b1e2b4cfce3f52f4 ]

    This causes a build error with CONFIG_WALNUT because kb_cs and kb_data
    were removed in commit 917f0af9e5a9 ("powerpc: Remove arch/ppc and
    include/asm-ppc").

    ld.lld: error: undefined symbol: kb_cs
    > referenced by i8042-ppcio.h:28 (drivers/input/serio/i8042-ppcio.h:28)
    > input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a
    > referenced by i8042-ppcio.h:28 (drivers/input/serio/i8042-ppcio.h:28)
    > input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a
    > referenced by i8042-ppcio.h:28 (drivers/input/serio/i8042-ppcio.h:28)
    > input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a

    ld.lld: error: undefined symbol: kb_data
    > referenced by i8042.c:309 (drivers/input/serio/i8042.c:309)
    > input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a
    > referenced by i8042-ppcio.h:33 (drivers/input/serio/i8042-ppcio.h:33)
    > input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a
    > referenced by i8042.c:319 (drivers/input/serio/i8042.c:319)
    > input/serio/i8042.o:(__i8042_command) in archive drivers/built-in.a
    > referenced 15 more times

    Presumably since nobody has noticed this for the last 12 years, there is
    not anyone actually trying to use this driver so we can just remove this
    special walnut code and use the generic header so it builds for all
    configurations.

    Fixes: 917f0af9e5a9 ("powerpc: Remove arch/ppc and include/asm-ppc")
    Reported-by: kbuild test robot
    Signed-off-by: Nathan Chancellor
    Signed-off-by: Michael Ellerman
    Acked-by: Dmitry Torokhov
    Link: https://lore.kernel.org/r/20200518181043.3363953-1-natechancellor@gmail.com
    Signed-off-by: Sasha Levin

    Nathan Chancellor
     
  • [ Upstream commit 255cdaf73412de13608fb776101402dca68bed2b ]

    Since commit b6eba86030bf ("Input: edt-ft5x06 - add offset support for
    ev-ft5726") offset-x and offset-y is supported. Devices using those
    offset parameters don't support the offset parameter so we need to add
    the NO_REGISTER check for edt_ft5x06_ts_get_defaults().

    Fixes: b6eba86030bf ("Input: edt-ft5x06 - add offset support for ev-ft5726")
    Signed-off-by: Marco Felsch
    Link: https://lore.kernel.org/r/20200227112819.16754-2-m.felsch@pengutronix.de
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Marco Felsch
     

17 Jun, 2020

2 commits

  • [ Upstream commit 642aa86eaf8f1e6fe894f20fd7f12f0db52ee03c ]

    The Lenovo Thinkpad T470s I own has a different touchpad with "LEN007a"
    instead of the already included PNP ID "LEN006c". However, my touchpad
    seems to work well without any problems using RMI. So this patch adds the
    other PNP ID.

    Signed-off-by: Dennis Kadioglu
    Link: https://lore.kernel.org/r/ff770543cd53ae818363c0fe86477965@mail.eclipso.de
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Dennis Kadioglu
     
  • [ Upstream commit 3f8f770575d911c989043d8f0fb8dec96360c41c ]

    MMS345L is another first generation touch screen from Melfas,
    which uses the same registers as MMS152.

    However, using I2C_M_NOSTART for it causes errors when reading:

    i2c i2c-0: sendbytes: NAK bailout.
    mms114 0-0048: __mms114_read_reg: i2c transfer failed (-5)

    The driver works fine as soon as I2C_M_NOSTART is removed.

    Reviewed-by: Andi Shyti
    Signed-off-by: Stephan Gerhold
    Link: https://lore.kernel.org/r/20200405170904.61512-1-stephan@gerhold.net
    [dtor: removed separate mms345l handling, made everyone use standard
    transfer mode, propagated the 10bit addressing flag to the read part of the
    transfer as well.]
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Stephan Gerhold
     

03 Jun, 2020

7 commits

  • [ Upstream commit 5caab2da63207d6d631007f592f5219459e3454d ]

    Fix to return a negative error code from the input_register_device()
    error handling case instead of 0, as done elsewhere in this function.

    Signed-off-by: Wei Yongjun
    Link: https://lore.kernel.org/r/20200428134948.78343-1-weiyongjun1@huawei.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Wei Yongjun
     
  • [ Upstream commit d5a5e5b5fa7b86c05bf073acc0ba98fa280174ec ]

    Fix a use-after-free noticed by running with KASAN enabled. If
    rmi_irq_fn() is run twice in a row, then rmi_f11_attention() (among
    others) will end up reading from drvdata->attn_data.data, which was
    freed and left dangling in rmi_irq_fn().

    Commit 55edde9fff1a ("Input: synaptics-rmi4 - prevent UAF reported by
    KASAN") correctly identified and analyzed this bug. However the attempted
    fix only NULLed out a local variable, missing the fact that
    drvdata->attn_data is a struct, not a pointer.

    NULL out the correct pointer in the driver data to prevent the attention
    functions from copying from it.

    Fixes: 55edde9fff1a ("Input: synaptics-rmi4 - prevent UAF reported by KASAN")
    Fixes: b908d3cd812a ("Input: synaptics-rmi4 - allow to add attention data")
    Signed-off-by: Evan Green
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20200427145537.1.Ic8f898e0147beeee2c005ee7b20f1aebdef1e7eb@changeid
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Evan Green
     
  • [ Upstream commit 2712c91a54a1058d55c284152b4d93c979b67be6 ]

    On the Lenovo ThinkPad Twist S230u (3347-4HU) with BIOS version
    "GDETC1WW (1.81 ) 06/27/2019", the keyboard, Synaptics TouchPad, and
    TrackPoint either do not function or stop functioning a few minutes
    after boot. This problem has been noted before, perhaps only occurring
    with BIOS 1.57 and later.[1][2][3][4][5]

    Odds of a BIOS fix appear to be low: 1.57 was released over 6 years ago
    and although the [BIOS changelog] notes "Fixed an issue of UEFI
    touchpad/trackpoint/keyboard/touchscreen" in 1.58, it appears to be
    insufficient.

    Setting i8042.reset=1 or adding 33474HU to the reset list avoids the
    issue on my system from either warm or cold boot.

    [1]: https://bugs.launchpad.net/bugs/1210748
    [2]: https://bbs.archlinux.org/viewtopic.php?pid=1360425
    [3]: https://forums.linuxmint.com/viewtopic.php?f=46&t=41200
    [4]: https://forums.linuxmint.com/viewtopic.php?f=49&t=157115
    [5]: https://forums.lenovo.com/topic/findpost/27/1337119
    [BIOS changelog]: https://download.lenovo.com/pccbbs/mobiles/gduj33uc.txt

    Signed-off-by: Kevin Locke
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/94f384b0f75f90f71425d7dce7ac82c59ddb87a8.1587702636.git.kevin@kevinlocke.name
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Kevin Locke
     
  • [ Upstream commit 38347374ae3f1ec4df56dd688bd603a64e79a0ed ]

    According to the file name and Kconfig, a 'k' is missing in this driver
    name. It should be "dlink-dir685-touchkeys".

    Fixes: 131b3de7016b ("Input: add D-Link DIR-685 touchkeys driver")
    Signed-off-by: Christophe JAILLET
    Reviewed-by: Linus Walleij
    Link: https://lore.kernel.org/r/20200412213937.5287-1-christophe.jaillet@wanadoo.fr
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Christophe JAILLET
     
  • [ Upstream commit 764f7f911bf72450c51eb74cbb262ad9933741d8 ]

    Sending [ 0x05, 0x20, 0x00, 0x0f, 0x06 ] packet for Xbox One S controllers
    fixes an issue where controller is stuck in Bluetooth mode and not sending
    any inputs.

    Signed-off-by: Łukasz Patron
    Reviewed-by: Cameron Gutman
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20200422075206.18229-1-priv.luk@gmail.com
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Łukasz Patron
     
  • [ Upstream commit 09264098ff153f60866039d60b31d39b66f55a31 ]

    input_flush_device() should only be called once the struct file is being
    released and no open descriptors remain, but evdev_flush() was calling
    it whenever a file descriptor was closed.

    This caused uploaded force-feedback effects to be erased when a process
    did a dup()/close() on the event FD, called system(), etc.

    Call input_flush_device() from evdev_release() instead.

    Reported-by: Mathieu Maret
    Signed-off-by: Brendan Shanks
    Link: https://lore.kernel.org/r/20200421231003.7935-1-bshanks@codeweavers.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Brendan Shanks
     
  • [ Upstream commit e3b4f94ef52ae1592cbe199bd38dbdc0d58b2217 ]

    Based on available information this uses the singletouch irtouch
    protocol. This is tested and confirmed to be fully functional on
    the BonXeon TP hardware I have.

    Signed-off-by: James Hilliard
    Link: https://lore.kernel.org/r/20200413184217.55700-1-james.hilliard1@gmail.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    James Hilliard
     

17 Apr, 2020

2 commits

  • commit ebc68cedec4aead47d8d11623d013cca9bf8e825 upstream.

    The Acer Aspire 5738z has a button to disable (and re-enable) the
    touchpad next to the touchpad.

    When this button is pressed a LED underneath indicates that the touchpad
    is disabled (and an event is send to userspace and GNOME shows its
    touchpad enabled / disable OSD thingie).

    So far so good, but after re-enabling the touchpad it no longer works.

    The laptop does not have an external ps2 port, so mux mode is not needed
    and disabling mux mode fixes the touchpad no longer working after toggling
    it off and back on again, so lets add this laptop model to the nomux list.

    Signed-off-by: Hans de Goede
    Link: https://lore.kernel.org/r/20200331123947.318908-1-hdegoede@redhat.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Hans de Goede
     
  • [ Upstream commit da3289044833769188c0da945d2cec90af35e87e ]

    The Coreriver TouchCore 360 is like the midas board touchkey, but it is
    using a fixed regulator.

    Signed-off-by: Nick Reitemeyer
    Link: https://lore.kernel.org/r/20200121141525.3404-3-nick.reitemeyer@web.de
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Nick Reitemeyer
     

01 Apr, 2020

3 commits

  • commit 1369d0abe469fb4cdea8a5bce219d38cb857a658 upstream.

    This laptop (and perhaps other variants of the same model) reports an
    SMBus-capable Synaptics touchpad. Everything (including suspend and
    resume) works fine when RMI is enabled via the kernel command line, so
    let's add it to the whitelist.

    Signed-off-by: Yussuf Khalil
    Link: https://lore.kernel.org/r/20200307213508.267187-1-dev@pp3345.net
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Yussuf Khalil
     
  • commit 4134252ab7e2c339a54302b88496cb5a89cdbaec upstream.

    We need to refresh timestamp when emitting key autorepeat events, otherwise
    they will carry timestamp of the original key press event.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=206929
    Fixes: 3b51c44bd693 ("Input: allow drivers specify timestamp for input events")
    Cc: stable@vger.kernel.org
    Reported-by: teika kazura
    Tested-by: teika kazura
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Torokhov
     
  • commit 32cf3a610c35cb21e3157f4bbf29d89960e30a36 upstream.

    These functions are supposed to return negative error codes but instead
    it returns true on failure and false on success. The error codes are
    eventually propagated back to user space.

    Fixes: 48a2b783483b ("Input: add Raydium I2C touchscreen driver")
    Signed-off-by: Dan Carpenter
    Link: https://lore.kernel.org/r/20200303101306.4potflz7na2nn3od@kili.mountain
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     

24 Feb, 2020

1 commit

  • [ Upstream commit e112324cc0422c046f1cf54c56f333d34fa20885 ]

    The EP0700MLP1 returns bogus data on the first register read access
    (reading the threshold parameter from register 0x00):

    edt_ft5x06 2-0038: crc error: 0xfc expected, got 0x40

    It ignores writes until then. This patch adds a dummy read after which
    the number of sensors and parameter read/writes work correctly.

    Signed-off-by: Philipp Zabel
    Signed-off-by: Marco Felsch
    Tested-by: Andy Shevchenko
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Philipp Zabel
     

20 Feb, 2020

3 commits

  • commit 5179a9dfa9440c1781816e2c9a183d1d2512dc61 upstream.

    The Yoga 11e is using LEN0049, but it doesn't have a trackstick.

    Thus, there is no need to create a software top buttons row.

    However, it seems that the device works under SMBus, so keep it as part
    of the smbus_pnp_ids.

    Signed-off-by: Benjamin Tissoires
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20200115013023.9710-1-benjamin.tissoires@redhat.com
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Benjamin Tissoires
     
  • commit b8a3d819f872e0a3a0a6db0dbbcd48071042fb98 upstream.

    Add touchpad LEN2044 to the list, as it is capable of working with
    psmouse.synaptics_intertouch=1

    Signed-off-by: Gaurav Agrawal
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/CADdtggVzVJq5gGNmFhKSz2MBwjTpdN5YVOdr4D3Hkkv=KZRc9g@mail.gmail.com
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Gaurav Agrawal
     
  • commit bf502391353b928e63096127e5fd8482080203f5 upstream.

    This supports RMI4 and everything seems to work, including the touchpad
    buttons. So, let's enable this by default.

    Signed-off-by: Lyude Paul
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20200204194322.112638-1-lyude@redhat.com
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Lyude Paul
     

06 Feb, 2020

2 commits

  • [ Upstream commit ce535a2efb48d8d4c4e4b97e2764d7cee73d9b55 ]

    We need the of_match table if we want to use the compatible string in
    the pmic's child node and get the onkey driver loaded automatically.

    Signed-off-by: Bartosz Golaszewski
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Bartosz Golaszewski
     
  • [ Upstream commit 7f439bc2d7e8c8cc4e1bab08ab7fe1bb73c9b268 ]

    We observed a large(order-3) allocation in evdev_open() and it may
    cause an OOM kernel panic in kzalloc(), before we getting to the
    vzalloc() fallback.

    Fix it by converting kzalloc()/vzalloc() to kvzalloc() to avoid the
    OOM killer logic as we have a vmalloc fallback.

    InputReader invoked oom-killer: gfp_mask=0x240c2c0
    (GFP_KERNEL|__GFP_NOWARN|__GFP_COMP|__GFP_ZERO), nodemask=0, order=3,
    oom_score_adj=-900
    ...
    (dump_backtrace) from (show_stack+0x18/0x1c)
    (show_stack) from (dump_stack+0x94/0xa8)
    (dump_stack) from (dump_header+0x7c/0xe4)
    (dump_header) from (out_of_memory+0x334/0x348)
    (out_of_memory) from (__alloc_pages_nodemask+0xe9c/0xeb8)
    (__alloc_pages_nodemask) from (kmalloc_order_trace+0x34/0x128)
    (kmalloc_order_trace) from (__kmalloc+0x258/0x36c)
    (__kmalloc) from (evdev_open+0x5c/0x17c)
    (evdev_open) from (chrdev_open+0x100/0x204)
    (chrdev_open) from (do_dentry_open+0x21c/0x354)
    (do_dentry_open) from (vfs_open+0x58/0x84)
    (vfs_open) from (path_openat+0x640/0xc98)
    (path_openat) from (do_filp_open+0x78/0x11c)
    (do_filp_open) from (do_sys_open+0x130/0x244)
    (do_sys_open) from (SyS_openat+0x14/0x18)
    (SyS_openat) from (__sys_trace_return+0x0/0x10)
    ...
    Normal: 12488*4kB (UMEH) 6984*8kB (UMEH) 2101*16kB (UMEH) 0*32kB
    0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 139440kB
    HighMem: 206*4kB (H) 131*8kB (H) 42*16kB (H) 2*32kB (H) 0*64kB
    0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 2608kB
    ...
    Kernel panic - not syncing: Out of memory and no killable processes...

    Signed-off-by: Miles Chen
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Miles Chen
     

29 Jan, 2020

8 commits

  • commit 97e24b095348a15ec08c476423c3b3b939186ad7 upstream.

    The driver misses a check for devm_thermal_zone_of_sensor_register().
    Add a check to fix it.

    Fixes: e28d0c9cd381 ("input: convert sun4i-ts to use devm_thermal_zone_of_sensor_register")
    Signed-off-by: Chuhong Yuan
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Chuhong Yuan
     
  • commit bcfcb7f9b480dd0be8f0df2df17340ca92a03b98 upstream.

    The driver was checking the number of endpoints of the first alternate
    setting instead of the current one, something which could be used by a
    malicious device (or USB descriptor fuzzer) to trigger a NULL-pointer
    dereference.

    Fixes: 1afca2b66aac ("Input: add Pegasus Notetaker tablet driver")
    Signed-off-by: Johan Hovold
    Acked-by: Martin Kepplinger
    Acked-by: Vladis Dronov
    Link: https://lore.kernel.org/r/20191210113737.4016-2-johan@kernel.org
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • commit 3111491fca4f01764e0c158c5e0f7ced808eef51 upstream.

    The driver was checking the number of endpoints of the first alternate
    setting instead of the current one, something which could lead to the
    driver binding to an invalid interface.

    This in turn could cause the driver to misbehave or trigger a WARN() in
    usb_submit_urb() that kernels with panic_on_warn set would choke on.

    Fixes: 8e20cf2bce12 ("Input: aiptek - fix crash on detecting device without endpoints")
    Signed-off-by: Johan Hovold
    Acked-by: Vladis Dronov
    Link: https://lore.kernel.org/r/20191210113737.4016-3-johan@kernel.org
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • commit a8eeb74df5a6bdb214b2b581b14782c5f5a0cf83 upstream.

    The driver was checking the number of endpoints of the first alternate
    setting instead of the current one, something which could lead to the
    driver binding to an invalid interface.

    This in turn could cause the driver to misbehave or trigger a WARN() in
    usb_submit_urb() that kernels with panic_on_warn set would choke on.

    Fixes: 162f98dea487 ("Input: gtco - fix crash on detecting device without endpoints")
    Signed-off-by: Johan Hovold
    Acked-by: Vladis Dronov
    Link: https://lore.kernel.org/r/20191210113737.4016-5-johan@kernel.org
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • commit 6b32391ed675827f8425a414abbc6fbd54ea54fe upstream.

    Make sure to use the current alternate setting when verifying the
    interface descriptors to avoid binding to an invalid interface.

    This in turn could cause the driver to misbehave or trigger a WARN() in
    usb_submit_urb() that kernels with panic_on_warn set would choke on.

    Fixes: bdb5c57f209c ("Input: add sur40 driver for Samsung SUR40 (aka MS Surface 2.0/Pixelsense)")
    Signed-off-by: Johan Hovold
    Acked-by: Vladis Dronov
    Link: https://lore.kernel.org/r/20191210113737.4016-8-johan@kernel.org
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • commit 996d5d5f89a558a3608a46e73ccd1b99f1b1d058 upstream.

    Setting the vibrator enable_mask is not implemented correctly:

    For regmap_update_bits(map, reg, mask, val) we give in either
    regs->enable_mask or 0 (= no-op) as mask and "val" as value.
    But "val" actually refers to the vibrator voltage control register,
    which has nothing to do with the enable_mask.

    So we usually end up doing nothing when we really wanted
    to enable the vibrator.

    We want to set or clear the enable_mask (to enable/disable the vibrator).
    Therefore, change the call to always modify the enable_mask
    and set the bits only if we want to enable the vibrator.

    Fixes: d4c7c5c96c92 ("Input: pm8xxx-vib - handle separate enable register")
    Signed-off-by: Stephan Gerhold
    Link: https://lore.kernel.org/r/20200114183442.45720-1-stephan@gerhold.net
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Stephan Gerhold
     
  • commit 8ff771f8c8d55d95f102cf88a970e541a8bd6bcf upstream.

    This reverts commit a284e11c371e446371675668d8c8120a27227339.

    This causes problems (drifting cursor) with at least the F11 function that
    reads more than 32 bytes.

    The real issue is in the F54 driver, and so this should be fixed there, and
    not in rmi_smbus.c.

    So first revert this bad commit, then fix the real problem in F54 in another
    patch.

    Signed-off-by: Hans Verkuil
    Reported-by: Timo Kaufmann
    Fixes: a284e11c371e ("Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers")
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20200115124819.3191024-2-hverkuil-cisco@xs4all.nl
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Hans Verkuil
     
  • commit ba9a103f40fc4a3ec7558ec9b0b97d4f92034249 upstream.

    The driver was issuing synchronous uninterruptible control requests
    without using a timeout. This could lead to the driver hanging on probe
    due to a malfunctioning (or malicious) device until the device is
    physically disconnected. While sleeping in probe the driver prevents
    other devices connected to the same hub from being added to (or removed
    from) the bus.

    The USB upper limit of five seconds per request should be more than
    enough.

    Fixes: 99f83c9c9ac9 ("[PATCH] USB: add driver for Keyspan Digital Remote")
    Signed-off-by: Johan Hovold
    Reviewed-by: Greg Kroah-Hartman
    Cc: stable # 2.6.13
    Link: https://lore.kernel.org/r/20200113171715.30621-1-johan@kernel.org
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     

15 Jan, 2020

2 commits

  • commit f729a1b0f8df7091cea3729fc0e414f5326e1163 upstream.

    Going through all uses of timeval, I noticed that we screwed up
    input_event in the previous attempts to fix it:

    The time fields now match between kernel and user space, but all following
    fields are in the wrong place.

    Add the required padding that is implied by the glibc timeval definition
    to fix the layout, and use a struct initializer to avoid leaking kernel
    stack data.

    Fixes: 141e5dcaa735 ("Input: input_event - fix the CONFIG_SPARC64 mixup")
    Fixes: 2e746942ebac ("Input: input_event - provide override for sparc64")
    Signed-off-by: Arnd Bergmann
    Link: https://lore.kernel.org/r/20191213204936.3643476-2-arnd@arndb.de
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit cb222aed03d798fc074be55e59d9a112338ee784 upstream.

    If we happen to have a garbage in input device's keycode table with values
    too big we'll end up doing clear_bit() with offset way outside of our
    bitmaps, damaging other objects within an input device or even outside of
    it. Let's add sanity checks to the returned old keycodes.

    Reported-by: syzbot+c769968809f9359b07aa@syzkaller.appspotmail.com
    Reported-by: syzbot+76f3a30e88d256644c78@syzkaller.appspotmail.com
    Link: https://lore.kernel.org/r/20191207212757.GA245964@dtor-ws
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Torokhov
     

05 Jan, 2020

3 commits

  • [ Upstream commit 43f06a4c639de8ee89fc348a9a3ecd70320a04dd ]

    input_mt_init_slots() may fail and we need to handle such failures.

    Tested-by: Adam Ford #imx6q-logicpd
    Tested-by: Sven Van Asbroeck # ILI2118A variant
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Dmitry Torokhov
     
  • [ Upstream commit efd7bb08a762d4f6322054c6824bd942971ac563 ]

    We should not be putting the chip into reset while interrupts are enabled
    and ISR may be running. Fix this by installing a custom devm action and
    powering off the device/resetting GPIO line from there. This ensures proper
    ordering.

    Tested-by: Matthias Fend
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Dmitry Torokhov
     
  • [ Upstream commit 463fa44eec2fef50d111ed0199cf593235065c04 ]

    Across suspend and resume, we are seeing error messages like the following:

    atmel_mxt_ts i2c-PRP0001:00: __mxt_read_reg: i2c transfer failed (-121)
    atmel_mxt_ts i2c-PRP0001:00: Failed to read T44 and T5 (-121)

    This occurs because the driver leaves its IRQ enabled. Upon resume, there
    is an IRQ pending, but the interrupt is serviced before both the driver and
    the underlying I2C bus have been resumed. This causes EREMOTEIO errors.

    Disable the IRQ in suspend, and re-enable it on resume. If there are cases
    where the driver enters suspend with interrupts disabled, that's a bug we
    should fix separately.

    Signed-off-by: Evan Green
    Signed-off-by: Dmitry Torokhov
    Signed-off-by: Sasha Levin

    Evan Green