From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Cc: "Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Heiko Stuebner" <heiko@sntech.de>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Jingoo Han" <jingoohan1@gmail.com>,
"Shawn Lin" <shawn.lin@rock-chips.com>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Yury Norov (NVIDIA)" <yury.norov@gmail.com>,
"Nicolas Frattaroli" <nicolas.frattaroli@collabora.com>,
"Alexey Charkov" <alchark@flipper.net>,
linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
kernel@collabora.com
Subject: Re: [PATCH v9 9/9] PCI: dw-rockchip: Add system PM support
Date: Sat, 7 Nov 2026 18:44:07 +0100 [thread overview]
Message-ID: <au9hRvuc09yjcUpd@venus> (raw)
In-Reply-To: <179406940043.65886.12399286680610211664.b4-reply@b4>
[-- Attachment #1: Type: text/plain, Size: 2677 bytes --]
Hi,
On Sat, Nov 07, 2026 at 10:06:40PM +0530, Manivannan Sadhasivam wrote:
> > +static int rockchip_pcie_suspend(struct device *dev)
> > +{
> > + struct rockchip_pcie *rockchip = dev_get_drvdata(dev);
> > + struct dw_pcie *pci = &rockchip->pci;
> > + int ret;
> > +
> > + if (rockchip->data->mode == DW_PCIE_EP_TYPE)
> > + return 0;
> > +
> > + if (pci->suspended)
> > + return 0;
>
> This check looks wrong. 'suspended' flag is only set at the end of
> dw_pcie_suspend_noirq() and is used as an indication to glue suspend callbacks
> to turn off the resources or not. here is no way this can be set at the start
> of tne glue suspend callback.
>
> I'll drop this check while applying.
I added this as a workaround in v8 for the issue Sashiko found in v7
(see down below). We probably will never see it in reality, so I'm
fine with dropping. Thanks for applying.
Greetings,
-- Sebastian
-------------------------------------------------------------------
[Severity: High]
What happens on a subsequent suspend if rockchip_pcie_resume() fails?
During suspend, dw_pcie_suspend_noirq() sets pci->suspended = true, and
rockchip_pcie_suspend() then powers off the PHY, disables clocks, asserts
reset, and disables rockchip->vpcie3v3.
If a later call to rockchip_pcie_resume() fails (for example, if
dw_pcie_resume_noirq() returns -ETIMEDOUT when dw_pcie_wait_for_link() times
out, or if regulator, PHY, reset, or clock initialization fails), the error
unwind path in rockchip_pcie_resume() disables the clocks, asserts reset,
deinitializes the PHY, and disables rockchip->vpcie3v3 while pci->suspended
remains true:
drivers/pci/controller/dwc/pcie-dw-rockchip.c:rockchip_pcie_resume() {
...
ret = dw_pcie_resume_noirq(pci);
if (ret) {
dev_err(dev, "failed to resume: %d\n", ret);
goto err_clear_rst_gpio;
}
return 0;
err_clear_rst_gpio:
gpiod_set_value_cansleep(rockchip->rst_gpio, 0);
err_disable_clk:
clk_bulk_disable_unprepare(rockchip->clk_cnt, rockchip->clks);
err_assert_reset:
reset_control_assert(rockchip->rst);
err_deinit_phy:
rockchip_pcie_phy_deinit(rockchip);
err_disable_regulator:
if (rockchip->vpcie3v3)
regulator_disable(rockchip->vpcie3v3);
return ret;
}
Because the PM core logs the noirq resume error, clears is_noirq_suspended,
and continues resuming the system, won't child PCI device resume and the next
call to rockchip_pcie_suspend() read APB/DBI registers while the controller
clocks are disabled and reset is asserted (causing an SError on ARM64), and
then call rockchip_pcie_phy_deinit(), clk_bulk_disable_unprepare(), and
regulator_disable() a second time?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Cc: "Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Heiko Stuebner" <heiko@sntech.de>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Jingoo Han" <jingoohan1@gmail.com>,
"Shawn Lin" <shawn.lin@rock-chips.com>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Yury Norov (NVIDIA)" <yury.norov@gmail.com>,
"Nicolas Frattaroli" <nicolas.frattaroli@collabora.com>,
"Alexey Charkov" <alchark@flipper.net>,
linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
kernel@collabora.com
Subject: Re: [PATCH v9 9/9] PCI: dw-rockchip: Add system PM support
Date: Sat, 7 Nov 2026 18:44:07 +0100 [thread overview]
Message-ID: <au9hRvuc09yjcUpd@venus> (raw)
In-Reply-To: <179406940043.65886.12399286680610211664.b4-reply@b4>
[-- Attachment #1.1: Type: text/plain, Size: 2677 bytes --]
Hi,
On Sat, Nov 07, 2026 at 10:06:40PM +0530, Manivannan Sadhasivam wrote:
> > +static int rockchip_pcie_suspend(struct device *dev)
> > +{
> > + struct rockchip_pcie *rockchip = dev_get_drvdata(dev);
> > + struct dw_pcie *pci = &rockchip->pci;
> > + int ret;
> > +
> > + if (rockchip->data->mode == DW_PCIE_EP_TYPE)
> > + return 0;
> > +
> > + if (pci->suspended)
> > + return 0;
>
> This check looks wrong. 'suspended' flag is only set at the end of
> dw_pcie_suspend_noirq() and is used as an indication to glue suspend callbacks
> to turn off the resources or not. here is no way this can be set at the start
> of tne glue suspend callback.
>
> I'll drop this check while applying.
I added this as a workaround in v8 for the issue Sashiko found in v7
(see down below). We probably will never see it in reality, so I'm
fine with dropping. Thanks for applying.
Greetings,
-- Sebastian
-------------------------------------------------------------------
[Severity: High]
What happens on a subsequent suspend if rockchip_pcie_resume() fails?
During suspend, dw_pcie_suspend_noirq() sets pci->suspended = true, and
rockchip_pcie_suspend() then powers off the PHY, disables clocks, asserts
reset, and disables rockchip->vpcie3v3.
If a later call to rockchip_pcie_resume() fails (for example, if
dw_pcie_resume_noirq() returns -ETIMEDOUT when dw_pcie_wait_for_link() times
out, or if regulator, PHY, reset, or clock initialization fails), the error
unwind path in rockchip_pcie_resume() disables the clocks, asserts reset,
deinitializes the PHY, and disables rockchip->vpcie3v3 while pci->suspended
remains true:
drivers/pci/controller/dwc/pcie-dw-rockchip.c:rockchip_pcie_resume() {
...
ret = dw_pcie_resume_noirq(pci);
if (ret) {
dev_err(dev, "failed to resume: %d\n", ret);
goto err_clear_rst_gpio;
}
return 0;
err_clear_rst_gpio:
gpiod_set_value_cansleep(rockchip->rst_gpio, 0);
err_disable_clk:
clk_bulk_disable_unprepare(rockchip->clk_cnt, rockchip->clks);
err_assert_reset:
reset_control_assert(rockchip->rst);
err_deinit_phy:
rockchip_pcie_phy_deinit(rockchip);
err_disable_regulator:
if (rockchip->vpcie3v3)
regulator_disable(rockchip->vpcie3v3);
return ret;
}
Because the PM core logs the noirq resume error, clears is_noirq_suspended,
and continues resuming the system, won't child PCI device resume and the next
call to rockchip_pcie_suspend() read APB/DBI registers while the controller
clocks are disabled and reset is asserted (causing an SError on ARM64), and
then call rockchip_pcie_phy_deinit(), clk_bulk_disable_unprepare(), and
regulator_disable() a second time?
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2026-11-07 17:44 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 13:33 [PATCH v9 0/9] PCI: dw-rockchip: add system suspend support Sebastian Reichel
2026-11-05 13:33 ` Sebastian Reichel
2026-11-05 13:33 ` [PATCH v9 1/9] PCI: dw-rockchip: Fix LTSSM set functions Sebastian Reichel
2026-11-05 13:33 ` Sebastian Reichel
2026-11-05 13:36 ` sashiko-bot
2026-11-09 17:33 ` Bjorn Helgaas
2026-11-09 17:33 ` Bjorn Helgaas
2026-11-09 18:03 ` Sebastian Reichel
2026-11-09 18:03 ` Sebastian Reichel
2026-11-05 13:33 ` [PATCH v9 2/9] PCI: dw-rockchip: Restore vpcie3v3 regulator handle Sebastian Reichel
2026-11-05 13:33 ` Sebastian Reichel
2026-11-05 13:36 ` sashiko-bot
2026-11-05 13:33 ` [PATCH v9 3/9] PCI: dw-rockchip: Move devm_phy_get out of phy_init Sebastian Reichel
2026-11-05 13:33 ` Sebastian Reichel
2026-11-05 13:38 ` sashiko-bot
2026-11-05 13:33 ` [PATCH v9 4/9] PCI: dw-rockchip: Add helper function for enhanced LTSSM control mode Sebastian Reichel
2026-11-05 13:33 ` Sebastian Reichel
2026-11-05 13:33 ` [PATCH v9 5/9] PCI: dw-rockchip: Add helper function for controller mode Sebastian Reichel
2026-11-05 13:33 ` Sebastian Reichel
2026-11-05 13:33 ` [PATCH v9 6/9] PCI: dw-rockchip: Add helper function for DLL interrupts Sebastian Reichel
2026-11-05 13:33 ` Sebastian Reichel
2026-11-05 13:33 ` [PATCH v9 7/9] PCI: dw-rockchip: Add pme_turn_off support Sebastian Reichel
2026-11-05 13:33 ` Sebastian Reichel
2026-11-05 13:33 ` [PATCH v9 8/9] PCI: dw-rockchip: Set broken L1SS resume flag Sebastian Reichel
2026-11-05 13:33 ` Sebastian Reichel
2026-11-05 13:33 ` [PATCH v9 9/9] PCI: dw-rockchip: Add system PM support Sebastian Reichel
2026-11-05 13:33 ` Sebastian Reichel
2026-11-07 16:36 ` Manivannan Sadhasivam
2026-11-07 16:36 ` Manivannan Sadhasivam
2026-11-07 17:44 ` Sebastian Reichel [this message]
2026-11-07 17:44 ` Sebastian Reichel
2026-11-06 0:35 ` [PATCH v9 0/9] PCI: dw-rockchip: add system suspend support Shawn Lin
2026-11-06 0:35 ` Shawn Lin
2026-11-07 1:41 ` Igor Velkov
2026-11-07 1:41 ` Igor Velkov
2026-11-07 17:05 ` Manivannan Sadhasivam
2026-11-07 17:05 ` Manivannan Sadhasivam
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=au9hRvuc09yjcUpd@venus \
--to=sebastian.reichel@collabora.com \
--cc=alchark@flipper.net \
--cc=bhelgaas@google.com \
--cc=broonie@kernel.org \
--cc=heiko@sntech.de \
--cc=jingoohan1@gmail.com \
--cc=kernel@collabora.com \
--cc=kwilczynski@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=manivannan.sadhasivam@oss.qualcomm.com \
--cc=nicolas.frattaroli@collabora.com \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=shawn.lin@rock-chips.com \
--cc=yury.norov@gmail.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 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.