Thread (6 messages) 6 messages, 2 authors, 2026-06-24

Re: [PATCH 4/4] Input: ensure device is ready before delivering events

From: sashiko-bot@kernel.org
Date: 2026-06-24 06:02:43

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing physical feedback teardown in input_close_device causes LEDs/sounds to remain stuck ON indefinitely.
--

commit 75d930ba0fffcfc837221baa51848c81d0ba0c9e
Author: Dmitry Torokhov [off-list ref]

Input: ensure device is ready before delivering events

This commit introduces a ready flag in the input_dev structure to prevent
events from being delivered to the hardware before the driver's open() method
successfully completes. It ensures logical state is replayed upon opening,
and synchronizes physical feedback teardown during inhibition.
quoted hunk ↗ jump to hunk
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 0a95cbdc467ed..724cc146fc093 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -661,6 +708,10 @@ void input_close_device(struct input_handle *handle)
 		if (!--dev->users && !dev->inhibited) {
 			if (dev->poller)
 				input_dev_poller_stop(dev->poller);
+
+			scoped_guard(spinlock_irq, &dev->event_lock)
+				dev->ready = false;
[Severity: Medium]
Will this leave LEDs and sounds permanently stuck on when a device is closed?

In input_inhibit_device(), there is a call to input_dev_toggle(dev, false)
right before setting dev->ready to false.

However, in input_close_device(), dev->ready is cleared without first
toggling the state off.

Since the suspend and poweroff handlers rely on dev->ready to issue events,
could omitting input_dev_toggle() here prevent them from turning off physical
feedback, resulting in a persistent power drain?
+
 			if (dev->close)
 				dev->close(dev);
 		}
-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260624055008.2494980-1-dmitry.torokhov@gmail.com?part=4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help