From: sashiko-bot@kernel.org
To: "Alex Elder" <elder@riscstar.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] reset: toshiba: introduce a TC9564 SoC reset driver
Date: Mon, 12 Oct 2026 16:54:46 +0000 [thread overview]
Message-ID: <sashiko-outbox-168439@kernel.org> (raw)
In-Reply-To: <20261012164354.3872326-3-elder@riscstar.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] reset: tc9564: hardware state initialized after reset controller registration
- [High] reset: tc9564: active consumers forcibly reset during driver removal
--
commit 504236856b96e78b9064b4d58c3ef7ba166341e3
Author: Alex Elder <elder@riscstar.com>
reset: toshiba: introduce a TC9564 SoC reset driver
Defines a new platform driver that manages reset signals implemented by the
Toshiba TC9564 SoC. The state of the resets is controlled via MMIO to a
region managed by a system controller.
> diff --git a/drivers/reset/reset-tc9564.c b/drivers/reset/reset-tc9564.c
> new file mode 100644
> index 0000000000000..0243c2e0efd54
> --- /dev/null
> +++ b/drivers/reset/reset-tc9564.c
[ ... ]
> +static int tc9564_reset_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct tc9564_resets *resets;
> +
> + if (!dev_of_node(dev))
> + return dev_err_probe(dev, -EINVAL, "no devicetree node\n");
> +
> + resets = tc9564_reset_init(dev);
> + if (IS_ERR(resets))
> + return dev_err_probe(dev, PTR_ERR(resets),
> + "failed to initialize resets\n");
> +
> + /* Force all resets to be initially asserted */
> + tc9564_reset_assert_all(resets);
[Severity: High]
Does this cause a race condition with consumer drivers?
tc9564_reset_init() globally registers the reset controller via
devm_reset_controller_register(). Once registered, consumers can
immediately probe and deassert their reset lines.
If a consumer driver deasserts its reset right after registration,
will this subsequent call to tc9564_reset_assert_all() overwrite the
consumer's hardware state and unexpectedly yank running hardware back
into reset?
> +
> + platform_set_drvdata(pdev, resets);
> +
> + return 0;
> +}
> +
> +static void tc9564_reset_remove(struct platform_device *pdev)
> +{
> + struct tc9564_resets *resets = platform_get_drvdata(pdev);
> +
> + /* Leave all resets asserted when done */
> + tc9564_reset_assert_all(resets);
[Severity: High]
Does this unexpectedly assert resets for active consumers?
Since the reset controller is registered using devm_reset_controller_register(),
the devres subsystem will unregister the controller only after this remove
callback completes.
This means the controller is still active and consumers might be actively
using their deasserted reset lines when tc9564_reset_assert_all() is called
here. Should the driver coordinate with consumers or unregister itself first
before forcing all lines into reset?
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261012164354.3872326-1-elder@riscstar.com?part=2
next prev parent reply other threads:[~2026-10-12 16:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 16:43 [PATCH 0/2] reset: introduce TC9564 reset support Alex Elder
2026-10-12 16:43 ` [PATCH 1/2] dt-bindings: reset: introduce toshiba,tc9564-reset.yaml Alex Elder
2026-10-12 16:48 ` sashiko-bot
2026-10-12 17:01 ` Alex Elder
2026-10-12 18:51 ` Conor Dooley
2026-10-12 19:10 ` Alex Elder
2026-10-12 21:22 ` Conor Dooley
2026-10-13 13:22 ` Alex Elder
2026-10-13 17:51 ` Conor Dooley
2026-10-13 9:25 ` Krzysztof Kozlowski
2026-10-12 16:43 ` [PATCH 2/2] reset: toshiba: introduce a TC9564 SoC reset driver Alex Elder
2026-10-12 16:54 ` sashiko-bot [this message]
2026-10-12 17:01 ` Alex Elder
2026-10-13 13:28 ` Philipp Zabel
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=sashiko-outbox-168439@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=elder@riscstar.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.