Patch "soc: xilinx: move PM_INIT_FINALIZE to zynqmp_pm_domains driver" has been added to the 5.10-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

    soc: xilinx: move PM_INIT_FINALIZE to zynqmp_pm_domains driver

to the 5.10-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:
     soc-xilinx-move-pm_init_finalize-to-zynqmp_pm_domain.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 79285036ed34e612265d038c29426a15a864b967
Author: Michael Tretter <m.tretter@xxxxxxxxxxxxxx>
Date:   Wed Aug 25 17:03:10 2021 +0200

    soc: xilinx: move PM_INIT_FINALIZE to zynqmp_pm_domains driver
    
    [ Upstream commit 7fd890b89dea55eb5866640eb8befad26d558161 ]
    
    PM_INIT_FINALIZE tells the PMU FW that Linux is able to handle the power
    management nodes that are provided by the PMU FW. Nodes that are not
    requested are shut down after this call.
    
    Calling PM_INIT_FINALIZE from the zynqmp_power driver is wrong. The PM
    node request mechanism is implemented in the zynqmp_pm_domains driver,
    which must also call PM_INIT_FINALIZE.
    
    Due to the behavior of the PMU FW, all devices must be powered up before
    PM_INIT_FINALIZE is called, because otherwise the devices might
    misbehave. Calling PM_INIT_FINALIZE from the sync_state device callback
    ensures that all users probed successfully before the PMU FW is allowed
    to power off unused domains.
    
    Signed-off-by: Michael Tretter <m.tretter@xxxxxxxxxxxxxx>
    Acked-by: Michal Simek <michal.simek@xxxxxxxxxx>
    Acked-by: Rajan Vaja <rajan.vaja@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210825150313.4033156-2-m.tretter@xxxxxxxxxxxxxx
    Signed-off-by: Michal Simek <michal.simek@xxxxxxxxxx>
    Stable-dep-of: 9b003e14801c ("drivers: soc: xilinx: check return status of get_api_version()")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/soc/xilinx/zynqmp_pm_domains.c b/drivers/soc/xilinx/zynqmp_pm_domains.c
index 226d343f0a6a5..81e8e10f10929 100644
--- a/drivers/soc/xilinx/zynqmp_pm_domains.c
+++ b/drivers/soc/xilinx/zynqmp_pm_domains.c
@@ -152,11 +152,17 @@ static int zynqmp_gpd_power_off(struct generic_pm_domain *domain)
 static int zynqmp_gpd_attach_dev(struct generic_pm_domain *domain,
 				 struct device *dev)
 {
+	struct device_link *link;
 	int ret;
 	struct zynqmp_pm_domain *pd;
 
 	pd = container_of(domain, struct zynqmp_pm_domain, gpd);
 
+	link = device_link_add(dev, &domain->dev, DL_FLAG_SYNC_STATE_ONLY);
+	if (!link)
+		dev_dbg(&domain->dev, "failed to create device link for %s\n",
+			dev_name(dev));
+
 	/* If this is not the first device to attach there is nothing to do */
 	if (domain->device_count)
 		return 0;
@@ -299,9 +305,19 @@ static int zynqmp_gpd_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static void zynqmp_gpd_sync_state(struct device *dev)
+{
+	int ret;
+
+	ret = zynqmp_pm_init_finalize();
+	if (ret)
+		dev_warn(dev, "failed to release power management to firmware\n");
+}
+
 static struct platform_driver zynqmp_power_domain_driver = {
 	.driver	= {
 		.name = "zynqmp_power_controller",
+		.sync_state = zynqmp_gpd_sync_state,
 	},
 	.probe = zynqmp_gpd_probe,
 	.remove = zynqmp_gpd_remove,
diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c
index c556623dae024..f8c301984d4f9 100644
--- a/drivers/soc/xilinx/zynqmp_power.c
+++ b/drivers/soc/xilinx/zynqmp_power.c
@@ -178,7 +178,6 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
 	u32 pm_api_version;
 	struct mbox_client *client;
 
-	zynqmp_pm_init_finalize();
 	zynqmp_pm_get_api_version(&pm_api_version);
 
 	/* Check PM API version number */




[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