From: sashiko-bot@kernel.org
To: "Marek Vasut" <marek.vasut+renesas@mailbox.org>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org,
linux-pci@vger.kernel.org, wsa+renesas@sang-engineering.com,
robh@kernel.org
Subject: Re: [PATCH 6/6] arm64: dts: renesas: r8a779h0: Add PCIe Application/Local register reset
Date: Thu, 03 Sep 2026 21:04:05 +0000 [thread overview]
Message-ID: <20260903210406.20CF91F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260903205153.283553-6-marek.vasut+renesas@mailbox.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The PCIe CORE_RST handling introduced in this series (commit "PCI: rcar-gen4: Add Application/Local register reset control") ignores the return value of `reset_control_deassert()` and fails to explicitly assert the reset before deasserting it. This violates mandatory API error-handling and fails to guarantee the state transition (toggle) required to properly reset the hardware.
--
commit 3d2b0c33735de6a173b91f3402a1d145ece0119d
Author: Marek Vasut <marek.vasut+renesas@mailbox.org>
PCI: rcar-gen4: Add Application/Local register reset control
This commit adds support for the core reset (Application/Local register
reset) in the R-Car Gen4 PCIe controller. It asserts the core reset on
shutdown or error, and deasserts it during initialization. This is
intended to fix a reinitialization failure where unbinding and rebinding
the driver fails to access the controller DBI.
> diff --git a/drivers/pci/controller/dwc/pcie-rcar-gen4.c b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> index fbe465a29068f..0c760041aacc0 100644
> --- a/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> +++ b/drivers/pci/controller/dwc/pcie-rcar-gen4.c
> @@ -197,6 +197,8 @@ static int rcar_gen4_pcie_common_init(struct rcar_gen4_pcie *rcar)
> return ret;
> }
>
> + reset_control_deassert(dw->core_rsts[DW_PCIE_CORE_RST].rstc);
> +
[Severity: High]
Looking at rcar_gen4_pcie_common_init() in
drivers/pci/controller/dwc/pcie-rcar-gen4.c, does this code need to check
the return value of reset_control_deassert()?
If the core reset fails to deassert, subsequent register accesses (such as
readl(rcar->base + PCIEMSR0)) can cause a synchronous external abort,
crashing the system.
Also, should this explicitly assert the reset before deasserting it to
ensure a proper state toggle?
If the bootloader or previous kernel (via kexec) leaves the controller
deasserted, the lack of an initial toggle leaves the hardware in a stale
state. This breaks the controller reinitialization fix the patch intended to
provide, since as the commit message notes, failing to toggle the reset
causes DBI accesses to fail and return zeroes.
> if (!reset_control_status(dw->core_rsts[DW_PCIE_PWR_RST].rstc)) {
> reset_control_assert(dw->core_rsts[DW_PCIE_PWR_RST].rstc);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260903205153.283553-1-marek.vasut+renesas@mailbox.org?part=6
next prev parent reply other threads:[~2026-09-03 21:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 20:50 [PATCH 1/6] dt-bindings: PCI: rcar-gen4-pci-host: Document Application/Local register reset Marek Vasut
2026-09-03 20:50 ` [PATCH 2/6] dt-bindings: PCI: rcar-gen4-pci-ep: " Marek Vasut
2026-09-03 20:57 ` sashiko-bot
2026-09-03 20:50 ` [PATCH 3/6] PCI: rcar-gen4: Add Application/Local register reset control Marek Vasut
2026-09-03 21:02 ` sashiko-bot
2026-09-03 20:50 ` [PATCH 4/6] arm64: dts: renesas: r8a779f0: Add PCIe Application/Local register reset Marek Vasut
2026-09-03 21:01 ` sashiko-bot
2026-09-03 20:50 ` [PATCH 5/6] arm64: dts: renesas: r8a779g0: " Marek Vasut
2026-09-03 21:01 ` sashiko-bot
2026-09-03 20:50 ` [PATCH 6/6] arm64: dts: renesas: r8a779h0: " Marek Vasut
2026-09-03 21:04 ` sashiko-bot [this message]
2026-09-03 20:57 ` [PATCH 1/6] dt-bindings: PCI: rcar-gen4-pci-host: Document " 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=20260903210406.20CF91F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=marek.vasut+renesas@mailbox.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wsa+renesas@sang-engineering.com \
/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