From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Mayank Rana <quic_mrana@quicinc.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
Sasha Levin <sashal@kernel.org>,
kevin.xie@starfivetech.com, lpieralisi@kernel.org, kw@linux.com,
linux-pci@vger.kernel.org
Subject: [PATCH AUTOSEL 6.12 08/15] PCI: starfive: Enable controller runtime PM before probing host bridge
Date: Wed, 4 Dec 2024 10:59:56 -0500 [thread overview]
Message-ID: <20241204160010.2216008-8-sashal@kernel.org> (raw)
In-Reply-To: <20241204160010.2216008-1-sashal@kernel.org>
From: Mayank Rana <quic_mrana@quicinc.com>
[ Upstream commit 6168efbebace0db443185d4c6701ca8170a8788d ]
A PCI controller device, e.g., StarFive, is parent to PCI host bridge
device. We must enable runtime PM of the controller before enabling runtime
PM of the host bridge, which will happen in pci_host_probe(), to avoid this
warning:
pcie-starfive 940000000.pcie: Enabling runtime PM for inactive device with active children
Fix this issue by enabling StarFive controller device's runtime PM before
calling pci_host_probe() in plda_pcie_host_init().
Link: https://lore.kernel.org/r/20241111-runtime_pm-v7-1-9c164eefcd87@quicinc.com
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mayank Rana <quic_mrana@quicinc.com>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/controller/plda/pcie-starfive.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/pci/controller/plda/pcie-starfive.c b/drivers/pci/controller/plda/pcie-starfive.c
index c9933ecf68338..0564fdce47c2a 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 */
@@ -413,11 +416,12 @@ static int starfive_pcie_probe(struct platform_device *pdev)
plda->events_bitmap <<= PLDA_NUM_DMA_EVENTS;
ret = plda_pcie_host_init(&pcie->plda, &starfive_pcie_ops,
&stf_pcie_event);
- if (ret)
+ if (ret) {
+ pm_runtime_put_sync(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
return ret;
+ }
- pm_runtime_enable(&pdev->dev);
- pm_runtime_get_sync(&pdev->dev);
platform_set_drvdata(pdev, pcie);
return 0;
--
2.43.0
next prev parent reply other threads:[~2024-12-04 17:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 15:59 [PATCH AUTOSEL 6.12 01/15] f2fs: fix f2fs_bug_on when uninstalling filesystem call f2fs_evict_inode Sasha Levin
2024-12-04 15:59 ` [PATCH AUTOSEL 6.12 02/15] KMSAN: uninit-value in inode_go_dump (5) Sasha Levin
2024-12-04 15:59 ` [PATCH AUTOSEL 6.12 03/15] i3c: mipi-i3c-hci: Mask ring interrupts before ring stop request Sasha Levin
2024-12-04 15:59 ` [PATCH AUTOSEL 6.12 04/15] PCI: qcom: Add support for IPQ9574 Sasha Levin
2024-12-04 15:59 ` [PATCH AUTOSEL 6.12 05/15] PCI: vmd: Add DID 8086:B06F and 8086:B60B for Intel client SKUs Sasha Levin
2024-12-04 15:59 ` [PATCH AUTOSEL 6.12 06/15] PCI: vmd: Set devices to D0 before enabling PM L1 Substates Sasha Levin
2024-12-04 15:59 ` [PATCH AUTOSEL 6.12 07/15] PCI: Detect and trust built-in Thunderbolt chips Sasha Levin
2024-12-04 15:59 ` Sasha Levin [this message]
2024-12-04 15:59 ` [PATCH AUTOSEL 6.12 09/15] PCI: Add 'reset_subordinate' to reset hierarchy below bridge Sasha Levin
2024-12-04 15:59 ` [PATCH AUTOSEL 6.12 10/15] PCI: Add ACS quirk for Wangxun FF5xxx NICs Sasha Levin
2024-12-04 15:59 ` [PATCH AUTOSEL 6.12 11/15] remoteproc: qcom: pas: enable SAR2130P audio DSP support Sasha Levin
2024-12-04 16:00 ` [PATCH AUTOSEL 6.12 12/15] i3c: Use i3cdev->desc->info instead of calling i3c_device_get_info() to avoid deadlock Sasha Levin
2024-12-04 16:00 ` [PATCH AUTOSEL 6.12 13/15] f2fs: print message if fscorrupted was found in f2fs_new_node_page() Sasha Levin
2024-12-04 16:00 ` [PATCH AUTOSEL 6.12 14/15] f2fs: fix to shrink read extent node in batches Sasha Levin
2024-12-04 16:00 ` [PATCH AUTOSEL 6.12 15/15] f2fs: add a sysfs node to limit max read extent count per-inode Sasha Levin
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=20241204160010.2216008-8-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=bhelgaas@google.com \
--cc=kevin.xie@starfivetech.com \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=manivannan.sadhasivam@linaro.org \
--cc=quic_mrana@quicinc.com \
--cc=stable@vger.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