From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Mayank Rana <quic_mrana@quicinc.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
Krishna chaitanya chundru <quic_krichai@quicinc.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Markus.Elfring@web.de, rafael@kernel.org,
linux-pm@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, quic_vbadigan@quicinc.com,
quic_ramkri@quicinc.com
Subject: Re: [PATCH v5] PCI: Enable runtime pm of the host bridge
Date: Thu, 10 Oct 2024 11:38:50 +0530 [thread overview]
Message-ID: <20241010060850.4j4r75yaigzjwuk5@thinkpad> (raw)
In-Reply-To: <03aa3a08-735d-4a6d-ae6d-e2887ae36840@quicinc.com>
On Wed, Oct 09, 2024 at 03:20:25PM -0700, Mayank Rana wrote:
> Hi
>
> It seems that PCIe controller (pcie-starfive.c driver,
> starfive_pcie_probe()) is setting (child device) PCIe host bridge device's
> runtime state as active going through plda_pcie_host_init() ->
> pci_host_probe() before parent i.e. PCIe controller device itself is being
> mark as active.
>
Actually the pcie-starfive driver is enabling the runtime PM status of the PCIe
controller (parent) *after* its child host bridge. It should be done other way
around as like other PCIe controller drivers and hence the warning. It was not
triggered earlier because the host bridge (child) PM state was inactive. Since
it becomes active after this patch, the warning is getting triggered.
> log is showing below error from pm_runtime_enable() context:
> dev_warn(dev, "Enabling runtime PM for inactive device with active
> children\n");
>
> Is it possible to try below change to see if it helps ?
> ======
> diff --git a/drivers/pci/controller/plda/pcie-starfive.c
> b/drivers/pci/controller/plda/pcie-starfive.c
> index 0567ec373a3e..10bcd7e2e958 100644
> --- a/drivers/pci/controller/plda/pcie-starfive.c
> +++ b/drivers/pci/controller/plda/pcie-starfive.c
> @@ -404,6 +404,9 @@ static int starfive_pcie_probe(struct platform_device
> *pdev)
> if (ret)
> return ret;
>
> + pm_runtime_enable(&pdev->dev);
> + pm_runtime_get_sync(&pdev->dev);
> +
> plda->host_ops = &sf_host_ops;
> plda->num_events = PLDA_MAX_EVENT_NUM;
> /* mask doorbell event */
> @@ -416,8 +419,6 @@ static int starfive_pcie_probe(struct platform_device
> *pdev)
> if (ret)
> return ret;
>
> - pm_runtime_enable(&pdev->dev);
> - pm_runtime_get_sync(&pdev->dev);
> platform_set_drvdata(pdev, pcie);
>
> return 0;
>
Thanks Mayank for the fix. This should fix the warning (and hopefully the
lockdep splat). Marek, please let us know if this helps or not.
- Mani
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2024-10-10 6:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-03 6:02 [PATCH v5] PCI: Enable runtime pm of the host bridge Krishna chaitanya chundru
2024-10-03 22:10 ` Bjorn Helgaas
2024-10-08 22:25 ` Andy Shevchenko
[not found] ` <CGME20241009181035eucas1p1410785aa81c9ec764c44d3f6eea940ed@eucas1p1.samsung.com>
2024-10-09 18:10 ` Marek Szyprowski
2024-10-09 22:20 ` Mayank Rana
2024-10-10 6:08 ` Manivannan Sadhasivam [this message]
2024-10-10 6:42 ` Marek Szyprowski
2024-10-10 19:25 ` Bjorn Helgaas
2024-10-10 20:39 ` Mayank Rana
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=20241010060850.4j4r75yaigzjwuk5@thinkpad \
--to=manivannan.sadhasivam@linaro.org \
--cc=Markus.Elfring@web.de \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=quic_krichai@quicinc.com \
--cc=quic_mrana@quicinc.com \
--cc=quic_ramkri@quicinc.com \
--cc=quic_vbadigan@quicinc.com \
--cc=rafael@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).