From: sashiko-bot@kernel.org
To: joy.zou@oss.nxp.com
Cc: imx@lists.linux.dev, dmitry.torokhov@gmail.com,
linux-input@vger.kernel.org, Frank.Li@kernel.org
Subject: Re: [PATCH v5 4/4] Input: snvs_pwrkey - add press event reporting to avoid event loss during suspend
Date: Wed, 15 Jul 2026 09:46:00 +0000 [thread overview]
Message-ID: <20260715094601.619EB1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260715-b4-pwrkey-v5-4-07e7353c319e@oss.nxp.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Missing cleanup for wake IRQ leads to memory leak and device re-bind failure.
--
--- Patch [4]: [PATCH v5 4/4] Input: snvs_pwrkey - add press event reporting to avoid event loss during suspend ---
commit 0a87e611a13956d492552759681ef44d587017b8
Author: Joy Zou <joy.zou@nxp.com>
Input: snvs_pwrkey - add press event reporting to avoid event loss during suspend
This commit introduces a pending_press flag and a spinlock to handle power
key events during system resume phases where IRQs might be disabled. It
ensures that if the key is released before IRQs are re-enabled, a press
event is still reported via the timer callback.
> diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c
> --- a/drivers/input/keyboard/snvs_pwrkey.c
> +++ b/drivers/input/keyboard/snvs_pwrkey.c
[ ... ]
> @@ -217,6 +254,32 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
> return 0;
> }
[Severity: High]
This is a pre-existing issue, but I noticed the wake IRQ setup just prior to
this return in imx_snvs_pwrkey_probe() lacks a cleanup path:
error = dev_pm_set_wake_irq(dev, pdata->irq);
Since there is no .remove callback or manual cleanup, does this leak the
struct wake_irq memory when the device is unbound?
Additionally, since dev->power.wakeirq is never cleared, would re-binding
the driver trigger the dev_WARN_ONCE ("wake irq already initialized") in
dev_pm_attach_wake_irq(), potentially causing a system panic if
panic_on_warn is enabled?
Could this be resolved by switching to the managed devm_pm_set_wake_irq()
helper?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260715-b4-pwrkey-v5-0-07e7353c319e@oss.nxp.com?part=4
prev parent reply other threads:[~2026-07-15 9:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 9:33 [PATCH v5 0/4] snvs_pwrkey - code improvements and add report event joy.zou
2026-07-15 9:33 ` [PATCH v5 1/4] Input: snvs_pwrkey - make use of dev_err_probe() joy.zou
2026-07-15 9:33 ` [PATCH v5 2/4] Input: snvs_pwrkey - propagate error code of platform_get_irq() joy.zou
2026-07-15 9:42 ` sashiko-bot
2026-07-15 9:33 ` [PATCH v5 3/4] Input: snvs_pwrkey - use local device pointer to simple code joy.zou
2026-07-15 9:38 ` sashiko-bot
2026-07-15 9:33 ` [PATCH v5 4/4] Input: snvs_pwrkey - add press event reporting to avoid event loss during suspend joy.zou
2026-07-15 9:46 ` sashiko-bot [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=20260715094601.619EB1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=imx@lists.linux.dev \
--cc=joy.zou@oss.nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox