From: sashiko-bot@kernel.org
To: "Sanjay Chitroda" <sanjayembeddedse@gmail.com>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org
Subject: Re: [PATCH 01/11] iio: hid-sensors: add missing blank line after declarations
Date: Tue, 16 Jun 2026 11:22:06 +0000 [thread overview]
Message-ID: <20260616112206.F2BE81F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260616-15-jun-hid-iio-alignment-v1-1-0cd544286575@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but pending asynchronous suspend work is cancelled during device removal, leaving hardware powered on indefinitely.
--
commit fb90a2bc06515600f67795b51872db81c06e23a2
Author: Sanjay Chitroda <sanjayembeddedse@gmail.com>
iio: hid-sensors: add missing blank line after declarations
Add a blank line after variable declarations to improve
readability and align with kernel coding style.
> diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> index 417c4ab8c1b27..c8ccf96f3d035 100644
> --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
> @@ -314,7 +314,9 @@ static int __maybe_unused hid_sensor_resume(struct device *dev)
> {
> struct iio_dev *indio_dev = dev_get_drvdata(dev);
> struct hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev);
> +
> schedule_work(&attrb->work);
> +
> return 0;
> }
[Severity: High]
This is a pre-existing issue, but I noticed a potential problem where
pending asynchronous suspend work might be cancelled during device removal,
leaving the hardware powered on indefinitely.
During driver removal, iio_device_unregister() disables active iio buffers,
triggering buffer_predisable(). This calls hid_sensor_power_state() with
state false, which queues an asynchronous suspend:
hid_sensor_power_state() {
...
} else {
atomic_dec(&st->user_requested_state);
pm_runtime_use_autosuspend(&st->pdev->dev);
ret = pm_runtime_put_autosuspend(&st->pdev->dev);
}
...
}
Immediately after, hid_sensor_remove_trigger() is called:
hid_sensor_remove_trigger() {
if (atomic_read(&attrb->runtime_pm_enable))
pm_runtime_disable(&attrb->pdev->dev);
pm_runtime_set_suspended(&attrb->pdev->dev);
...
}
Because pm_runtime_disable() cancels any pending asynchronous idle/suspend
work, is it possible the autosuspend work gets cancelled before execution?
If the work is cancelled, pm_runtime_set_suspended() would only update the
software pm state, leaving the actual physical hardware permanently powered
on. Does the driver need a synchronous suspend in the removal path before
disabling runtime pm?
>
> @@ -322,6 +324,7 @@ static int __maybe_unused hid_sensor_runtime_resume(struct device *dev)
> {
> struct iio_dev *indio_dev = dev_get_drvdata(dev);
> struct hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev);
> +
> return _hid_sensor_power_state(attrb, true);
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260616-15-jun-hid-iio-alignment-v1-0-0cd544286575@gmail.com?part=1
next prev parent reply other threads:[~2026-06-16 11:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 10:26 [PATCH 00/11] HID: iio: warning clean up and prefer kernel coding style Sanjay Chitroda
2026-06-16 10:26 ` [PATCH 01/11] iio: hid-sensors: add missing blank line after declarations Sanjay Chitroda
2026-06-16 11:22 ` sashiko-bot [this message]
2026-06-16 10:26 ` [PATCH 02/11] iio: humidity: hid-sensor-humidity: align parenthesis for readability Sanjay Chitroda
2026-06-16 10:57 ` Andy Shevchenko
2026-06-16 11:22 ` sashiko-bot
2026-06-16 10:26 ` [PATCH 03/11] iio: gyro: hid-sensor-gyro-3d: " Sanjay Chitroda
2026-06-16 10:56 ` Andy Shevchenko
2026-06-16 10:26 ` [PATCH 04/11] iio: magnetometer: hid-sensor-magn-3d: " Sanjay Chitroda
2026-06-16 11:19 ` sashiko-bot
2026-06-16 10:26 ` [PATCH 05/11] iio: humidity: hid-sensor-humidity: use common device for devres Sanjay Chitroda
2026-06-16 11:27 ` sashiko-bot
2026-06-16 10:26 ` [PATCH 06/11] iio: position: hid-sensor-custom-intel-hinge: " Sanjay Chitroda
2026-06-16 10:26 ` [PATCH 07/11] iio: temperature: hid-sensor-temperature: " Sanjay Chitroda
2026-06-16 11:27 ` sashiko-bot
2026-06-16 10:26 ` [PATCH 08/11] iio: hid-sensor-magn-3d: use ! instead of explicit NULL check Sanjay Chitroda
2026-06-16 11:01 ` Joshua Crofts
2026-06-16 10:26 ` [PATCH 09/11] iio: hid-sensor-rotation: " Sanjay Chitroda
2026-06-16 10:26 ` [PATCH 10/11] iio: hid-sensor-incl-3d: " Sanjay Chitroda
2026-06-16 11:11 ` [PATCH 11/11] iio: hid-sensor-accel-3d: " Sanjay Chitroda
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=20260616112206.F2BE81F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=sanjayembeddedse@gmail.com \
--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.