Skip to content

Commit 870c2e7

Browse files
ii4gspdtor
authored andcommitted
Input: synaptics_i2c - guard polling restart in resume
synaptics_i2c_resume() restarts delayed work unconditionally, even when the input device is not opened. Guard the polling restart by taking the input device mutex and checking input_device_enabled() before re-queuing the delayed work. Fixes: eef3e4c ("Input: add driver for Synaptics I2C touchpad") Signed-off-by: Minseong Kim <ii4gsp@gmail.com> Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260121063738.799967-1-ii4gsp@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 219be8d commit 870c2e7

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/input/mouse/synaptics_i2c.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,13 +615,16 @@ static int synaptics_i2c_resume(struct device *dev)
615615
int ret;
616616
struct i2c_client *client = to_i2c_client(dev);
617617
struct synaptics_i2c *touch = i2c_get_clientdata(client);
618+
struct input_dev *input = touch->input;
618619

619620
ret = synaptics_i2c_reset_config(client);
620621
if (ret)
621622
return ret;
622623

623-
mod_delayed_work(system_dfl_wq, &touch->dwork,
624-
msecs_to_jiffies(NO_DATA_SLEEP_MSECS));
624+
guard(mutex)(&input->mutex);
625+
if (input_device_enabled(input))
626+
mod_delayed_work(system_dfl_wq, &touch->dwork,
627+
msecs_to_jiffies(NO_DATA_SLEEP_MSECS));
625628

626629
return 0;
627630
}

0 commit comments

Comments
 (0)