linux-stable/drivers/input
Marek Szyprowski a5fc298fa8 Input: cyapa - add missing input core locking to suspend/resume functions
[ Upstream commit 7b4e0b3918 ]

Grab input->mutex during suspend/resume functions like it is done in
other input drivers. This fixes the following warning during system
suspend/resume cycle on Samsung Exynos5250-based Snow Chromebook:

------------[ cut here ]------------
WARNING: CPU: 1 PID: 1680 at drivers/input/input.c:2291 input_device_enabled+0x68/0x6c
Modules linked in: ...
CPU: 1 PID: 1680 Comm: kworker/u4:12 Tainted: G        W          6.6.0-rc5-next-20231009 #14109
Hardware name: Samsung Exynos (Flattened Device Tree)
Workqueue: events_unbound async_run_entry_fn
 unwind_backtrace from show_stack+0x10/0x14
 show_stack from dump_stack_lvl+0x58/0x70
 dump_stack_lvl from __warn+0x1a8/0x1cc
 __warn from warn_slowpath_fmt+0x18c/0x1b4
 warn_slowpath_fmt from input_device_enabled+0x68/0x6c
 input_device_enabled from cyapa_gen3_set_power_mode+0x13c/0x1dc
 cyapa_gen3_set_power_mode from cyapa_reinitialize+0x10c/0x15c
 cyapa_reinitialize from cyapa_resume+0x48/0x98
 cyapa_resume from dpm_run_callback+0x90/0x298
 dpm_run_callback from device_resume+0xb4/0x258
 device_resume from async_resume+0x20/0x64
 async_resume from async_run_entry_fn+0x40/0x15c
 async_run_entry_fn from process_scheduled_works+0xbc/0x6a8
 process_scheduled_works from worker_thread+0x188/0x454
 worker_thread from kthread+0x108/0x140
 kthread from ret_from_fork+0x14/0x28
Exception stack(0xf1625fb0 to 0xf1625ff8)
...
---[ end trace 0000000000000000 ]---
...
------------[ cut here ]------------
WARNING: CPU: 1 PID: 1680 at drivers/input/input.c:2291 input_device_enabled+0x68/0x6c
Modules linked in: ...
CPU: 1 PID: 1680 Comm: kworker/u4:12 Tainted: G        W          6.6.0-rc5-next-20231009 #14109
Hardware name: Samsung Exynos (Flattened Device Tree)
Workqueue: events_unbound async_run_entry_fn
 unwind_backtrace from show_stack+0x10/0x14
 show_stack from dump_stack_lvl+0x58/0x70
 dump_stack_lvl from __warn+0x1a8/0x1cc
 __warn from warn_slowpath_fmt+0x18c/0x1b4
 warn_slowpath_fmt from input_device_enabled+0x68/0x6c
 input_device_enabled from cyapa_gen3_set_power_mode+0x13c/0x1dc
 cyapa_gen3_set_power_mode from cyapa_reinitialize+0x10c/0x15c
 cyapa_reinitialize from cyapa_resume+0x48/0x98
 cyapa_resume from dpm_run_callback+0x90/0x298
 dpm_run_callback from device_resume+0xb4/0x258
 device_resume from async_resume+0x20/0x64
 async_resume from async_run_entry_fn+0x40/0x15c
 async_run_entry_fn from process_scheduled_works+0xbc/0x6a8
 process_scheduled_works from worker_thread+0x188/0x454
 worker_thread from kthread+0x108/0x140
 kthread from ret_from_fork+0x14/0x28
Exception stack(0xf1625fb0 to 0xf1625ff8)
...
---[ end trace 0000000000000000 ]---

Fixes: d69f0a43c6 ("Input: use input_device_enabled()")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Link: https://lore.kernel.org/r/20231009121018.1075318-1-m.szyprowski@samsung.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:39:31 +02:00
..
gameport Input: gameport - make gameport_bus const 2024-02-06 13:57:02 -08:00
joystick Input updates for v6.9-rc6 2024-05-05 10:00:47 -07:00
keyboard TTY/Serial driver update for 6.9-rc1 2024-03-21 12:44:10 -07:00
misc Input: pm8xxx-vibrator - correct VIB_MAX_LEVELS calculation 2024-06-12 11:39:27 +02:00
mouse Input: cyapa - add missing input core locking to suspend/resume functions 2024-06-12 11:39:31 +02:00
rmi4 Input updates for v6.9-rc0 2024-03-17 11:50:54 -07:00
serio Input: ioc3kbd - add device table 2024-06-12 11:39:26 +02:00
tablet Input: pegasus-notetaker - check pipe type when probing 2023-04-09 19:19:14 -07:00
tests Input: tests - add test to cover all input_grab_device() function 2023-05-23 14:50:28 -07:00
touchscreen Input updates for v6.9-rc0 2024-03-17 11:50:54 -07:00
Kconfig Input: tests - modular KUnit tests should not depend on KUNIT=y 2023-05-02 10:39:00 -07:00
Makefile Input: Add KUnit tests for some of the input core helper functions 2023-04-01 22:47:04 -07:00
apm-power.c
evbug.c
evdev.c Input: evdev - annotate struct evdev_client with __counted_by 2023-09-30 09:24:16 -07:00
ff-core.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00
ff-memless.c input: drop empty comment blocks 2022-09-29 16:25:42 -07:00
input-compat.c
input-compat.h
input-core-private.h Input: deactivate MT slots when inhibiting or suspending devices 2022-07-20 11:35:13 -07:00
input-leds.c Input: leds - change config symbol dependency for audio mute trigger 2024-03-03 14:46:06 -08:00
input-mt.c Input: deactivate MT slots when inhibiting or suspending devices 2022-07-20 11:35:13 -07:00
input-poller.c
input-poller.h
input.c Input: try trimming too long modalias strings 2024-05-30 09:43:59 +02:00
joydev.c Input: joydev - fix comment typo 2022-09-25 00:57:25 -07:00
matrix-keymap.c
mousedev.c
sparse-keymap.c
touchscreen.c
vivaldi-fmap.c Input: vivaldi - convert to use sysfs_emit_at() API 2023-12-13 21:26:12 -08:00