Skip to content

Commit 3c66563

Browse files
committed
Revert "firmware: arm_scmi: Add clock management to the SCMI power domain"
This reverts commit a3b884c ("firmware: arm_scmi: Add clock management to the SCMI power domain"). Using the GENPD_FLAG_PM_CLK tells genpd to gate/ungate the consumer device's clock(s) during runtime suspend/resume through the PM clock API. More precisely, in genpd_runtime_resume() the clock(s) for the consumer device would become ungated prior to the driver-level ->runtime_resume() callbacks gets invoked. This behaviour isn't a good fit for all platforms/drivers. For example, a driver may need to make some preparations of its device in its ->runtime_resume() callback, like calling clk_set_rate() before the clock(s) should be ungated. In these cases, it's easier to let the clock(s) to be managed solely by the driver, rather than at the PM domain level. For these reasons, let's drop the use GENPD_FLAG_PM_CLK for the SCMI PM domain, as to enable it to be more easily adopted across ARM platforms. Fixes: a3b884c ("firmware: arm_scmi: Add clock management to the SCMI power domain") Cc: Nicolas Pitre <[email protected]> Cc: [email protected] Signed-off-by: Ulf Hansson <[email protected]> Tested-by: Peng Fan <[email protected]> Acked-by: Sudeep Holla <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e923391 commit 3c66563

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

drivers/firmware/arm_scmi/scmi_pm_domain.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <linux/err.h>
99
#include <linux/io.h>
1010
#include <linux/module.h>
11-
#include <linux/pm_clock.h>
1211
#include <linux/pm_domain.h>
1312
#include <linux/scmi_protocol.h>
1413

@@ -53,27 +52,6 @@ static int scmi_pd_power_off(struct generic_pm_domain *domain)
5352
return scmi_pd_power(domain, false);
5453
}
5554

56-
static int scmi_pd_attach_dev(struct generic_pm_domain *pd, struct device *dev)
57-
{
58-
int ret;
59-
60-
ret = pm_clk_create(dev);
61-
if (ret)
62-
return ret;
63-
64-
ret = of_pm_clk_add_clks(dev);
65-
if (ret >= 0)
66-
return 0;
67-
68-
pm_clk_destroy(dev);
69-
return ret;
70-
}
71-
72-
static void scmi_pd_detach_dev(struct generic_pm_domain *pd, struct device *dev)
73-
{
74-
pm_clk_destroy(dev);
75-
}
76-
7755
static int scmi_pm_domain_probe(struct scmi_device *sdev)
7856
{
7957
int num_domains, i;
@@ -124,10 +102,6 @@ static int scmi_pm_domain_probe(struct scmi_device *sdev)
124102
scmi_pd->genpd.name = scmi_pd->name;
125103
scmi_pd->genpd.power_off = scmi_pd_power_off;
126104
scmi_pd->genpd.power_on = scmi_pd_power_on;
127-
scmi_pd->genpd.attach_dev = scmi_pd_attach_dev;
128-
scmi_pd->genpd.detach_dev = scmi_pd_detach_dev;
129-
scmi_pd->genpd.flags = GENPD_FLAG_PM_CLK |
130-
GENPD_FLAG_ACTIVE_WAKEUP;
131105

132106
pm_genpd_init(&scmi_pd->genpd, NULL,
133107
state == SCMI_POWER_STATE_GENERIC_OFF);

0 commit comments

Comments
 (0)