From: sashiko-bot@kernel.org
To: "Sebastian Reichel" <sebastian.reichel@collabora.com>
Cc: linux-pci@vger.kernel.org
Subject: Re: [PATCH v6 07/10] PCI: dw-rockchip: Add pme_turn_off support
Date: Tue, 08 Sep 2026 15:09:57 +0000 [thread overview]
Message-ID: <20260908150958.337E81F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260908-rockchip-pcie-system-suspend-v6-7-fbabcca9921b@collabora.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] Incorrect use of FIELD_PREP_WM16() on a Write-1-to-Clear (W1C) interrupt status register, causing unintended clearing of bit 25.
- [Low] Redundant macro definition for the Power Management Control Register.
--
commit 10a270e398b67f78bf174b063ed14cff0ce4e43b
Author: Sebastian Reichel <sebastian.reichel@collabora.com>
PCI: dw-rockchip: Add pme_turn_off support
This commit prepares the Rockchip PCIe controller for system suspend support
by adding the PME turn off operation.
> --- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c
> +++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
[ ... ]
> @@ -64,6 +65,11 @@
>
> /* Interrupt Mask Register Related to Miscellaneous Operation */
> #define PCIE_CLIENT_INTR_MASK_MISC 0x24
> +#define PCIE_CLIENT_POWER 0x2c
[Severity: Low]
Does this code introduce a redundant macro definition? It appears that
PCIE_CLIENT_POWER_CON is already defined as 0x2c immediately below
this addition.
> +#define PCIE_CLIENT_MSG_GEN 0x34
> +#define PME_READY_ENTER_L23 BIT(3)
> +#define PME_TURN_OFF FIELD_PREP_WM16(BIT(4), 1)
> +#define PME_TO_ACK FIELD_PREP_WM16(BIT(9), 1)
>
> /* Power Management Control Register */
> #define PCIE_CLIENT_POWER_CON 0x2c
[ ... ]
> @@ -452,8 +458,46 @@ static int rockchip_pcie_host_init(struct dw_pcie_rp *pp)
> return 0;
> }
>
> +static void rockchip_pcie_pme_turn_off(struct dw_pcie_rp *pp)
> +{
[ ... ]
> + /* 3. Clear PME_TO_Ack and Wait for ready to enter L23 message */
> + rockchip_pcie_writel_apb(rockchip, PME_TO_ACK, PCIE_CLIENT_INTR_STATUS_MSG_RX);
[Severity: Medium]
Since PME_TO_ACK uses FIELD_PREP_WM16(), it sets the write mask in the
upper 16 bits (asserting bit 25). If PCIE_CLIENT_INTR_STATUS_MSG_RX is
a Write-1-to-Clear interrupt status register, will writing this WM16
formatted value unintentionally clear the interrupt status for bit 25?
If bit 25 corresponds to an active interrupt, it could be silently lost.
> + ret = readl_poll_timeout(rockchip->apb_base + PCIE_CLIENT_POWER,
> + status, status & PME_READY_ENTER_L23,
> + PCIE_PME_TO_L2_TIMEOUT_US / 10,
> + PCIE_PME_TO_L2_TIMEOUT_US);
> + if (ret)
> + dev_err(dev, "Failed to get ready to enter L23 message\n");
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260908-rockchip-pcie-system-suspend-v6-0-fbabcca9921b@collabora.com?part=7
next prev parent reply other threads:[~2026-09-08 15:10 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 [this message]
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
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=20260908150958.337E81F00A3D@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