Commit 870c2e7c authored by Minseong Kim's avatar Minseong Kim Committed by Dmitry Torokhov
Browse files

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: eef3e4ca ("Input: add driver for Synaptics I2C touchpad")
Signed-off-by: default avatarMinseong Kim <ii4gsp@gmail.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260121063738.799967-1-ii4gsp@gmail.com


Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 219be8d9
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -615,11 +615,14 @@ static int synaptics_i2c_resume(struct device *dev)
	int ret;
	struct i2c_client *client = to_i2c_client(dev);
	struct synaptics_i2c *touch = i2c_get_clientdata(client);
	struct input_dev *input = touch->input;

	ret = synaptics_i2c_reset_config(client);
	if (ret)
		return ret;

	guard(mutex)(&input->mutex);
	if (input_device_enabled(input))
		mod_delayed_work(system_dfl_wq, &touch->dwork,
				 msecs_to_jiffies(NO_DATA_SLEEP_MSECS));