Patch "firmware: arm_scmi: Add SCMI PM driver remove routine" has been added to the 5.19-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

    firmware: arm_scmi: Add SCMI PM driver remove routine

to the 5.19-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:
     firmware-arm_scmi-add-scmi-pm-driver-remove-routine.patch
and it can be found in the queue-5.19 subdirectory.

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



commit 8ab3cf6befa3d9dc00c3344d54948e3cbfa1f75c
Author: Cristian Marussi <cristian.marussi@xxxxxxx>
Date:   Wed Aug 17 18:27:31 2022 +0100

    firmware: arm_scmi: Add SCMI PM driver remove routine
    
    [ Upstream commit dea796fcab0a219830831c070b8dc367d7e0f708 ]
    
    Currently, when removing the SCMI PM driver not all the resources
    registered with genpd subsystem are properly de-registered.
    
    As a side effect of this after a driver unload/load cycle you get a
    splat with a few warnings like this:
    
     | debugfs: Directory 'BIG_CPU0' with parent 'pm_genpd' already present!
     | debugfs: Directory 'BIG_CPU1' with parent 'pm_genpd' already present!
     | debugfs: Directory 'LITTLE_CPU0' with parent 'pm_genpd' already present!
     | debugfs: Directory 'LITTLE_CPU1' with parent 'pm_genpd' already present!
     | debugfs: Directory 'LITTLE_CPU2' with parent 'pm_genpd' already present!
     | debugfs: Directory 'LITTLE_CPU3' with parent 'pm_genpd' already present!
     | debugfs: Directory 'BIG_SSTOP' with parent 'pm_genpd' already present!
     | debugfs: Directory 'LITTLE_SSTOP' with parent 'pm_genpd' already present!
     | debugfs: Directory 'DBGSYS' with parent 'pm_genpd' already present!
     | debugfs: Directory 'GPUTOP' with parent 'pm_genpd' already present!
    
    Add a proper scmi_pm_domain_remove callback to the driver in order to
    take care of all the needed cleanups not handled by devres framework.
    
    Link: https://lore.kernel.org/r/20220817172731.1185305-7-cristian.marussi@xxxxxxx
    Signed-off-by: Cristian Marussi <cristian.marussi@xxxxxxx>
    Signed-off-by: Sudeep Holla <sudeep.holla@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/firmware/arm_scmi/scmi_pm_domain.c b/drivers/firmware/arm_scmi/scmi_pm_domain.c
index d5dee625de78..0e05a79de82d 100644
--- a/drivers/firmware/arm_scmi/scmi_pm_domain.c
+++ b/drivers/firmware/arm_scmi/scmi_pm_domain.c
@@ -112,9 +112,28 @@ static int scmi_pm_domain_probe(struct scmi_device *sdev)
 	scmi_pd_data->domains = domains;
 	scmi_pd_data->num_domains = num_domains;
 
+	dev_set_drvdata(dev, scmi_pd_data);
+
 	return of_genpd_add_provider_onecell(np, scmi_pd_data);
 }
 
+static void scmi_pm_domain_remove(struct scmi_device *sdev)
+{
+	int i;
+	struct genpd_onecell_data *scmi_pd_data;
+	struct device *dev = &sdev->dev;
+	struct device_node *np = dev->of_node;
+
+	of_genpd_del_provider(np);
+
+	scmi_pd_data = dev_get_drvdata(dev);
+	for (i = 0; i < scmi_pd_data->num_domains; i++) {
+		if (!scmi_pd_data->domains[i])
+			continue;
+		pm_genpd_remove(scmi_pd_data->domains[i]);
+	}
+}
+
 static const struct scmi_device_id scmi_id_table[] = {
 	{ SCMI_PROTOCOL_POWER, "genpd" },
 	{ },
@@ -124,6 +143,7 @@ MODULE_DEVICE_TABLE(scmi, scmi_id_table);
 static struct scmi_driver scmi_power_domain_driver = {
 	.name = "scmi-power-domain",
 	.probe = scmi_pm_domain_probe,
+	.remove = scmi_pm_domain_remove,
 	.id_table = scmi_id_table,
 };
 module_scmi_driver(scmi_power_domain_driver);



[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