All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Chang Yu" <marcus.yu.56@gmail.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v5 2/2] iio: light: add AS7343 multi-spectral sensor driver
Date: Sun, 20 Sep 2026 00:04:21 +0000	[thread overview]
Message-ID: <20260920000421.D9A411F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260919235145.48273-3-marcus.yu.56@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] pm: missing PM runtime idle request prevents initial autosuspend
--

commit 87cfb69de7e4c2b750859f6540e61d6d9aef5dcd
Author: Chang Yu <marcus.yu.56@gmail.com>

iio: light: add AS7343 multi-spectral sensor driver

Add a driver for the AMS AS7343 14-channel multi-spectral sensor.
The driver exposes 12 spectral channels via sysfs and implements runtime
PM to manage device power during measurements.

> diff --git a/drivers/iio/light/as7343.c b/drivers/iio/light/as7343.c
> new file mode 100644
> index 0000000000000..c079e0c6aa704
> --- /dev/null
> +++ b/drivers/iio/light/as7343.c
[ ... ]
> +static int as7343_probe(struct i2c_client *client)
> +{
[ ... ]
> +	pm_runtime_set_autosuspend_delay(dev, 3000);
> +	pm_runtime_use_autosuspend(dev);
> +
> +	ret = devm_add_action_or_reset(dev, as7343_suspend_action, dev);
> +	if (ret)
> +		return dev_err_probe(dev, ret,
> +				     "Failed to add suspend action\n");
> +
> +	ret = devm_pm_runtime_set_active_enabled(dev);

[Severity: Medium]
Does enabling PM runtime here without a subsequent idle check (or without
calling pm_runtime_use_autosuspend afterwards) leave the device perpetually
active?

Since pm_runtime_use_autosuspend(dev) is called earlier, the device's
disable_depth is still greater than 0 at that point. This causes the internal
idle check to fail with -EACCES, preventing the autosuspend timer from
being queued.

When devm_pm_runtime_set_active_enabled() later enables PM runtime, it does
not implicitly trigger an idle check. This might strand the device in the
active state until user space initiates a read to kick off a get and
put_autosuspend cycle.

> +	if (ret)
> +		return dev_err_probe(dev, ret,
> +				     "Failed to activate PM runtime\n");
> +
> +	return devm_iio_device_register(dev, indio_dev);
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260919235145.48273-1-marcus.yu.56@gmail.com?part=2

  reply	other threads:[~2026-09-20  0:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19 23:51 [PATCH v5 0/2] Add support for AS7343 multi-spectral sensor Chang Yu
2026-09-19 23:51 ` [PATCH v5 1/2] dt-bindings: iio: light: add as7343 Chang Yu
2026-09-20  0:26   ` Jonathan Cameron
2026-09-19 23:51 ` [PATCH v5 2/2] iio: light: add AS7343 multi-spectral sensor driver Chang Yu
2026-09-20  0:04   ` sashiko-bot [this message]
2026-09-20  0:26   ` Jonathan Cameron
2026-09-21  4:21     ` Chang Yu
2026-09-24 18:22   ` Andy Shevchenko
2026-10-10  8:35     ` Chang Yu
2026-10-11  3:12     ` Chang Yu
2026-09-24 22:02   ` Jose A. Perez de Azpillaga
2026-09-25  0:52     ` Chang Yu

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=20260920000421.D9A411F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=marcus.yu.56@gmail.com \
    --cc=robh@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.