All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Wentao Liang <vulab@iscas.ac.cn>
Cc: dudl@cypress.com, linux-input@vger.kernel.org,
	 linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2] Input: cyapa - fix runtime PM leak in cyapa_update_rt_suspend_scanrate()
Date: Sun, 8 Nov 2026 23:24:27 -0800	[thread overview]
Message-ID: <avF1HqGfA-82_Q46@google.com> (raw)
In-Reply-To: <1794120347.2701234.vulab@iscas.ac.cn>

On Sun, Nov 08, 2026 at 06:45:47AM +0000, Wentao Liang wrote:
> Hi Dmitry,
> 
> Sorry for the very late reply.
> 
> It does not have to be the "sync" variant.  I used
> pm_runtime_put_sync_autosuspend() only to mirror the normal flow of the
> same function and the other runtime PM call sites in cyapa.c, but there
> is nothing on this path that needs a synchronous transition: no device
> state has been changed yet, both put variants mark the device busy
> first, and cyapa_start_runtime() sets a 2 s autosuspend delay, so either
> of them would only arm the autosuspend timer before the store returns.
> v2 uses pm_runtime_put_autosuspend(), the counterpart of
> pm_runtime_get_sync() for devices that use autosuspend.
> 
> For the record on how the patch was produced: the candidate came from
> static analysis tooling, and DeepSeek and GPT-6.1 Sol were used to audit
> it and to help write the change.  I reviewed the result and I am
> responsible for it.  v2 is build-tested only: it compiles cleanly on
> x86-64 with CONFIG_MOUSE_CYAPA=y, including W=1, and passes checkpatch.
> I have no Cypress trackpad to test it on.
> 
> Thanks,
> Wentao
> 
> From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
> From: Wentao Liang <vulab@iscas.ac.cn>
> Date: Sun, 8 Nov 2026 06:45:47 +0000
> Subject: [PATCH v2] Input: cyapa - fix runtime PM leak in cyapa_update_rt_suspend_scanrate()
> 
> pm_runtime_get_sync() unconditionally increments the runtime PM usage
> counter. If mutex_lock_interruptible() is interrupted, the function
> returns without dropping that reference, so the usage count stays
> elevated for as long as the driver is bound and the device can no longer
> be autosuspended. Drop the reference on the error path.
> 
> Use pm_runtime_put_autosuspend() rather than the synchronous variant
> there: nothing has been done to the device on this path, so there is
> nothing to wait for, and with the 2 s autosuspend delay the driver
> configures the put only arms the autosuspend timer instead of suspending
> the device.
> 
> Fixes: 672865080a8f ("Input: cyapa - add runtime power management support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>

Applied, thank you.

-- 
Dmitry

      reply	other threads:[~2026-11-09  7:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 18:50 [PATCH] Input: cyapa - fix runtime PM leak in cyapa_update_rt_suspend_scanrate() Wentao Liang
2026-09-17 15:15 ` Dmitry Torokhov
2026-11-08  6:45   ` [PATCH v2] " Wentao Liang
2026-11-09  7:24     ` Dmitry Torokhov [this message]

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=avF1HqGfA-82_Q46@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=dudl@cypress.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=vulab@iscas.ac.cn \
    /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.