Re: [PATCH 1/4] Input: fix poller start order on uninhibit
From: sashiko-bot@kernel.org
Date: 2026-06-24 06:00:35
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: Pre-existing issues: - [High] Initial events from `dev->open()` are dropped during device uninhibit -- commit f4fc68b8f579c449b7f9056431e51975c324c92e Author: Dmitry Torokhov [off-list ref] Input: fix poller start order on uninhibit This commit resolves an issue where initial events generated by the poller are dropped during a device uninhibit operation. It defers starting the poller until after the device is fully marked as uninhibited.
quoted hunk ↗ jump to hunk
diff --git a/drivers/input/input.c b/drivers/input/input.c index cf6fecea79b82..d99dfe69e12d8 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c@@ -1793,8 +1793,6 @@ static int input_uninhibit_device(struct input_dev *dev) if (error) return error; }
[Severity: High]
This isn't a bug introduced by this patch, but it appears the exact same
logic flaw exists for dev->open() which is called just above this snippet
in input_uninhibit_device():
if (dev->open) {
error = dev->open(dev);
if (error)
return error;
}
Since dev->inhibited is still true when dev->open() is called, if a driver
generates initial synchronous events during its open routine (for example,
gpio_keys_report_state() called by gpio_keys_open()), won't those events
also be silently filtered out by input_get_disposition() returning
INPUT_IGNORE_EVENT?
Since this patch addresses this state mismatch for the poller, should the
dev->open() call also be deferred until after dev->inhibited is set to false?
quoted hunk ↗ jump to hunk
- if (dev->poller) - input_dev_poller_start(dev->poller); } dev->inhibited = false;@@ -1802,6 +1800,9 @@ static int input_uninhibit_device(struct input_dev *dev) scoped_guard(spinlock_irq, &dev->event_lock) input_dev_toggle(dev, true); + if (dev->users && dev->poller) + input_dev_poller_start(dev->poller); + return 0; }
-- Sashiko AI review · https://sashiko.dev/#/patchset/20260624055008.2494980-1-dmitry.torokhov@gmail.com?part=1