Patch "PCI: qcom-ep: Enable controller resources like PHY only after refclk is available" has been added to the 6.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    PCI: qcom-ep: Enable controller resources like PHY only after refclk is available

to the 6.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     pci-qcom-ep-enable-controller-resources-like-phy-onl.patch
and it can be found in the queue-6.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 1ca5dd825b83a016610e4c84942ecc0ceb580406
Author: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
Date:   Fri Aug 30 13:53:19 2024 +0530

    PCI: qcom-ep: Enable controller resources like PHY only after refclk is available
    
    [ Upstream commit d3745e3ae6c0eec517d431be926742b6e8b9b64a ]
    
    qcom_pcie_enable_resources() is called by qcom_pcie_ep_probe() and it
    enables the controller resources like clocks, regulator, PHY. On one of the
    new unreleased Qcom SoC, PHY enablement depends on the active refclk. And
    on all of the supported Qcom endpoint SoCs, refclk comes from the host
    (RC). So calling qcom_pcie_enable_resources() without refclk causes the
    NoC (Network On Chip) error in the endpoint SoC and in turn results in a
    whole SoC crash and rebooting into EDL (Emergency Download) mode which is
    an unrecoverable state.
    
    But qcom_pcie_enable_resources() is already called by
    qcom_pcie_perst_deassert() when PERST# is deasserted, and refclk is
    available at that time.
    
    Hence, remove the unnecessary call to qcom_pcie_enable_resources() from
    qcom_pcie_ep_probe() to prevent the above mentioned crash.
    
    It should be noted that this commit prevents the crash only under normal
    working condition (booting endpoint before host), but the crash may also
    occur if PERST# assert happens at the wrong time. For avoiding the crash
    completely, it is recommended to use SRIS mode which allows the endpoint
    SoC to generate its own refclk. The driver is not supporting SRIS mode
    currently, but will be added in the future.
    
    Fixes: 869bc5253406 ("PCI: dwc: ep: Fix DBI access failure for drivers requiring refclk from host")
    Link: https://lore.kernel.org/linux-pci/20240830082319.51387-1-manivannan.sadhasivam@xxxxxxxxxx
    Tested-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>
    Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
    Signed-off-by: Krzysztof Wilczyński <kwilczynski@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c
index a9b263f749b6a..c8bb7cd89678f 100644
--- a/drivers/pci/controller/dwc/pcie-qcom-ep.c
+++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c
@@ -858,21 +858,15 @@ static int qcom_pcie_ep_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = qcom_pcie_enable_resources(pcie_ep);
-	if (ret) {
-		dev_err(dev, "Failed to enable resources: %d\n", ret);
-		return ret;
-	}
-
 	ret = dw_pcie_ep_init(&pcie_ep->pci.ep);
 	if (ret) {
 		dev_err(dev, "Failed to initialize endpoint: %d\n", ret);
-		goto err_disable_resources;
+		return ret;
 	}
 
 	ret = qcom_pcie_ep_enable_irq_resources(pdev, pcie_ep);
 	if (ret)
-		goto err_disable_resources;
+		goto err_ep_deinit;
 
 	name = devm_kasprintf(dev, GFP_KERNEL, "%pOFP", dev->of_node);
 	if (!name) {
@@ -889,8 +883,8 @@ static int qcom_pcie_ep_probe(struct platform_device *pdev)
 	disable_irq(pcie_ep->global_irq);
 	disable_irq(pcie_ep->perst_irq);
 
-err_disable_resources:
-	qcom_pcie_disable_resources(pcie_ep);
+err_ep_deinit:
+	dw_pcie_ep_deinit(&pcie_ep->pci.ep);
 
 	return ret;
 }




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux