All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH 4/4] Input: ensure device is ready before delivering events
Date: Wed, 24 Jun 2026 06:02:43 +0000	[thread overview]
Message-ID: <20260624060243.96D3C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260624055008.2494980-4-dmitry.torokhov@gmail.com>

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 <dmitry.torokhov@gmail.com>

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.

> 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

[ ... ]

> @@ -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

  reply	other threads:[~2026-06-24  6:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-24  5:50 [PATCH 1/4] Input: fix poller start order on uninhibit Dmitry Torokhov
2026-06-24  5:50 ` [PATCH 2/4] Input: call handler->start() when uninhibiting device Dmitry Torokhov
2026-06-24  5:50 ` [PATCH 3/4] Input: defer handler's start() until device is opened Dmitry Torokhov
2026-06-24  5:50 ` [PATCH 4/4] Input: ensure device is ready before delivering events Dmitry Torokhov
2026-06-24  6:02   ` sashiko-bot [this message]
2026-06-24  6:00 ` [PATCH 1/4] Input: fix poller start order on uninhibit sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260624060243.96D3C1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.