summaryrefslogtreecommitdiff
path: root/drivers/pci/controller
diff options
context:
space:
mode:
authorAli Tariq <alitariq45892@gmail.com>2026-07-18 18:38:25 +0500
committerManivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>2026-07-29 18:37:39 +0200
commitfb9f7973473fc30d62e0f5f90d59df8ef5223777 (patch)
treedd104da06bb67d861f0cf97eb2ebf9f5d2b87ed2 /drivers/pci/controller
parent22877a061f81c5d58041e384b3131684bec636b9 (diff)
downloadlinux-next-fb9f7973473fc30d62e0f5f90d59df8ef5223777.tar.gz
linux-next-fb9f7973473fc30d62e0f5f90d59df8ef5223777.zip
PCI: starfive: Fix Runtime PM handling and teardown ordering
The starfive_pcie_remove() path incorrectly disabled runtime PM before executing plda_pcie_host_deinit(), which can cause unmanaged hardware register access in plda_pcie_host_deinit() while power domains or clocks are disabled. Fix this by restructuring starfive_pcie_remove() to deinitialize the host controller first while runtime PM is active, followed by a synchronous pm_runtime_put_sync() and pm_runtime_disable(). This bug was found in automated AI review by sashiko-bot. Fixes: 39b91eb40c6a ("PCI: starfive: Add JH7110 PCIe controller") Closes: https://lore.kernel.org/linux-pci/20260712180440.423421F000E9@smtp.kernel.org/ Signed-off-by: Ali Tariq <alitariq45892@gmail.com> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> Link: https://patch.msgid.link/20260718133825.445041-1-alitariq45892@gmail.com
Diffstat (limited to 'drivers/pci/controller')
-rw-r--r--drivers/pci/controller/plda/pcie-starfive.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/controller/plda/pcie-starfive.c b/drivers/pci/controller/plda/pcie-starfive.c
index 628f8c8d6747..0ca39f3fa1d4 100644
--- a/drivers/pci/controller/plda/pcie-starfive.c
+++ b/drivers/pci/controller/plda/pcie-starfive.c
@@ -445,9 +445,9 @@ static void starfive_pcie_remove(struct platform_device *pdev)
{
struct starfive_jh7110_pcie *pcie = platform_get_drvdata(pdev);
- pm_runtime_put(&pdev->dev);
- pm_runtime_disable(&pdev->dev);
plda_pcie_host_deinit(&pcie->plda);
+ pm_runtime_put_sync(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
platform_set_drvdata(pdev, NULL);
}