From: sashiko-bot@kernel.org
To: "Herve Codina" <herve.codina@bootlin.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v8 1/2] bus: simple-pm-bus: Remove child devices when the bus is unbound
Date: Tue, 30 Jun 2026 10:46:20 +0000 [thread overview]
Message-ID: <20260630104621.A2F971F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260630102717.413501-2-herve.codina@bootlin.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The bus device is left in the RPM_ACTIVE state with its clocks permanently enabled upon removal, as `pm_runtime_disable()` cancels the asynchronous idle request triggered by child device removal.
--
commit db0675ba90c5bdf94a4790c06b36a7b5f8dff5e4
Author: Herve Codina <herve.codina@bootlin.com>
bus: simple-pm-bus: Remove child devices when the bus is unbound
During probe, the simple-pm-bus driver populates child devices but does not
remove them during its removal. This commit explicitly depopulates child
devices when the bus is unbound to keep the device state consistent.
> --- a/drivers/bus/simple-pm-bus.c
> +++ b/drivers/bus/simple-pm-bus.c
> @@ -83,6 +83,9 @@ static void simple_pm_bus_remove(struct platform_device *pdev)
>
> dev_dbg(&pdev->dev, "%s\n", __func__);
>
> + if (pdev->dev.of_node)
> + of_platform_depopulate(&pdev->dev);
> +
> pm_runtime_disable(&pdev->dev);
[Severity: High]
Will this sequence leave the bus device active and leak clock enable counts?
When of_platform_depopulate() removes the child devices, the parent bus
device's child_count drops to zero, triggering an asynchronous
pm_request_idle() on the parent.
Because pm_runtime_disable() is called immediately afterwards, it will invoke
__pm_runtime_barrier() and synchronously cancel any pending asynchronous PM
requests.
If the idle request is cancelled before it executes, does the bus bypass
simple_pm_bus_runtime_suspend() and remain in the RPM_ACTIVE state with its
clocks permanently enabled? When devres later frees the clock structures via
clk_bulk_put_all(), would the active clock enable counts be leaked, causing
a warning? Should there be a synchronous runtime PM put or suspend operation
before disabling runtime PM?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260630102717.413501-1-herve.codina@bootlin.com?part=1
next prev parent reply other threads:[~2026-06-30 10:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-30 10:27 [PATCH v8 0/2] lan966x pci device: Add support for SFPs, simple-bus part Herve Codina
2026-06-30 10:27 ` [PATCH v8 1/2] bus: simple-pm-bus: Remove child devices when the bus is unbound Herve Codina
2026-06-30 10:46 ` sashiko-bot [this message]
2026-06-30 10:27 ` [PATCH v8 2/2] bus: simple-pm-bus: Populate child nodes at probe Herve Codina
2026-06-30 10:57 ` 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=20260630104621.A2F971F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=herve.codina@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox