From: sashiko-bot@kernel.org
To: "Sebastian Reichel" <sebastian.reichel@collabora.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v6 10/10] PCI: dw-rockchip: Clear debug buffer before entering L2
Date: Tue, 08 Sep 2026 15:04:50 +0000 [thread overview]
Message-ID: <20260908150451.4CDF71F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260908-rockchip-pcie-system-suspend-v6-10-fbabcca9921b@collabora.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Incorrect arguments passed to rockchip_pcie_writel_apb() swap register offset and value.
- [Medium] Undocumented modification of controller DBI state during suspend.
--
commit 8a75a527ec46d932d4c3b6e7ed428836e9df376b
Author: Sebastian Reichel <sebastian.reichel@collabora.com>
PCI: dw-rockchip: Clear debug buffer before entering L2
This commit aims to clear the debug buffer before entering the L2 state to
ease debugging link training issues on resume. It introduces a helper to clear
the general debug register and invokes it during suspend.
> diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> index e675918ba1848..a508f4fffd2ac 100644
> --- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> +++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> @@ -77,6 +77,9 @@
> #define PCIE_CLKREQ_NOT_READY FIELD_PREP_WM16(BIT(0), 0)
> #define PCIE_CLKREQ_PULL_DOWN FIELD_PREP_WM16(GENMASK(13, 12), 1)
>
> +/* General Debug Register */
> +#define PCIE_CLIENT_GENERAL_DEBUG 0x104
> +
[ ... ]
> @@ -1043,6 +1046,11 @@ static int rockchip_pcie_rc_reset_root_port(struct pci_host_bridge *bridge,
> return ret;
> }
>
> +static inline void rockchip_pcie_link_status_clear(struct rockchip_pcie *rockchip)
> +{
> + rockchip_pcie_writel_apb(rockchip, PCIE_CLIENT_GENERAL_DEBUG, 0x0);
[Severity: High]
Are the arguments to rockchip_pcie_writel_apb() swapped here?
Looking at the function definition earlier in the file, the signature expects
the value before the register offset:
static void rockchip_pcie_writel_apb(struct rockchip_pcie *rockchip, u32 val,
u32 reg)
This call passes the register offset (PCIE_CLIENT_GENERAL_DEBUG, which is
0x104) as the data value to be written to register offset 0x0. This fails to
clear the intended debug register and might unexpectedly corrupt the controller
register at offset 0x0.
> +}
> +
> static int rockchip_pcie_suspend(struct device *dev)
> {
> struct rockchip_pcie *rockchip = dev_get_drvdata(dev);
> @@ -1056,6 +1064,11 @@ static int rockchip_pcie_suspend(struct device *dev)
>
> rockchip->intx = rockchip_pcie_readl_apb(rockchip, PCIE_CLIENT_INTR_MASK_LEGACY);
>
> + /* All sub-devices are in D3hot by PCIe stack */
> + dw_pcie_dbi_ro_wr_dis(pci);
[Severity: Medium]
Is this modification of the DBI state intentional for this commit?
This introduces an undocumented change to disable the controller's DBI
read-only writes unconditionally during the suspend sequence. Since there is no
explanation in the commit message and no matching enable call, could this be an
accidental inclusion unrelated to clearing the debug buffer?
> +
> + rockchip_pcie_link_status_clear(rockchip);
> +
> ret = dw_pcie_suspend_noirq(pci);
> if (ret)
> return ret;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260908-rockchip-pcie-system-suspend-v6-0-fbabcca9921b@collabora.com?part=10
next prev parent reply other threads:[~2026-09-08 15:04 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 14:51 [PATCH v6 00/10] PCI: dw-rockchip: add system suspend support Sebastian Reichel
2026-09-08 14:51 ` [PATCH v6 01/10] PCI: dw-rockchip: Fix LTSSM set functions Sebastian Reichel
2026-09-08 14:58 ` sashiko-bot
2026-09-09 0:37 ` Shawn Lin
2026-09-08 14:51 ` [PATCH v6 02/10] PCI: dw-rockchip: Restore vpcie3v3 regulator handle Sebastian Reichel
2026-09-08 15:05 ` sashiko-bot
2026-09-09 0:44 ` Shawn Lin
2026-09-08 14:51 ` [PATCH v6 03/10] PCI: dw-rockchip: Move devm_phy_get out of phy_init Sebastian Reichel
2026-09-08 15:04 ` sashiko-bot
2026-09-09 0:54 ` Shawn Lin
2026-09-08 14:51 ` [PATCH v6 04/10] PCI: dw-rockchip: Add helper function for enhanced LTSSM control mode Sebastian Reichel
2026-09-08 15:23 ` sashiko-bot
2026-09-09 0:56 ` Shawn Lin
2026-09-08 14:51 ` [PATCH v6 05/10] PCI: dw-rockchip: Add helper function for controller mode Sebastian Reichel
2026-09-08 15:03 ` sashiko-bot
2026-09-09 0:58 ` Shawn Lin
2026-09-08 14:51 ` [PATCH v6 06/10] PCI: dw-rockchip: Add helper function for DDL indicator Sebastian Reichel
2026-09-08 15:00 ` sashiko-bot
2026-09-09 0:58 ` Shawn Lin
2026-09-08 14:51 ` [PATCH v6 07/10] PCI: dw-rockchip: Add pme_turn_off support Sebastian Reichel
2026-09-08 15:09 ` sashiko-bot
2026-09-09 1:07 ` Shawn Lin
2026-09-08 14:51 ` [PATCH v6 08/10] PCI: dw-rockchip: Set broken L1SS resume flag Sebastian Reichel
2026-09-08 14:58 ` sashiko-bot
2026-09-09 1:11 ` Shawn Lin
2026-09-08 14:51 ` [PATCH v6 09/10] PCI: dw-rockchip: Add system PM support Sebastian Reichel
2026-09-08 15:12 ` sashiko-bot
2026-09-08 14:51 ` [PATCH v6 10/10] PCI: dw-rockchip: Clear debug buffer before entering L2 Sebastian Reichel
2026-09-08 15:04 ` sashiko-bot [this message]
2026-09-09 1:14 ` Shawn Lin
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=20260908150451.4CDF71F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sebastian.reichel@collabora.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