Allow genpd providers to power off domains on sync state
Subsystems (9)
v3 cover Allow genpd providers to power off domains on sync state
There have been already a couple of tries to make the genpd "disable unused" late initcall skip the powering off of domains that might be needed until later on (i.e. until some consumer probes). The conclusion was that the provider could return -EBUSY from the power_off callback until the provider's sync state has been reached. This patch series tries to provide a proof-of-concept that is working on Qualcomm platforms.
I've been doing extensive testing on SM8450, but I've also spinned this on my X13s (SC8280XP). Both patches that add the sync state callback to the SC8280XP and SM8450 are here to provide context. Once we agree on the form, I intend to add the sync state callback to all gdsc providers.
Currently, some of the gdsc providers might not reach sync state due to list of consumers not probing yet (or at all). The sync state can be enforced by writing 1 to the state_synced sysfs attribute of the provider, thanks to Saravana's commit [1] which has been already merged.
[1] https://lore.kernel.org/r/[email protected]
V2 (RFC) of this patchset was here:
https://lore.kernel.org/all/[email protected]/
Changes since v2:
* renamed genpd_queue_power_off_work to pm_genpd_queue_power_off and added comment about its purpose w.r.t. it being exported.
* added the qcom_cc generic sync state callback to all providers that register GDSCs, instead of SM8450 and SC8280XP
Changes since v1:
* Added the qcom_cc sync state callback which calls in turn the gdsc one
* dropped extra semicolon from pm_domain.h
Abel Vesa (4):
PM: domains: Allow power off queuing from providers
soc: qcom: rpmhpd: Do proper power off when state synced
clk: qcom: gdsc: Avoid actual power off until sync state
clk: qcom: Add sync state callback to all providers
drivers/base/power/domain.c | 18 ++++++++++-------- drivers/clk/qcom/apss-ipq6018.c | 1 + drivers/clk/qcom/camcc-sc7180.c | 1 + drivers/clk/qcom/camcc-sc7280.c | 1 + drivers/clk/qcom/camcc-sdm845.c | 1 + drivers/clk/qcom/camcc-sm6350.c | 1 + drivers/clk/qcom/camcc-sm8250.c | 1 + drivers/clk/qcom/camcc-sm8450.c | 1 + drivers/clk/qcom/common.c | 19 +++++++++++++++++++ drivers/clk/qcom/common.h | 2 ++ drivers/clk/qcom/dispcc-qcm2290.c | 1 + drivers/clk/qcom/dispcc-sc7180.c | 1 + drivers/clk/qcom/dispcc-sc7280.c | 1 + drivers/clk/qcom/dispcc-sc8280xp.c | 1 + drivers/clk/qcom/dispcc-sdm845.c | 1 + drivers/clk/qcom/dispcc-sm6115.c | 1 + drivers/clk/qcom/dispcc-sm6125.c | 1 + drivers/clk/qcom/dispcc-sm6350.c | 1 + drivers/clk/qcom/dispcc-sm6375.c | 1 + drivers/clk/qcom/dispcc-sm8250.c | 1 + drivers/clk/qcom/dispcc-sm8450.c | 1 + drivers/clk/qcom/dispcc-sm8550.c | 1 + drivers/clk/qcom/gcc-apq8084.c | 1 + drivers/clk/qcom/gcc-ipq806x.c | 1 + drivers/clk/qcom/gcc-ipq8074.c | 1 + drivers/clk/qcom/gcc-mdm9615.c | 1 + drivers/clk/qcom/gcc-msm8660.c | 1 + drivers/clk/qcom/gcc-msm8909.c | 1 + drivers/clk/qcom/gcc-msm8916.c | 1 + drivers/clk/qcom/gcc-msm8939.c | 1 + drivers/clk/qcom/gcc-msm8953.c | 1 + drivers/clk/qcom/gcc-msm8960.c | 1 + drivers/clk/qcom/gcc-msm8974.c | 1 + drivers/clk/qcom/gcc-msm8976.c | 1 + drivers/clk/qcom/gcc-msm8994.c | 1 + drivers/clk/qcom/gcc-msm8996.c | 1 + drivers/clk/qcom/gcc-msm8998.c | 1 + drivers/clk/qcom/gcc-qcm2290.c | 1 + drivers/clk/qcom/gcc-qcs404.c | 1 + drivers/clk/qcom/gcc-qdu1000.c | 1 + drivers/clk/qcom/gcc-sa8775p.c | 1 + drivers/clk/qcom/gcc-sc7180.c | 1 + drivers/clk/qcom/gcc-sc7280.c | 1 + drivers/clk/qcom/gcc-sc8180x.c | 1 + drivers/clk/qcom/gcc-sc8280xp.c | 1 + drivers/clk/qcom/gcc-sdm660.c | 1 + drivers/clk/qcom/gcc-sdm845.c | 1 + drivers/clk/qcom/gcc-sdx55.c | 1 + drivers/clk/qcom/gcc-sdx65.c | 1 + drivers/clk/qcom/gcc-sm6115.c | 1 + drivers/clk/qcom/gcc-sm6125.c | 1 + drivers/clk/qcom/gcc-sm6350.c | 1 + drivers/clk/qcom/gcc-sm6375.c | 1 + drivers/clk/qcom/gcc-sm7150.c | 1 + drivers/clk/qcom/gcc-sm8150.c | 1 + drivers/clk/qcom/gcc-sm8250.c | 1 + drivers/clk/qcom/gcc-sm8350.c | 1 + drivers/clk/qcom/gcc-sm8450.c | 1 + drivers/clk/qcom/gcc-sm8550.c | 1 + drivers/clk/qcom/gdsc.c | 26 ++++++++++++++++++++++++++ drivers/clk/qcom/gdsc.h | 6 ++++++ drivers/clk/qcom/gpucc-msm8998.c | 1 + drivers/clk/qcom/gpucc-sc7180.c | 1 + drivers/clk/qcom/gpucc-sc7280.c | 1 + drivers/clk/qcom/gpucc-sc8280xp.c | 1 + drivers/clk/qcom/gpucc-sdm660.c | 1 + drivers/clk/qcom/gpucc-sdm845.c | 1 + drivers/clk/qcom/gpucc-sm6115.c | 1 + drivers/clk/qcom/gpucc-sm6125.c | 1 + drivers/clk/qcom/gpucc-sm6350.c | 1 + drivers/clk/qcom/gpucc-sm6375.c | 1 + drivers/clk/qcom/gpucc-sm8150.c | 1 + drivers/clk/qcom/gpucc-sm8250.c | 1 + drivers/clk/qcom/gpucc-sm8350.c | 1 + drivers/clk/qcom/lcc-ipq806x.c | 1 + drivers/clk/qcom/lpassaudiocc-sc7280.c | 1 + drivers/clk/qcom/lpasscc-sc7280.c | 1 + drivers/clk/qcom/lpasscorecc-sc7180.c | 2 ++ drivers/clk/qcom/lpasscorecc-sc7280.c | 2 ++ drivers/clk/qcom/mmcc-apq8084.c | 1 + drivers/clk/qcom/mmcc-msm8974.c | 1 + drivers/clk/qcom/mmcc-msm8994.c | 1 + drivers/clk/qcom/mmcc-msm8996.c | 1 + drivers/clk/qcom/mmcc-msm8998.c | 1 + drivers/clk/qcom/mmcc-sdm660.c | 1 + drivers/clk/qcom/videocc-sc7180.c | 1 + drivers/clk/qcom/videocc-sc7280.c | 1 + drivers/clk/qcom/videocc-sdm845.c | 1 + drivers/clk/qcom/videocc-sm8150.c | 1 + drivers/clk/qcom/videocc-sm8250.c | 1 + drivers/soc/qcom/rpmhpd.c | 19 +++++++------------ include/linux/pm_domain.h | 4 ++++ 92 files changed, 161 insertions(+), 20 deletions(-)
Signature · 1 line
2.34.1
PATCH v3 1/4 PM: domains: Allow power off queuing from providers
In some cases, the providers might choose to refuse powering off some domains until all of the consumers have had a chance to probe, that is, until sync state callback has been called. Such providers might choose to disable such domains on their own, from the sync state callback. So, in order to do that, they need a way to queue up a power off request. Since the generic genpd already has such API, make that available to those providers.
--- drivers/base/power/domain.c | 18 ++++++++++-------- include/linux/pm_domain.h | 4 ++++ 2 files changed, 14 insertions(+), 8 deletions(-)
drivers/base/power/domain.c +10 -8
@@ -643,16 +643,18 @@ static int _genpd_power_off(struct generic_pm_domain *genpd, bool timed) }/** -* genpd_queue_power_off_work - Queue up the execution of genpd_power_off(). +* pm_genpd_queue_power_off - Queue up the execution of genpd_power_off(). * @genpd: PM domain to power off. * * Queue up the execution of genpd_power_off() unless it's already been done -* before. +* before. The sole purpose of this being exported is to allow the providers +* to disable the unused domains from their sync_state callback. */ -static void genpd_queue_power_off_work (struct generic_pm_domain *genpd) +void pm_genpd_queue_power_off (struct generic_pm_domain *genpd) {queue_work (pm_wq, &genpd->power_off_work); } +EXPORT_SYMBOL_GPL (pm_genpd_queue_power_off);/** * genpd_power_off - Remove power from a given PM domain.
@@ -1096,7 +1098,7 @@ static int __init genpd_power_off_unused(void)mutex_lock (&gpd_list_lock);list_for_each_entry (genpd, &gpd_list, gpd_list_node) -genpd_queue_power_off_work (genpd); +pm_genpd_queue_power_off (genpd);mutex_unlock (&gpd_list_lock);
@@ -1431,7 +1433,7 @@ static void genpd_complete(struct device *dev) genpd->prepared_count--;if (!genpd->prepared_count) -genpd_queue_power_off_work (genpd); +pm_genpd_queue_power_off (genpd);genpd_unlock (genpd); }
@@ -2703,7 +2705,7 @@ static void genpd_dev_pm_detach(struct device *dev, bool power_off) }/* Check if PM domain can be powered off after removing this device. */ -genpd_queue_power_off_work (pd); +pm_genpd_queue_power_off (pd);/* Unregister the device if it was created by genpd. */ if (dev->bus == &genpd_bus_type)
@@ -2718,7 +2720,7 @@ static void genpd_dev_pm_sync(struct device *dev)if (IS_ERR (pd))return ; -genpd_queue_power_off_work (pd); +pm_genpd_queue_power_off (pd); } static int __genpd_dev_pm_attach(struct device *dev, struct device *base_dev,
@@ -2879,7 +2881,7 @@ struct device *genpd_dev_pm_attach_by_id(struct device *dev, }pm_runtime_enable (virt_dev); -genpd_queue_power_off_work (dev_to_genpd (virt_dev)); +pm_genpd_queue_power_off (dev_to_genpd (virt_dev));return virt_dev; }
include/linux/pm_domain.h +4 -0
@@ -231,6 +231,7 @@ int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,int pm_genpd_init (struct generic_pm_domain *genpd,struct dev_power_governor *gov,bool is_off);int pm_genpd_remove (struct generic_pm_domain *genpd); +void pm_genpd_queue_power_off (struct generic_pm_domain *genpd);int dev_pm_genpd_set_performance_state (struct device *dev,unsigned int state);int dev_pm_genpd_add_notifier (struct device *dev,struct notifier_block *nb);int dev_pm_genpd_remove_notifier (struct device *dev);
@@ -278,6 +279,9 @@ static inline int pm_genpd_remove(struct generic_pm_domain *genpd)return -EOPNOTSUPP ; } +static inline void pm_genpd_queue_power_off (struct generic_pm_domain *genpd) +{ } +static inline int dev_pm_genpd_set_performance_state (struct device *dev,unsigned int state) {
Signature · 1 line
2.34.1
PATCH v3 2/4 soc: qcom: rpmhpd: Do proper power off when state synced
In reply to Abel VesaInstead of aggregating different corner values on sync state callback, call the genpd API for queuing up the power off. This will also mark the domain as powered off in the debugfs genpd summary. Also, until sync state has been reached, return busy on power off request, in order to allow genpd core to know that the actual domain hasn't been powered of from the "disable unused" late initcall.
--- drivers/soc/qcom/rpmhpd.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)
drivers/soc/qcom/rpmhpd.c +7 -12
@@ -649,8 +649,12 @@ static int rpmhpd_power_off(struct generic_pm_domain *domain)mutex_lock (&rpmhpd_lock); ret =rpmhpd_aggregate_corner (pd,0 ); -if (!ret) - pd->enabled = false; +if (!ret) { +if (!pd->state_synced) + ret = -EBUSY ; +else + pd->enabled = false; + }mutex_unlock (&rpmhpd_lock);
@@ -810,10 +814,8 @@ static void rpmhpd_sync_state(struct device *dev) {const struct rpmhpd_desc *desc =of_device_get_match_data (dev);struct rpmhpd **rpmhpds = desc->rpmhpds; -unsigned int corner;struct rpmhpd *pd;unsigned int i; -int ret;mutex_lock (&rpmhpd_lock);for (i =0 ; i < desc->num_pds; i++) {
@@ -822,14 +824,7 @@ static void rpmhpd_sync_state(struct device *dev)continue ; pd->state_synced = true; -if (pd->enabled) - corner =max (pd->corner, pd->enable_corner); -else - corner =0 ; - - ret =rpmhpd_aggregate_corner (pd, corner); -if (ret) -dev_err (dev,"failed to sync %s\n" , pd->res_name); +pm_genpd_queue_power_off (&pd->pd); }mutex_unlock (&rpmhpd_lock); }
Signature · 1 line
2.34.1
Bjorn Andersson
maintainerRe: [PATCH v3 2/4] soc: qcom: rpmhpd: Do proper power off when state synced
Quoted 44 lines · Abel Vesa
Instead of aggregating different corner values on sync state callback, call the genpd API for queuing up the power off. This will also mark the domain as powered off in the debugfs genpd summary. Also, until sync state has been reached, return busy on power off request, in order to allow genpd core to know that the actual domain hasn't been powered of from the "disable unused" late initcall.
Signed-off-by Abel Vesa <[email protected]>Reviewed-by Ulf Hansson <[email protected]>--- drivers/soc/qcom/rpmhpd.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)drivers/soc/qcom/rpmhpd.c +6
-4@@ -649,8 +649,12 @@ static int rpmhpd_power_off(struct generic_pm_domain *domain)mutex_lock (&rpmhpd_lock); ret =rpmhpd_aggregate_corner (pd,0 ); -if (!ret) - pd->enabled = false; +if (!ret) { +if (!pd->state_synced) + ret = -EBUSY ; +else + pd->enabled = false; + }mutex_unlock (&rpmhpd_lock);@@ -810,10 +814,8 @@ static void rpmhpd_sync_state(struct device *dev) {const struct rpmhpd_desc *desc =of_device_get_match_data (dev);struct rpmhpd **rpmhpds = desc->rpmhpds; -unsigned int corner;struct rpmhpd *pd;unsigned int i; -int ret;mutex_lock (&rpmhpd_lock);for (i =0 ; i < desc->num_pds; i++) {
drivers/soc/qcom/rpmhpd.c static void rpmhpd_sync_state(struct device *dev) · line 826
Quoted 5 lines
drivers/soc/qcom/rpmhpd.c +0
-2@@ -822,14 +824,7 @@ static void rpmhpd_sync_state(struct device *dev)continue ; pd->state_synced = true; -if (pd->enabled) - corner =max (pd->corner, pd->enable_corner);
Note that the intent of this line is to lower the corner from max to either a requested performance_state or the lowest non-disabled corner. I don't think your solution maintains this behavior?
drivers/soc/qcom/rpmhpd.c static void rpmhpd_sync_state(struct device *dev) · line 827
Quoted 7 lines
drivers/soc/qcom/rpmhpd.c +1
-6-else - corner =0 ; - - ret =rpmhpd_aggregate_corner (pd, corner); -if (ret) -dev_err (dev,"failed to sync %s\n" , pd->res_name); +pm_genpd_queue_power_off (&pd->pd);
In the event that the power-domain has a single device attached, and no subdomains, wouldn't pm_genpd_queue_power_off() pass straight through all checks and turn off the power domain? Perhaps I'm just missing something?
Regards,
Bjorn
Quoted 6 lines
drivers/soc/qcom/rpmhpd.c +0
-0}mutex_unlock (&rpmhpd_lock); }Signature · 1 line
2.34.1
PATCH v3 3/4 clk: qcom: gdsc: Avoid actual power off until sync state
In reply to Abel VesaIn case there is a sync state callback registered for a provider, do not actually power off any gdsc for that provider until sync state has been reached and return busy instead. Since the qcom_cc is private, add a helper that returns the gdsc_desc based on the device of the provider. Finally, add the generic gdsc sync state callback to be used by the platform specific providers.
--- drivers/clk/qcom/common.c | 19 +++++++++++++++++++ drivers/clk/qcom/common.h | 2 ++ drivers/clk/qcom/gdsc.c | 26 ++++++++++++++++++++++++++ drivers/clk/qcom/gdsc.h | 6 ++++++ 4 files changed, 53 insertions(+)
drivers/clk/qcom/common.c +19 -0
@@ -20,6 +20,7 @@struct qcom_cc {struct qcom_reset_controller reset;struct clk_regmap **rclks; +struct gdsc_desc *scd;size_t num_rclks; };
@@ -234,6 +235,13 @@ static struct clk_hw *qcom_cc_clk_hw_get(struct of_phandle_args *clkspec,return cc->rclks[idx] ? &cc->rclks[idx]->hw :NULL ; } +struct gdsc_desc *qcom_cc_get_gdsc_desc (struct device *dev) +{ +struct qcom_cc *cc =dev_get_drvdata (dev); + +return cc->scd; +} +int qcom_cc_really_probe (struct platform_device *pdev,const struct qcom_cc_desc *desc,struct regmap *regmap) {
@@ -251,6 +259,8 @@ int qcom_cc_really_probe(struct platform_device *pdev,if (!cc)return -ENOMEM ; +dev_set_drvdata (dev, cc); + reset = &cc->reset; reset->rcdev.of_node = dev->of_node; reset->rcdev.ops = &qcom_reset_ops;
@@ -267,6 +277,9 @@ int qcom_cc_really_probe(struct platform_device *pdev, scd =devm_kzalloc (dev,sizeof (*scd),GFP_KERNEL );if (!scd)return -ENOMEM ; + + cc->scd = scd; + scd->dev = dev; scd->scs = desc->gdscs; scd->num = desc->num_gdscs;
@@ -319,6 +332,12 @@ int qcom_cc_probe(struct platform_device *pdev, const struct qcom_cc_desc *desc) }EXPORT_SYMBOL_GPL (qcom_cc_probe); +void qcom_cc_sync_state (struct device *dev) +{ +gdsc_sync_state (dev); +} +EXPORT_SYMBOL_GPL (qcom_cc_sync_state); +int qcom_cc_probe_by_index (struct platform_device *pdev,int index,const struct qcom_cc_desc *desc) {
drivers/clk/qcom/common.h +2 -0
@@ -61,9 +61,11 @@ extern struct regmap *qcom_cc_map(struct platform_device *pdev,extern int qcom_cc_really_probe (struct platform_device *pdev,const struct qcom_cc_desc *desc,struct regmap *regmap); +extern struct gdsc_desc *qcom_cc_get_gdsc_desc (struct device *dev);extern int qcom_cc_probe (struct platform_device *pdev,const struct qcom_cc_desc *desc);extern int qcom_cc_probe_by_index (struct platform_device *pdev,int index,const struct qcom_cc_desc *desc); +extern void qcom_cc_sync_state (struct device *dev);#endif
drivers/clk/qcom/gdsc.c +26 -0
@@ -15,6 +15,8 @@#include <linux/regulator/consumer.h> #include <linux/reset-controller.h> #include <linux/slab.h> + +#include "common.h" #include "gdsc.h" #define PWR_ON_MASK BIT(31)
@@ -319,6 +321,9 @@ static int gdsc_disable(struct generic_pm_domain *domain)struct gdsc *sc =domain_to_gdsc (domain);int ret; +if (!sc->state_synced) +return -EBUSY ; +if (sc->pwrsts ==PWRSTS_ON )return gdsc_assert_reset (sc);
@@ -365,6 +370,7 @@ static int gdsc_disable(struct generic_pm_domain *domain)static int gdsc_init (struct gdsc *sc) { +struct device *dev = sc->dev;u32 mask, val;int on, ret;
@@ -452,6 +458,9 @@ static int gdsc_init(struct gdsc *sc)if (!sc->pd.power_on) sc->pd.power_on = gdsc_enable; +if (!dev_has_sync_state (dev)) + sc->state_synced = true; + ret =pm_genpd_init (&sc->pd,NULL , !on);if (ret) goto err_disable_supply;
@@ -496,6 +505,7 @@ int gdsc_register(struct gdsc_desc *desc,for (i =0 ; i < num; i++) {if (!scs[i])continue ; + scs[i]->dev = dev; scs[i]->regmap = regmap; scs[i]->rcdev = rcdev; ret =gdsc_init (scs[i]);
@@ -536,6 +546,22 @@ void gdsc_unregister(struct gdsc_desc *desc)of_genpd_del_provider (dev->of_node); } +void gdsc_sync_state (struct device *dev) +{ +struct gdsc_desc *scd =qcom_cc_get_gdsc_desc (dev); +struct gdsc **scs = scd->scs; +size_t num = scd->num; +int i; + +for (i =0 ; i < num; i++) { +if (!scs[i]) +continue ; + + scs[i]->state_synced = true; +pm_genpd_queue_power_off (&scs[i]->pd); + } +} +/* * On SDM845+ the GPU GX domain is *almost* entirely controlled by the GMU * running in the CX domain so the CPU doesn't need to know anything about the
drivers/clk/qcom/gdsc.h +6 -0
@@ -35,6 +35,7 @@ struct gdsc {struct generic_pm_domain pd;struct generic_pm_domain *parent;struct regmap *regmap; +struct device *dev;unsigned int gdscr;unsigned int collapse_ctrl;unsigned int collapse_mask;
@@ -73,6 +74,8 @@ struct gdsc {const char *supply;struct regulator *rsupply; + +bool state_synced; };struct gdsc_desc {
@@ -86,6 +89,7 @@ int gdsc_register(struct gdsc_desc *desc, struct reset_controller_dev *, struct regmap *);void gdsc_unregister (struct gdsc_desc *desc);int gdsc_gx_do_nothing_enable (struct generic_pm_domain *domain); +void gdsc_sync_state (struct device *dev);#else static inline int gdsc_register(struct gdsc_desc *desc, struct reset_controller_dev *rcdev,
@@ -94,6 +98,8 @@ static inline int gdsc_register(struct gdsc_desc *desc,return -ENOSYS ; } +static inline void gdsc_sync_state (struct device *dev) { } +static inline void gdsc_unregister (struct gdsc_desc *desc) {};#endif /* CONFIG_QCOM_GDSC */ #endif /* __QCOM_GDSC_H__ */
Signature · 1 line
2.34.1
PATCH v3 4/4 clk: qcom: Add sync state callback to all providers
In reply to Abel VesaNow that we have support for sync state delayed disabling of unused power domains and a provided generic qcom_cc sync state callback, add it to all the providers for all platforms that actually registers GDSCs.
--- drivers/clk/qcom/apss-ipq6018.c | 1 + drivers/clk/qcom/camcc-sc7180.c | 1 + drivers/clk/qcom/camcc-sc7280.c | 1 + drivers/clk/qcom/camcc-sdm845.c | 1 + drivers/clk/qcom/camcc-sm6350.c | 1 + drivers/clk/qcom/camcc-sm8250.c | 1 + drivers/clk/qcom/camcc-sm8450.c | 1 + drivers/clk/qcom/dispcc-qcm2290.c | 1 + drivers/clk/qcom/dispcc-sc7180.c | 1 + drivers/clk/qcom/dispcc-sc7280.c | 1 + drivers/clk/qcom/dispcc-sc8280xp.c | 1 + drivers/clk/qcom/dispcc-sdm845.c | 1 + drivers/clk/qcom/dispcc-sm6115.c | 1 + drivers/clk/qcom/dispcc-sm6125.c | 1 + drivers/clk/qcom/dispcc-sm6350.c | 1 + drivers/clk/qcom/dispcc-sm6375.c | 1 + drivers/clk/qcom/dispcc-sm8250.c | 1 + drivers/clk/qcom/dispcc-sm8450.c | 1 + drivers/clk/qcom/dispcc-sm8550.c | 1 + drivers/clk/qcom/gcc-apq8084.c | 1 + drivers/clk/qcom/gcc-ipq806x.c | 1 + drivers/clk/qcom/gcc-ipq8074.c | 1 + drivers/clk/qcom/gcc-mdm9615.c | 1 + drivers/clk/qcom/gcc-msm8660.c | 1 + drivers/clk/qcom/gcc-msm8909.c | 1 + drivers/clk/qcom/gcc-msm8916.c | 1 + drivers/clk/qcom/gcc-msm8939.c | 1 + drivers/clk/qcom/gcc-msm8953.c | 1 + drivers/clk/qcom/gcc-msm8960.c | 1 + drivers/clk/qcom/gcc-msm8974.c | 1 + drivers/clk/qcom/gcc-msm8976.c | 1 + drivers/clk/qcom/gcc-msm8994.c | 1 + drivers/clk/qcom/gcc-msm8996.c | 1 + drivers/clk/qcom/gcc-msm8998.c | 1 + drivers/clk/qcom/gcc-qcm2290.c | 1 + drivers/clk/qcom/gcc-qcs404.c | 1 + drivers/clk/qcom/gcc-qdu1000.c | 1 + drivers/clk/qcom/gcc-sa8775p.c | 1 + drivers/clk/qcom/gcc-sc7180.c | 1 + drivers/clk/qcom/gcc-sc7280.c | 1 + drivers/clk/qcom/gcc-sc8180x.c | 1 + drivers/clk/qcom/gcc-sc8280xp.c | 1 + drivers/clk/qcom/gcc-sdm660.c | 1 + drivers/clk/qcom/gcc-sdm845.c | 1 + drivers/clk/qcom/gcc-sdx55.c | 1 + drivers/clk/qcom/gcc-sdx65.c | 1 + drivers/clk/qcom/gcc-sm6115.c | 1 + drivers/clk/qcom/gcc-sm6125.c | 1 + drivers/clk/qcom/gcc-sm6350.c | 1 + drivers/clk/qcom/gcc-sm6375.c | 1 + drivers/clk/qcom/gcc-sm7150.c | 1 + drivers/clk/qcom/gcc-sm8150.c | 1 + drivers/clk/qcom/gcc-sm8250.c | 1 + drivers/clk/qcom/gcc-sm8350.c | 1 + drivers/clk/qcom/gcc-sm8450.c | 1 + drivers/clk/qcom/gcc-sm8550.c | 1 + drivers/clk/qcom/gpucc-msm8998.c | 1 + drivers/clk/qcom/gpucc-sc7180.c | 1 + drivers/clk/qcom/gpucc-sc7280.c | 1 + drivers/clk/qcom/gpucc-sc8280xp.c | 1 + drivers/clk/qcom/gpucc-sdm660.c | 1 + drivers/clk/qcom/gpucc-sdm845.c | 1 + drivers/clk/qcom/gpucc-sm6115.c | 1 + drivers/clk/qcom/gpucc-sm6125.c | 1 + drivers/clk/qcom/gpucc-sm6350.c | 1 + drivers/clk/qcom/gpucc-sm6375.c | 1 + drivers/clk/qcom/gpucc-sm8150.c | 1 + drivers/clk/qcom/gpucc-sm8250.c | 1 + drivers/clk/qcom/gpucc-sm8350.c | 1 + drivers/clk/qcom/lcc-ipq806x.c | 1 + drivers/clk/qcom/lpassaudiocc-sc7280.c | 1 + drivers/clk/qcom/lpasscc-sc7280.c | 1 + drivers/clk/qcom/lpasscorecc-sc7180.c | 2 ++ drivers/clk/qcom/lpasscorecc-sc7280.c | 2 ++ drivers/clk/qcom/mmcc-apq8084.c | 1 + drivers/clk/qcom/mmcc-msm8974.c | 1 + drivers/clk/qcom/mmcc-msm8994.c | 1 + drivers/clk/qcom/mmcc-msm8996.c | 1 + drivers/clk/qcom/mmcc-msm8998.c | 1 + drivers/clk/qcom/mmcc-sdm660.c | 1 + drivers/clk/qcom/videocc-sc7180.c | 1 + drivers/clk/qcom/videocc-sc7280.c | 1 + drivers/clk/qcom/videocc-sdm845.c | 1 + drivers/clk/qcom/videocc-sm8150.c | 1 + drivers/clk/qcom/videocc-sm8250.c | 1 + 85 files changed, 87 insertions(+)
drivers/clk/qcom/apss-ipq6018.c +1 -0
@@ -96,6 +96,7 @@ static struct platform_driver apss_ipq6018_driver = { .probe = apss_ipq6018_probe, .driver = { .name = "qcom,apss-ipq6018-clk", + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/camcc-sc7180.c +1 -0
@@ -1695,6 +1695,7 @@ static struct platform_driver cam_cc_sc7180_driver = { .name = "cam_cc-sc7180", .of_match_table = cam_cc_sc7180_match_table, .pm = &cam_cc_pm_ops, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/camcc-sc7280.c +1 -0
@@ -2465,6 +2465,7 @@ static struct platform_driver cam_cc_sc7280_driver = { .driver = { .name = "cam_cc-sc7280", .of_match_table = cam_cc_sc7280_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/camcc-sdm845.c +1 -0
@@ -1743,6 +1743,7 @@ static struct platform_driver cam_cc_sdm845_driver = { .driver = { .name = "sdm845-camcc", .of_match_table = cam_cc_sdm845_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/camcc-sm6350.c +1 -0
@@ -1887,6 +1887,7 @@ static struct platform_driver camcc_sm6350_driver = { .driver = { .name = "sm6350-camcc", .of_match_table = camcc_sm6350_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/camcc-sm8250.c +1 -0
@@ -2441,6 +2441,7 @@ static struct platform_driver cam_cc_sm8250_driver = { .driver = { .name = "cam_cc-sm8250", .of_match_table = cam_cc_sm8250_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/camcc-sm8450.c +1 -0
@@ -2847,6 +2847,7 @@ static struct platform_driver cam_cc_sm8450_driver = { .driver = { .name = "camcc-sm8450", .of_match_table = cam_cc_sm8450_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/dispcc-qcm2290.c +1 -0
@@ -530,6 +530,7 @@ static struct platform_driver disp_cc_qcm2290_driver = { .driver = { .name = "dispcc-qcm2290", .of_match_table = disp_cc_qcm2290_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/dispcc-sc7180.c +1 -0
@@ -721,6 +721,7 @@ static struct platform_driver disp_cc_sc7180_driver = { .driver = { .name = "sc7180-dispcc", .of_match_table = disp_cc_sc7180_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/dispcc-sc7280.c +1 -0
@@ -892,6 +892,7 @@ static struct platform_driver disp_cc_sc7280_driver = { .driver = { .name = "disp_cc-sc7280", .of_match_table = disp_cc_sc7280_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/dispcc-sc8280xp.c +1 -0
@@ -3199,6 +3199,7 @@ static struct platform_driver disp_cc_sc8280xp_driver = { .driver = { .name = "disp_cc-sc8280xp", .of_match_table = disp_cc_sc8280xp_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/dispcc-sdm845.c +1 -0
@@ -869,6 +869,7 @@ static struct platform_driver disp_cc_sdm845_driver = { .driver = { .name = "disp_cc-sdm845", .of_match_table = disp_cc_sdm845_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/dispcc-sm6115.c +1 -0
@@ -600,6 +600,7 @@ static struct platform_driver disp_cc_sm6115_driver = { .driver = { .name = "dispcc-sm6115", .of_match_table = disp_cc_sm6115_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/dispcc-sm6125.c +1 -0
@@ -690,6 +690,7 @@ static struct platform_driver disp_cc_sm6125_driver = { .driver = { .name = "disp_cc-sm6125", .of_match_table = disp_cc_sm6125_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/dispcc-sm6350.c +1 -0
@@ -778,6 +778,7 @@ static struct platform_driver disp_cc_sm6350_driver = { .driver = { .name = "disp_cc-sm6350", .of_match_table = disp_cc_sm6350_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/dispcc-sm6375.c +1 -0
@@ -591,6 +591,7 @@ static struct platform_driver disp_cc_sm6375_driver = { .driver = { .name = "disp_cc-sm6375", .of_match_table = disp_cc_sm6375_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/dispcc-sm8250.c +1 -0
@@ -1380,6 +1380,7 @@ static struct platform_driver disp_cc_sm8250_driver = { .driver = { .name = "disp_cc-sm8250", .of_match_table = disp_cc_sm8250_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/dispcc-sm8450.c +1 -0
@@ -1803,6 +1803,7 @@ static struct platform_driver disp_cc_sm8450_driver = { .driver = { .name = "disp_cc-sm8450", .of_match_table = disp_cc_sm8450_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/dispcc-sm8550.c +1 -0
@@ -1788,6 +1788,7 @@ static struct platform_driver disp_cc_sm8550_driver = { .driver = { .name = "disp_cc-sm8550", .of_match_table = disp_cc_sm8550_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-apq8084.c +1 -0
@@ -3642,6 +3642,7 @@ static struct platform_driver gcc_apq8084_driver = { .driver = { .name = "gcc-apq8084", .of_match_table = gcc_apq8084_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-ipq806x.c +1 -0
@@ -3428,6 +3428,7 @@ static struct platform_driver gcc_ipq806x_driver = { .driver = { .name = "gcc-ipq806x", .of_match_table = gcc_ipq806x_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-ipq8074.c +1 -0
@@ -4741,6 +4741,7 @@ static struct platform_driver gcc_ipq8074_driver = { .driver = { .name = "qcom,gcc-ipq8074", .of_match_table = gcc_ipq8074_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-mdm9615.c +1 -0
@@ -1720,6 +1720,7 @@ static struct platform_driver gcc_mdm9615_driver = { .driver = { .name = "gcc-mdm9615", .of_match_table = gcc_mdm9615_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-msm8660.c +1 -0
@@ -2775,6 +2775,7 @@ static struct platform_driver gcc_msm8660_driver = { .driver = { .name = "gcc-msm8660", .of_match_table = gcc_msm8660_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-msm8909.c +1 -0
@@ -2711,6 +2711,7 @@ static struct platform_driver gcc_msm8909_driver = { .driver = { .name = "gcc-msm8909", .of_match_table = gcc_msm8909_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-msm8916.c +1 -0
@@ -3448,6 +3448,7 @@ static struct platform_driver gcc_msm8916_driver = { .driver = { .name = "gcc-msm8916", .of_match_table = gcc_msm8916_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-msm8939.c +1 -0
@@ -4013,6 +4013,7 @@ static struct platform_driver gcc_msm8939_driver = { .driver = { .name = "gcc-msm8939", .of_match_table = gcc_msm8939_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-msm8953.c +1 -0
@@ -4230,6 +4230,7 @@ static struct platform_driver gcc_msm8953_driver = { .driver = { .name = "gcc-msm8953", .of_match_table = gcc_msm8953_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-msm8960.c +1 -0
@@ -3768,6 +3768,7 @@ static struct platform_driver gcc_msm8960_driver = { .driver = { .name = "gcc-msm8960", .of_match_table = gcc_msm8960_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-msm8974.c +1 -0
@@ -2904,6 +2904,7 @@ static struct platform_driver gcc_msm8974_driver = { .driver = { .name = "gcc-msm8974", .of_match_table = gcc_msm8974_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-msm8976.c +1 -0
@@ -4137,6 +4137,7 @@ static struct platform_driver gcc_msm8976_driver = { .driver = { .name = "qcom,gcc-msm8976", .of_match_table = gcc_msm8976_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-msm8994.c +1 -0
@@ -2712,6 +2712,7 @@ static struct platform_driver gcc_msm8994_driver = { .driver = { .name = "gcc-msm8994", .of_match_table = gcc_msm8994_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-msm8996.c +1 -0
@@ -3856,6 +3856,7 @@ static struct platform_driver gcc_msm8996_driver = { .driver = { .name = "gcc-msm8996", .of_match_table = gcc_msm8996_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-msm8998.c +1 -0
@@ -3249,6 +3249,7 @@ static struct platform_driver gcc_msm8998_driver = { .driver = { .name = "gcc-msm8998", .of_match_table = gcc_msm8998_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-qcm2290.c +1 -0
@@ -3002,6 +3002,7 @@ static struct platform_driver gcc_qcm2290_driver = { .driver = { .name = "gcc-qcm2290", .of_match_table = gcc_qcm2290_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-qcs404.c +1 -0
@@ -2832,6 +2832,7 @@ static struct platform_driver gcc_qcs404_driver = { .driver = { .name = "gcc-qcs404", .of_match_table = gcc_qcs404_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-qdu1000.c +1 -0
@@ -2634,6 +2634,7 @@ static struct platform_driver gcc_qdu1000_driver = { .driver = { .name = "gcc-qdu1000", .of_match_table = gcc_qdu1000_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sa8775p.c +1 -0
@@ -4766,6 +4766,7 @@ static struct platform_driver gcc_sa8775p_driver = { .driver = { .name = "sa8775p-gcc", .of_match_table = gcc_sa8775p_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sc7180.c +1 -0
@@ -2469,6 +2469,7 @@ static struct platform_driver gcc_sc7180_driver = { .driver = { .name = "gcc-sc7180", .of_match_table = gcc_sc7180_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sc7280.c +1 -0
@@ -3480,6 +3480,7 @@ static struct platform_driver gcc_sc7280_driver = { .driver = { .name = "gcc-sc7280", .of_match_table = gcc_sc7280_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sc8180x.c +1 -0
@@ -4610,6 +4610,7 @@ static struct platform_driver gcc_sc8180x_driver = { .driver = { .name = "gcc-sc8180x", .of_match_table = gcc_sc8180x_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sc8280xp.c +1 -0
@@ -7441,6 +7441,7 @@ static struct platform_driver gcc_sc8280xp_driver = { .driver = { .name = "gcc-sc8280xp", .of_match_table = gcc_sc8280xp_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sdm660.c +1 -0
@@ -2485,6 +2485,7 @@ static struct platform_driver gcc_sdm660_driver = { .driver = { .name = "gcc-sdm660", .of_match_table = gcc_sdm660_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sdm845.c +1 -0
@@ -4020,6 +4020,7 @@ static struct platform_driver gcc_sdm845_driver = { .driver = { .name = "gcc-sdm845", .of_match_table = gcc_sdm845_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sdx55.c +1 -0
@@ -1628,6 +1628,7 @@ static struct platform_driver gcc_sdx55_driver = { .driver = { .name = "gcc-sdx55", .of_match_table = gcc_sdx55_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sdx65.c +1 -0
@@ -1591,6 +1591,7 @@ static struct platform_driver gcc_sdx65_driver = { .driver = { .name = "gcc-sdx65", .of_match_table = gcc_sdx65_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sm6115.c +1 -0
@@ -3512,6 +3512,7 @@ static struct platform_driver gcc_sm6115_driver = { .driver = { .name = "gcc-sm6115", .of_match_table = gcc_sm6115_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sm6125.c +1 -0
@@ -4170,6 +4170,7 @@ static struct platform_driver gcc_sm6125_driver = { .driver = { .name = "gcc-sm6125", .of_match_table = gcc_sm6125_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sm6350.c +1 -0
@@ -2566,6 +2566,7 @@ static struct platform_driver gcc_sm6350_driver = { .driver = { .name = "gcc-sm6350", .of_match_table = gcc_sm6350_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sm6375.c +1 -0
@@ -3902,6 +3902,7 @@ static struct platform_driver gcc_sm6375_driver = { .driver = { .name = "gcc-sm6375", .of_match_table = gcc_sm6375_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sm7150.c +1 -0
@@ -3029,6 +3029,7 @@ static struct platform_driver gcc_sm7150_driver = { .driver = { .name = "gcc-sm7150", .of_match_table = gcc_sm7150_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sm8150.c +1 -0
@@ -3795,6 +3795,7 @@ static struct platform_driver gcc_sm8150_driver = { .driver = { .name = "gcc-sm8150", .of_match_table = gcc_sm8150_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sm8250.c +1 -0
@@ -3668,6 +3668,7 @@ static struct platform_driver gcc_sm8250_driver = { .driver = { .name = "gcc-sm8250", .of_match_table = gcc_sm8250_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sm8350.c +1 -0
@@ -3855,6 +3855,7 @@ static struct platform_driver gcc_sm8350_driver = { .driver = { .name = "sm8350-gcc", .of_match_table = gcc_sm8350_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sm8450.c +1 -0
@@ -3262,6 +3262,7 @@ static struct platform_driver gcc_sm8450_driver = { .driver = { .name = "gcc-sm8450", .of_match_table = gcc_sm8450_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gcc-sm8550.c +1 -0
@@ -3368,6 +3368,7 @@ static struct platform_driver gcc_sm8550_driver = { .driver = { .name = "gcc-sm8550", .of_match_table = gcc_sm8550_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gpucc-msm8998.c +1 -0
@@ -343,6 +343,7 @@ static struct platform_driver gpucc_msm8998_driver = { .driver = { .name = "gpucc-msm8998", .of_match_table = gpucc_msm8998_match_table, + .sync_state = qcom_cc_sync_state, }, };module_platform_driver (gpucc_msm8998_driver);
drivers/clk/qcom/gpucc-sc7180.c +1 -0
@@ -249,6 +249,7 @@ static struct platform_driver gpu_cc_sc7180_driver = { .driver = { .name = "sc7180-gpucc", .of_match_table = gpu_cc_sc7180_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gpucc-sc7280.c +1 -0
@@ -473,6 +473,7 @@ static struct platform_driver gpu_cc_sc7280_driver = { .driver = { .name = "gpu_cc-sc7280", .of_match_table = gpu_cc_sc7280_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gpucc-sc8280xp.c +1 -0
@@ -453,6 +453,7 @@ static struct platform_driver gpu_cc_sc8280xp_driver = { .driver = { .name = "gpu_cc-sc8280xp", .of_match_table = gpu_cc_sc8280xp_match_table, + .sync_state = qcom_cc_sync_state, }, };module_platform_driver (gpu_cc_sc8280xp_driver);
drivers/clk/qcom/gpucc-sdm660.c +1 -0
@@ -339,6 +339,7 @@ static struct platform_driver gpucc_sdm660_driver = { .driver = { .name = "gpucc-sdm660", .of_match_table = gpucc_sdm660_match_table, + .sync_state = qcom_cc_sync_state, }, };module_platform_driver (gpucc_sdm660_driver);
drivers/clk/qcom/gpucc-sdm845.c +1 -0
@@ -200,6 +200,7 @@ static struct platform_driver gpu_cc_sdm845_driver = { .driver = { .name = "sdm845-gpucc", .of_match_table = gpu_cc_sdm845_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gpucc-sm6115.c +1 -0
@@ -495,6 +495,7 @@ static struct platform_driver gpu_cc_sm6115_driver = { .driver = { .name = "sm6115-gpucc", .of_match_table = gpu_cc_sm6115_match_table, + .sync_state = qcom_cc_sync_state, }, };module_platform_driver (gpu_cc_sm6115_driver);
drivers/clk/qcom/gpucc-sm6125.c +1 -0
@@ -416,6 +416,7 @@ static struct platform_driver gpu_cc_sm6125_driver = { .driver = { .name = "gpucc-sm6125", .of_match_table = gpu_cc_sm6125_match_table, + .sync_state = qcom_cc_sync_state, }, };module_platform_driver (gpu_cc_sm6125_driver);
drivers/clk/qcom/gpucc-sm6350.c +1 -0
@@ -502,6 +502,7 @@ static struct platform_driver gpu_cc_sm6350_driver = { .driver = { .name = "sm6350-gpucc", .of_match_table = gpu_cc_sm6350_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gpucc-sm6375.c +1 -0
@@ -449,6 +449,7 @@ static struct platform_driver gpucc_sm6375_driver = { .driver = { .name = "gpucc-sm6375", .of_match_table = gpucc_sm6375_match_table, + .sync_state = qcom_cc_sync_state, }, };module_platform_driver (gpucc_sm6375_driver);
drivers/clk/qcom/gpucc-sm8150.c +1 -0
@@ -312,6 +312,7 @@ static struct platform_driver gpu_cc_sm8150_driver = { .driver = { .name = "sm8150-gpucc", .of_match_table = gpu_cc_sm8150_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gpucc-sm8250.c +1 -0
@@ -328,6 +328,7 @@ static struct platform_driver gpu_cc_sm8250_driver = { .driver = { .name = "sm8250-gpucc", .of_match_table = gpu_cc_sm8250_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/gpucc-sm8350.c +1 -0
@@ -618,6 +618,7 @@ static struct platform_driver gpu_cc_sm8350_driver = { .driver = { .name = "sm8350-gpucc", .of_match_table = gpu_cc_sm8350_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/lcc-ipq806x.c +1 -0
@@ -463,6 +463,7 @@ static struct platform_driver lcc_ipq806x_driver = { .driver = { .name = "lcc-ipq806x", .of_match_table = lcc_ipq806x_match_table, + .sync_state = qcom_cc_sync_state, }, };module_platform_driver (lcc_ipq806x_driver);
drivers/clk/qcom/lpassaudiocc-sc7280.c +1 -0
@@ -863,6 +863,7 @@ static struct platform_driver lpass_aon_cc_sc7280_driver = { .name = "lpass_aon_cc-sc7280", .of_match_table = lpass_aon_cc_sc7280_match_table, .pm = &lpass_audio_cc_pm_ops, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/lpasscc-sc7280.c +1 -0
@@ -154,6 +154,7 @@ static struct platform_driver lpass_cc_sc7280_driver = { .driver = { .name = "sc7280-lpasscc", .of_match_table = lpass_cc_sc7280_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/lpasscorecc-sc7180.c +2 -0
@@ -469,6 +469,7 @@ static struct platform_driver lpass_core_cc_sc7180_driver = { .name = "lpass_core_cc-sc7180", .of_match_table = lpass_core_cc_sc7180_match_table, .pm = &lpass_pm_ops, + .sync_state = qcom_cc_sync_state, }, };
@@ -478,6 +479,7 @@ static struct platform_driver lpass_hm_sc7180_driver = { .name = "lpass_hm-sc7180", .of_match_table = lpass_hm_sc7180_match_table, .pm = &lpass_pm_ops, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/lpasscorecc-sc7280.c +2 -0
@@ -413,6 +413,7 @@ static struct platform_driver lpass_core_cc_sc7280_driver = { .driver = { .name = "lpass_core_cc-sc7280", .of_match_table = lpass_core_cc_sc7280_match_table, + .sync_state = qcom_cc_sync_state, }, };
@@ -438,6 +439,7 @@ static struct platform_driver lpass_hm_sc7280_driver = { .driver = { .name = "lpass_hm-sc7280", .of_match_table = lpass_hm_sc7280_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/mmcc-apq8084.c +1 -0
@@ -3145,6 +3145,7 @@ static struct platform_driver mmcc_apq8084_driver = { .driver = { .name = "mmcc-apq8084", .of_match_table = mmcc_apq8084_match_table, + .sync_state = qcom_cc_sync_state, }, };module_platform_driver (mmcc_apq8084_driver);
drivers/clk/qcom/mmcc-msm8974.c +1 -0
@@ -2801,6 +2801,7 @@ static struct platform_driver mmcc_msm8974_driver = { .driver = { .name = "mmcc-msm8974", .of_match_table = mmcc_msm8974_match_table, + .sync_state = qcom_cc_sync_state, }, };module_platform_driver (mmcc_msm8974_driver);
drivers/clk/qcom/mmcc-msm8994.c +1 -0
@@ -2611,6 +2611,7 @@ static struct platform_driver mmcc_msm8994_driver = { .driver = { .name = "mmcc-msm8994", .of_match_table = mmcc_msm8994_match_table, + .sync_state = qcom_cc_sync_state, }, };module_platform_driver (mmcc_msm8994_driver);
drivers/clk/qcom/mmcc-msm8996.c +1 -0
@@ -3635,6 +3635,7 @@ static struct platform_driver mmcc_msm8996_driver = { .driver = { .name = "mmcc-msm8996", .of_match_table = mmcc_msm8996_match_table, + .sync_state = qcom_cc_sync_state, }, };module_platform_driver (mmcc_msm8996_driver);
drivers/clk/qcom/mmcc-msm8998.c +1 -0
@@ -2881,6 +2881,7 @@ static struct platform_driver mmcc_msm8998_driver = { .driver = { .name = "mmcc-msm8998", .of_match_table = mmcc_msm8998_match_table, + .sync_state = qcom_cc_sync_state, }, };module_platform_driver (mmcc_msm8998_driver);
drivers/clk/qcom/mmcc-sdm660.c +1 -0
@@ -2859,6 +2859,7 @@ static struct platform_driver mmcc_660_driver = { .driver = { .name = "mmcc-sdm660", .of_match_table = mmcc_660_match_table, + .sync_state = qcom_cc_sync_state, }, };module_platform_driver (mmcc_660_driver);
drivers/clk/qcom/videocc-sc7180.c +1 -0
@@ -234,6 +234,7 @@ static struct platform_driver video_cc_sc7180_driver = { .driver = { .name = "sc7180-videocc", .of_match_table = video_cc_sc7180_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/videocc-sc7280.c +1 -0
@@ -306,6 +306,7 @@ static struct platform_driver video_cc_sc7280_driver = { .driver = { .name = "video_cc-sc7280", .of_match_table = video_cc_sc7280_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/videocc-sdm845.c +1 -0
@@ -337,6 +337,7 @@ static struct platform_driver video_cc_sdm845_driver = { .driver = { .name = "sdm845-videocc", .of_match_table = video_cc_sdm845_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/videocc-sm8150.c +1 -0
@@ -253,6 +253,7 @@ static struct platform_driver video_cc_sm8150_driver = { .driver = { .name = "video_cc-sm8150", .of_match_table = video_cc_sm8150_match_table, + .sync_state = qcom_cc_sync_state, }, };
drivers/clk/qcom/videocc-sm8250.c +1 -0
@@ -399,6 +399,7 @@ static struct platform_driver video_cc_sm8250_driver = { .driver = { .name = "sm8250-videocc", .of_match_table = video_cc_sm8250_match_table, + .sync_state = qcom_cc_sync_state, }, };
Signature · 1 line
2.34.1
Quoted 7 lines · Abel Vesa
There have been already a couple of tries to make the genpd "disable unused" late initcall skip the powering off of domains that might be needed until later on (i.e. until some consumer probes). The conclusion was that the provider could return
-EBUSYfrom thepower_offcallback until the provider's sync state has been reached. This patch series tries to provide a proof-of-concept that is working on Qualcomm platforms.
I'm giving my thoughts in the cover letter instead of spreading it around all the patches so that there's context between the comments.
1) Why can't all the logic in this patch series be implemented at the framework level? And then allow the drivers to opt into this behavior by setting the sync_state() callback.
That way, you can land it only for QC drivers by setting up sync_state() callback only for QC drivers, but actually have the same code function correctly for non-QC drivers too. And then once we have this functionality working properly for QC drivers for one kernel version (or two), we'll just have the framework set the device's driver's sync_state() if it doesn't have one already.
2) sync_state() is not just about power on/off. It's also about the power domain level. Can you handle that too please?
3) In your GDSC drivers, it's not clear to me if you are preventing power off until sync_state() only for GDSCs that were already on at boot. So if an off-at-boot GDSC gets turned on, and then you attempt to turn it off before all its consumers have probed, it'll fail to power it off even though that wasn't necessary?
4) The returning -EBUSY when a power off is attempted seems to be quite wasteful. The framework will go through the whole sequence of trying to power down, send the notifications and then fail and then send the undo notifications. Combined with point (2) I think this can be handled better at the aggregation level in the framework to avoid even going that far into the power off sequence.
-Saravana
Quoted 129 lines
I've been doing extensive testing on SM8450, but I've also spinned this on my X13s (SC8280XP). Both patches that add the sync state callback to the SC8280XP and SM8450 are here to provide context. Once we agree on the form, I intend to add the sync state callback to all gdsc providers.
Currently, some of the gdsc providers might not reach sync state due to list of consumers not probing yet (or at all). The sync state can be enforced by writing 1 to the
state_syncedsysfs attribute of the provider, thanks to Saravana's commit [1] which has been already merged.[1] https://lore.kernel.org/r/[email protected]
V2 (RFC) of this patchset was here:
https://lore.kernel.org/all/[email protected]/Changes since v2:
* renamedgenpd_queue_power_off_worktopm_genpd_queue_power_offand added comment about its purpose w.r.t. it being exported.
* added theqcom_ccgeneric sync state callback to all providers that register GDSCs, instead of SM8450 and SC8280XPChanges since v1:
* Added theqcom_ccsync state callback which calls in turn the gdsc one
* dropped extra semicolon frompm_domain.hAbel Vesa (4):
PM: domains: Allow power off queuing from providers
soc: qcom: rpmhpd: Do proper power off when state synced
clk: qcom: gdsc: Avoid actual power off until sync state
clk: qcom: Add sync state callback to all providersdrivers/base/power/domain.c | 18 ++++++++++-------- drivers/clk/qcom/apss-ipq6018.c | 1 + drivers/clk/qcom/camcc-sc7180.c | 1 + drivers/clk/qcom/camcc-sc7280.c | 1 + drivers/clk/qcom/camcc-sdm845.c | 1 + drivers/clk/qcom/camcc-sm6350.c | 1 + drivers/clk/qcom/camcc-sm8250.c | 1 + drivers/clk/qcom/camcc-sm8450.c | 1 + drivers/clk/qcom/common.c | 19 +++++++++++++++++++ drivers/clk/qcom/common.h | 2 ++ drivers/clk/qcom/dispcc-qcm2290.c | 1 + drivers/clk/qcom/dispcc-sc7180.c | 1 + drivers/clk/qcom/dispcc-sc7280.c | 1 + drivers/clk/qcom/dispcc-sc8280xp.c | 1 + drivers/clk/qcom/dispcc-sdm845.c | 1 + drivers/clk/qcom/dispcc-sm6115.c | 1 + drivers/clk/qcom/dispcc-sm6125.c | 1 + drivers/clk/qcom/dispcc-sm6350.c | 1 + drivers/clk/qcom/dispcc-sm6375.c | 1 + drivers/clk/qcom/dispcc-sm8250.c | 1 + drivers/clk/qcom/dispcc-sm8450.c | 1 + drivers/clk/qcom/dispcc-sm8550.c | 1 + drivers/clk/qcom/gcc-apq8084.c | 1 + drivers/clk/qcom/gcc-ipq806x.c | 1 + drivers/clk/qcom/gcc-ipq8074.c | 1 + drivers/clk/qcom/gcc-mdm9615.c | 1 + drivers/clk/qcom/gcc-msm8660.c | 1 + drivers/clk/qcom/gcc-msm8909.c | 1 + drivers/clk/qcom/gcc-msm8916.c | 1 + drivers/clk/qcom/gcc-msm8939.c | 1 + drivers/clk/qcom/gcc-msm8953.c | 1 + drivers/clk/qcom/gcc-msm8960.c | 1 + drivers/clk/qcom/gcc-msm8974.c | 1 + drivers/clk/qcom/gcc-msm8976.c | 1 + drivers/clk/qcom/gcc-msm8994.c | 1 + drivers/clk/qcom/gcc-msm8996.c | 1 + drivers/clk/qcom/gcc-msm8998.c | 1 + drivers/clk/qcom/gcc-qcm2290.c | 1 + drivers/clk/qcom/gcc-qcs404.c | 1 + drivers/clk/qcom/gcc-qdu1000.c | 1 + drivers/clk/qcom/gcc-sa8775p.c | 1 + drivers/clk/qcom/gcc-sc7180.c | 1 + drivers/clk/qcom/gcc-sc7280.c | 1 + drivers/clk/qcom/gcc-sc8180x.c | 1 + drivers/clk/qcom/gcc-sc8280xp.c | 1 + drivers/clk/qcom/gcc-sdm660.c | 1 + drivers/clk/qcom/gcc-sdm845.c | 1 + drivers/clk/qcom/gcc-sdx55.c | 1 + drivers/clk/qcom/gcc-sdx65.c | 1 + drivers/clk/qcom/gcc-sm6115.c | 1 + drivers/clk/qcom/gcc-sm6125.c | 1 + drivers/clk/qcom/gcc-sm6350.c | 1 + drivers/clk/qcom/gcc-sm6375.c | 1 + drivers/clk/qcom/gcc-sm7150.c | 1 + drivers/clk/qcom/gcc-sm8150.c | 1 + drivers/clk/qcom/gcc-sm8250.c | 1 + drivers/clk/qcom/gcc-sm8350.c | 1 + drivers/clk/qcom/gcc-sm8450.c | 1 + drivers/clk/qcom/gcc-sm8550.c | 1 + drivers/clk/qcom/gdsc.c | 26 ++++++++++++++++++++++++++ drivers/clk/qcom/gdsc.h | 6 ++++++ drivers/clk/qcom/gpucc-msm8998.c | 1 + drivers/clk/qcom/gpucc-sc7180.c | 1 + drivers/clk/qcom/gpucc-sc7280.c | 1 + drivers/clk/qcom/gpucc-sc8280xp.c | 1 + drivers/clk/qcom/gpucc-sdm660.c | 1 + drivers/clk/qcom/gpucc-sdm845.c | 1 + drivers/clk/qcom/gpucc-sm6115.c | 1 + drivers/clk/qcom/gpucc-sm6125.c | 1 + drivers/clk/qcom/gpucc-sm6350.c | 1 + drivers/clk/qcom/gpucc-sm6375.c | 1 + drivers/clk/qcom/gpucc-sm8150.c | 1 + drivers/clk/qcom/gpucc-sm8250.c | 1 + drivers/clk/qcom/gpucc-sm8350.c | 1 + drivers/clk/qcom/lcc-ipq806x.c | 1 + drivers/clk/qcom/lpassaudiocc-sc7280.c | 1 + drivers/clk/qcom/lpasscc-sc7280.c | 1 + drivers/clk/qcom/lpasscorecc-sc7180.c | 2 ++ drivers/clk/qcom/lpasscorecc-sc7280.c | 2 ++ drivers/clk/qcom/mmcc-apq8084.c | 1 + drivers/clk/qcom/mmcc-msm8974.c | 1 + drivers/clk/qcom/mmcc-msm8994.c | 1 + drivers/clk/qcom/mmcc-msm8996.c | 1 + drivers/clk/qcom/mmcc-msm8998.c | 1 + drivers/clk/qcom/mmcc-sdm660.c | 1 + drivers/clk/qcom/videocc-sc7180.c | 1 + drivers/clk/qcom/videocc-sc7280.c | 1 + drivers/clk/qcom/videocc-sdm845.c | 1 + drivers/clk/qcom/videocc-sm8150.c | 1 + drivers/clk/qcom/videocc-sm8250.c | 1 + drivers/soc/qcom/rpmhpd.c | 19 +++++++------------ include/linux/pm_domain.h | 4 ++++ 92 files changed, 161 insertions(+), 20 deletions(-)--
2.34.1
Quoted 16 lines · Saravana Kannan
Quoted 7 lines · Abel Vesa
There have been already a couple of tries to make the genpd "disable unused" late initcall skip the powering off of domains that might be needed until later on (i.e. until some consumer probes). The conclusion was that the provider could return
-EBUSYfrom thepower_offcallback until the provider's sync state has been reached. This patch series tries to provide a proof-of-concept that is working on Qualcomm platforms.I'm giving my thoughts in the cover letter instead of spreading it around all the patches so that there's context between the comments.
1) Why can't all the logic in this patch series be implemented at the framework level? And then allow the drivers to opt into this behavior by setting the
sync_state()callback.
Quoted 6 lines
That way, you can land it only for QC drivers by setting up
sync_state()callback only for QC drivers, but actually have the same code function correctly for non-QC drivers too. And then once we have this functionality working properly for QC drivers for one kernel version (or two), we'll just have the framework set the device's driver'ssync_state()if it doesn't have one already.
I think Ulf has already NACK'ed that approach here:
[1] https://lore.kernel.org/lkml/CAPDyKFon35wcQ+5kx3QZb-awN_S_q8y1Sir-G+GoxkCvpN=iiA@mail.gmail.com/
And suggested this new approach that this patch series proposes. (Unless I missunderstood his point)
Quoted 3 lines
2)
sync_state()is not just about power on/off. It's also about the power domain level. Can you handle that too please?
Well, this patchset only tries to delay the disabling of unused power domains until all consumers have had a chance to probe. So we use sync state only to queue up a power-off request to make sure those unused ones get disabled.
Quoted 6 lines
3) In your GDSC drivers, it's not clear to me if you are preventing power off until
sync_state()only for GDSCs that were already on at boot. So if an off-at-boot GDSC gets turned on, and then you attempt to turn it off before all its consumers have probed, it'll fail to power it off even though that wasn't necessary?
I think we can circumvent looking at a GDSC by knowing it there was ever a power on request since boot. I'll try to come up with something in the new version.
Quoted 7 lines
4) The returning
-EBUSYwhen a power off is attempted seems to be quite wasteful. The framework will go through the whole sequence of trying to power down, send the notifications and then fail and then send the undo notifications. Combined with point (2) I think this can be handled better at the aggregation level in the framework to avoid even going that far into the power off sequence.
Again, have a look at [1] (above).
Ulf, any thoughts on this 4th point?
Quoted 132 lines
-Saravana
Quoted 129 lines
I've been doing extensive testing on SM8450, but I've also spinned this on my X13s (SC8280XP). Both patches that add the sync state callback to the SC8280XP and SM8450 are here to provide context. Once we agree on the form, I intend to add the sync state callback to all gdsc providers.
Currently, some of the gdsc providers might not reach sync state due to list of consumers not probing yet (or at all). The sync state can be enforced by writing 1 to the
state_syncedsysfs attribute of the provider, thanks to Saravana's commit [1] which has been already merged.[1] https://lore.kernel.org/r/[email protected]
V2 (RFC) of this patchset was here:
https://lore.kernel.org/all/[email protected]/Changes since v2:
* renamedgenpd_queue_power_off_worktopm_genpd_queue_power_offand added comment about its purpose w.r.t. it being exported.
* added theqcom_ccgeneric sync state callback to all providers that register GDSCs, instead of SM8450 and SC8280XPChanges since v1:
* Added theqcom_ccsync state callback which calls in turn the gdsc one
* dropped extra semicolon frompm_domain.hAbel Vesa (4):
PM: domains: Allow power off queuing from providers
soc: qcom: rpmhpd: Do proper power off when state synced
clk: qcom: gdsc: Avoid actual power off until sync state
clk: qcom: Add sync state callback to all providersdrivers/base/power/domain.c | 18 ++++++++++-------- drivers/clk/qcom/apss-ipq6018.c | 1 + drivers/clk/qcom/camcc-sc7180.c | 1 + drivers/clk/qcom/camcc-sc7280.c | 1 + drivers/clk/qcom/camcc-sdm845.c | 1 + drivers/clk/qcom/camcc-sm6350.c | 1 + drivers/clk/qcom/camcc-sm8250.c | 1 + drivers/clk/qcom/camcc-sm8450.c | 1 + drivers/clk/qcom/common.c | 19 +++++++++++++++++++ drivers/clk/qcom/common.h | 2 ++ drivers/clk/qcom/dispcc-qcm2290.c | 1 + drivers/clk/qcom/dispcc-sc7180.c | 1 + drivers/clk/qcom/dispcc-sc7280.c | 1 + drivers/clk/qcom/dispcc-sc8280xp.c | 1 + drivers/clk/qcom/dispcc-sdm845.c | 1 + drivers/clk/qcom/dispcc-sm6115.c | 1 + drivers/clk/qcom/dispcc-sm6125.c | 1 + drivers/clk/qcom/dispcc-sm6350.c | 1 + drivers/clk/qcom/dispcc-sm6375.c | 1 + drivers/clk/qcom/dispcc-sm8250.c | 1 + drivers/clk/qcom/dispcc-sm8450.c | 1 + drivers/clk/qcom/dispcc-sm8550.c | 1 + drivers/clk/qcom/gcc-apq8084.c | 1 + drivers/clk/qcom/gcc-ipq806x.c | 1 + drivers/clk/qcom/gcc-ipq8074.c | 1 + drivers/clk/qcom/gcc-mdm9615.c | 1 + drivers/clk/qcom/gcc-msm8660.c | 1 + drivers/clk/qcom/gcc-msm8909.c | 1 + drivers/clk/qcom/gcc-msm8916.c | 1 + drivers/clk/qcom/gcc-msm8939.c | 1 + drivers/clk/qcom/gcc-msm8953.c | 1 + drivers/clk/qcom/gcc-msm8960.c | 1 + drivers/clk/qcom/gcc-msm8974.c | 1 + drivers/clk/qcom/gcc-msm8976.c | 1 + drivers/clk/qcom/gcc-msm8994.c | 1 + drivers/clk/qcom/gcc-msm8996.c | 1 + drivers/clk/qcom/gcc-msm8998.c | 1 + drivers/clk/qcom/gcc-qcm2290.c | 1 + drivers/clk/qcom/gcc-qcs404.c | 1 + drivers/clk/qcom/gcc-qdu1000.c | 1 + drivers/clk/qcom/gcc-sa8775p.c | 1 + drivers/clk/qcom/gcc-sc7180.c | 1 + drivers/clk/qcom/gcc-sc7280.c | 1 + drivers/clk/qcom/gcc-sc8180x.c | 1 + drivers/clk/qcom/gcc-sc8280xp.c | 1 + drivers/clk/qcom/gcc-sdm660.c | 1 + drivers/clk/qcom/gcc-sdm845.c | 1 + drivers/clk/qcom/gcc-sdx55.c | 1 + drivers/clk/qcom/gcc-sdx65.c | 1 + drivers/clk/qcom/gcc-sm6115.c | 1 + drivers/clk/qcom/gcc-sm6125.c | 1 + drivers/clk/qcom/gcc-sm6350.c | 1 + drivers/clk/qcom/gcc-sm6375.c | 1 + drivers/clk/qcom/gcc-sm7150.c | 1 + drivers/clk/qcom/gcc-sm8150.c | 1 + drivers/clk/qcom/gcc-sm8250.c | 1 + drivers/clk/qcom/gcc-sm8350.c | 1 + drivers/clk/qcom/gcc-sm8450.c | 1 + drivers/clk/qcom/gcc-sm8550.c | 1 + drivers/clk/qcom/gdsc.c | 26 ++++++++++++++++++++++++++ drivers/clk/qcom/gdsc.h | 6 ++++++ drivers/clk/qcom/gpucc-msm8998.c | 1 + drivers/clk/qcom/gpucc-sc7180.c | 1 + drivers/clk/qcom/gpucc-sc7280.c | 1 + drivers/clk/qcom/gpucc-sc8280xp.c | 1 + drivers/clk/qcom/gpucc-sdm660.c | 1 + drivers/clk/qcom/gpucc-sdm845.c | 1 + drivers/clk/qcom/gpucc-sm6115.c | 1 + drivers/clk/qcom/gpucc-sm6125.c | 1 + drivers/clk/qcom/gpucc-sm6350.c | 1 + drivers/clk/qcom/gpucc-sm6375.c | 1 + drivers/clk/qcom/gpucc-sm8150.c | 1 + drivers/clk/qcom/gpucc-sm8250.c | 1 + drivers/clk/qcom/gpucc-sm8350.c | 1 + drivers/clk/qcom/lcc-ipq806x.c | 1 + drivers/clk/qcom/lpassaudiocc-sc7280.c | 1 + drivers/clk/qcom/lpasscc-sc7280.c | 1 + drivers/clk/qcom/lpasscorecc-sc7180.c | 2 ++ drivers/clk/qcom/lpasscorecc-sc7280.c | 2 ++ drivers/clk/qcom/mmcc-apq8084.c | 1 + drivers/clk/qcom/mmcc-msm8974.c | 1 + drivers/clk/qcom/mmcc-msm8994.c | 1 + drivers/clk/qcom/mmcc-msm8996.c | 1 + drivers/clk/qcom/mmcc-msm8998.c | 1 + drivers/clk/qcom/mmcc-sdm660.c | 1 + drivers/clk/qcom/videocc-sc7180.c | 1 + drivers/clk/qcom/videocc-sc7280.c | 1 + drivers/clk/qcom/videocc-sdm845.c | 1 + drivers/clk/qcom/videocc-sm8150.c | 1 + drivers/clk/qcom/videocc-sm8250.c | 1 + drivers/soc/qcom/rpmhpd.c | 19 +++++++------------ include/linux/pm_domain.h | 4 ++++ 92 files changed, 161 insertions(+), 20 deletions(-)--
2.34.1
Quoted 25 lines · Abel Vesa
Quoted 16 lines · Saravana Kannan
Quoted 7 lines · Abel Vesa
There have been already a couple of tries to make the genpd "disable unused" late initcall skip the powering off of domains that might be needed until later on (i.e. until some consumer probes). The conclusion was that the provider could return
-EBUSYfrom thepower_offcallback until the provider's sync state has been reached. This patch series tries to provide a proof-of-concept that is working on Qualcomm platforms.I'm giving my thoughts in the cover letter instead of spreading it around all the patches so that there's context between the comments.
1) Why can't all the logic in this patch series be implemented at the framework level? And then allow the drivers to opt into this behavior by setting the
sync_state()callback.Quoted 6 lines
That way, you can land it only for QC drivers by setting up
sync_state()callback only for QC drivers, but actually have the same code function correctly for non-QC drivers too. And then once we have this functionality working properly for QC drivers for one kernel version (or two), we'll just have the framework set the device's driver'ssync_state()if it doesn't have one already.
Quoted 2 lines
I think Ulf has already NACK'ed that approach here:
[1] https://lore.kernel.org/lkml/CAPDyKFon35wcQ+5kx3QZb-awN_S_q8y1Sir-G+GoxkCvpN=iiA@mail.gmail.com/
I would have NACK'ed that too because that's an incomplete fix. As I said further below, the fix needs to be at the aggregation level where you aggregate all the current consumer requests. In there, you need to add in the "state at boot" input that gets cleared out after a sync_state() call is received for that power domain.
Quoted 11 lines
And suggested this new approach that this patch series proposes. (Unless I missunderstood his point)
Quoted 3 lines
2)
sync_state()is not just about power on/off. It's also about the power domain level. Can you handle that too please?Well, this patchset only tries to delay the disabling of unused power domains until all consumers have had a chance to probe. So we use sync state only to queue up a power-off request to make sure those unused ones get disabled.
Sure, but the design is completely unusable for a more complete sync_state() behavior. I'm okay if you want to improve the sync_state() behavior in layers, but don't do it in a way where the current design will definitely not work for what you want to add in the future.
Quoted 10 lines
Quoted 6 lines
3) In your GDSC drivers, it's not clear to me if you are preventing power off until
sync_state()only for GDSCs that were already on at boot. So if an off-at-boot GDSC gets turned on, and then you attempt to turn it off before all its consumers have probed, it'll fail to power it off even though that wasn't necessary?I think we can circumvent looking at a GDSC by knowing it there was ever a power on request since boot. I'll try to come up with something in the new version.
Please no. There's nothing wrong with reading the GDSC values. Please read them and don't turn on GDSC's that weren't on at boot.
Otherwise you are making it a hassle for the case where there is a consumer without a driver for a GDSC that was off at boot. You are now forcing the use of timeouts or writing to state_synced file. Those should be absolute last resorts, but you are making that a requirement with your current implementation. If you implement it correctly by reading the GDSC register, things will "just work". And it's not even hard to do.
NACK'ed until this is handled correctly.
Quoted 10 lines
Quoted 8 lines
4) The returning
-EBUSYwhen a power off is attempted seems to be quite wasteful. The framework will go through the whole sequence of trying to power down, send the notifications and then fail and then send the undo notifications. Combined with point (2) I think this can be handled better at the aggregation level in the framework to avoid even going that far into the power off sequence.Again, have a look at [1] (above).
See my reply above. If you do it properly at the framework level, this can be done in a clean way and will work for all power domains.
-Saravana
Quoted 135 lines
Ulf, any thoughts on this 4th point?
Quoted 132 lines
-Saravana
Quoted 129 lines
I've been doing extensive testing on SM8450, but I've also spinned this on my X13s (SC8280XP). Both patches that add the sync state callback to the SC8280XP and SM8450 are here to provide context. Once we agree on the form, I intend to add the sync state callback to all gdsc providers.
Currently, some of the gdsc providers might not reach sync state due to list of consumers not probing yet (or at all). The sync state can be enforced by writing 1 to the
state_syncedsysfs attribute of the provider, thanks to Saravana's commit [1] which has been already merged.[1] https://lore.kernel.org/r/[email protected]
V2 (RFC) of this patchset was here:
https://lore.kernel.org/all/[email protected]/Changes since v2:
* renamedgenpd_queue_power_off_worktopm_genpd_queue_power_offand added comment about its purpose w.r.t. it being exported.
* added theqcom_ccgeneric sync state callback to all providers that register GDSCs, instead of SM8450 and SC8280XPChanges since v1:
* Added theqcom_ccsync state callback which calls in turn the gdsc one
* dropped extra semicolon frompm_domain.hAbel Vesa (4):
PM: domains: Allow power off queuing from providers
soc: qcom: rpmhpd: Do proper power off when state synced
clk: qcom: gdsc: Avoid actual power off until sync state
clk: qcom: Add sync state callback to all providersdrivers/base/power/domain.c | 18 ++++++++++-------- drivers/clk/qcom/apss-ipq6018.c | 1 + drivers/clk/qcom/camcc-sc7180.c | 1 + drivers/clk/qcom/camcc-sc7280.c | 1 + drivers/clk/qcom/camcc-sdm845.c | 1 + drivers/clk/qcom/camcc-sm6350.c | 1 + drivers/clk/qcom/camcc-sm8250.c | 1 + drivers/clk/qcom/camcc-sm8450.c | 1 + drivers/clk/qcom/common.c | 19 +++++++++++++++++++ drivers/clk/qcom/common.h | 2 ++ drivers/clk/qcom/dispcc-qcm2290.c | 1 + drivers/clk/qcom/dispcc-sc7180.c | 1 + drivers/clk/qcom/dispcc-sc7280.c | 1 + drivers/clk/qcom/dispcc-sc8280xp.c | 1 + drivers/clk/qcom/dispcc-sdm845.c | 1 + drivers/clk/qcom/dispcc-sm6115.c | 1 + drivers/clk/qcom/dispcc-sm6125.c | 1 + drivers/clk/qcom/dispcc-sm6350.c | 1 + drivers/clk/qcom/dispcc-sm6375.c | 1 + drivers/clk/qcom/dispcc-sm8250.c | 1 + drivers/clk/qcom/dispcc-sm8450.c | 1 + drivers/clk/qcom/dispcc-sm8550.c | 1 + drivers/clk/qcom/gcc-apq8084.c | 1 + drivers/clk/qcom/gcc-ipq806x.c | 1 + drivers/clk/qcom/gcc-ipq8074.c | 1 + drivers/clk/qcom/gcc-mdm9615.c | 1 + drivers/clk/qcom/gcc-msm8660.c | 1 + drivers/clk/qcom/gcc-msm8909.c | 1 + drivers/clk/qcom/gcc-msm8916.c | 1 + drivers/clk/qcom/gcc-msm8939.c | 1 + drivers/clk/qcom/gcc-msm8953.c | 1 + drivers/clk/qcom/gcc-msm8960.c | 1 + drivers/clk/qcom/gcc-msm8974.c | 1 + drivers/clk/qcom/gcc-msm8976.c | 1 + drivers/clk/qcom/gcc-msm8994.c | 1 + drivers/clk/qcom/gcc-msm8996.c | 1 + drivers/clk/qcom/gcc-msm8998.c | 1 + drivers/clk/qcom/gcc-qcm2290.c | 1 + drivers/clk/qcom/gcc-qcs404.c | 1 + drivers/clk/qcom/gcc-qdu1000.c | 1 + drivers/clk/qcom/gcc-sa8775p.c | 1 + drivers/clk/qcom/gcc-sc7180.c | 1 + drivers/clk/qcom/gcc-sc7280.c | 1 + drivers/clk/qcom/gcc-sc8180x.c | 1 + drivers/clk/qcom/gcc-sc8280xp.c | 1 + drivers/clk/qcom/gcc-sdm660.c | 1 + drivers/clk/qcom/gcc-sdm845.c | 1 + drivers/clk/qcom/gcc-sdx55.c | 1 + drivers/clk/qcom/gcc-sdx65.c | 1 + drivers/clk/qcom/gcc-sm6115.c | 1 + drivers/clk/qcom/gcc-sm6125.c | 1 + drivers/clk/qcom/gcc-sm6350.c | 1 + drivers/clk/qcom/gcc-sm6375.c | 1 + drivers/clk/qcom/gcc-sm7150.c | 1 + drivers/clk/qcom/gcc-sm8150.c | 1 + drivers/clk/qcom/gcc-sm8250.c | 1 + drivers/clk/qcom/gcc-sm8350.c | 1 + drivers/clk/qcom/gcc-sm8450.c | 1 + drivers/clk/qcom/gcc-sm8550.c | 1 + drivers/clk/qcom/gdsc.c | 26 ++++++++++++++++++++++++++ drivers/clk/qcom/gdsc.h | 6 ++++++ drivers/clk/qcom/gpucc-msm8998.c | 1 + drivers/clk/qcom/gpucc-sc7180.c | 1 + drivers/clk/qcom/gpucc-sc7280.c | 1 + drivers/clk/qcom/gpucc-sc8280xp.c | 1 + drivers/clk/qcom/gpucc-sdm660.c | 1 + drivers/clk/qcom/gpucc-sdm845.c | 1 + drivers/clk/qcom/gpucc-sm6115.c | 1 + drivers/clk/qcom/gpucc-sm6125.c | 1 + drivers/clk/qcom/gpucc-sm6350.c | 1 + drivers/clk/qcom/gpucc-sm6375.c | 1 + drivers/clk/qcom/gpucc-sm8150.c | 1 + drivers/clk/qcom/gpucc-sm8250.c | 1 + drivers/clk/qcom/gpucc-sm8350.c | 1 + drivers/clk/qcom/lcc-ipq806x.c | 1 + drivers/clk/qcom/lpassaudiocc-sc7280.c | 1 + drivers/clk/qcom/lpasscc-sc7280.c | 1 + drivers/clk/qcom/lpasscorecc-sc7180.c | 2 ++ drivers/clk/qcom/lpasscorecc-sc7280.c | 2 ++ drivers/clk/qcom/mmcc-apq8084.c | 1 + drivers/clk/qcom/mmcc-msm8974.c | 1 + drivers/clk/qcom/mmcc-msm8994.c | 1 + drivers/clk/qcom/mmcc-msm8996.c | 1 + drivers/clk/qcom/mmcc-msm8998.c | 1 + drivers/clk/qcom/mmcc-sdm660.c | 1 + drivers/clk/qcom/videocc-sc7180.c | 1 + drivers/clk/qcom/videocc-sc7280.c | 1 + drivers/clk/qcom/videocc-sdm845.c | 1 + drivers/clk/qcom/videocc-sm8150.c | 1 + drivers/clk/qcom/videocc-sm8250.c | 1 + drivers/soc/qcom/rpmhpd.c | 19 +++++++------------ include/linux/pm_domain.h | 4 ++++ 92 files changed, 161 insertions(+), 20 deletions(-)--
2.34.1
Quoted 26 lines · Saravana Kannan
Quoted 25 lines · Abel Vesa
Quoted 22 lines · Saravana Kannan
Quoted 7 lines · Abel Vesa
There have been already a couple of tries to make the genpd "disable unused" late initcall skip the powering off of domains that might be needed until later on (i.e. until some consumer probes). The conclusion was that the provider could return
-EBUSYfrom thepower_offcallback until the provider's sync state has been reached. This patch series tries to provide a proof-of-concept that is working on Qualcomm platforms.I'm giving my thoughts in the cover letter instead of spreading it around all the patches so that there's context between the comments.
1) Why can't all the logic in this patch series be implemented at the framework level? And then allow the drivers to opt into this behavior by setting the
sync_state()callback.That way, you can land it only for QC drivers by setting up
sync_state()callback only for QC drivers, but actually have the same code function correctly for non-QC drivers too. And then once we have this functionality working properly for QC drivers for one kernel version (or two), we'll just have the framework set the device's driver'ssync_state()if it doesn't have one already.
Quoted 9 lines
Quoted 2 lines
I think Ulf has already NACK'ed that approach here:
[1] https://lore.kernel.org/lkml/CAPDyKFon35wcQ+5kx3QZb-awN_S_q8y1Sir-G+GoxkCvpN=iiA@mail.gmail.com/I would have NACK'ed that too because that's an incomplete fix. As I said further below, the fix needs to be at the aggregation level where you aggregate all the current consumer requests. In there, you need to add in the "state at boot" input that gets cleared out after a
sync_state()call is received for that power domain.
So, just to make sure I understand your point. You would rather have the genpd_power_off check if 'state at boot' is 'on' and return busy and then clear then, via a generic genpd sync state you would mark 'state at boot' as 'off' and queue up a power off request for each PD from there. And as for 'state at boot' it would check the enable bit through provider.
Am I right so far?
Quoted 12 lines
Quoted 11 lines
And suggested this new approach that this patch series proposes. (Unless I missunderstood his point)
Quoted 3 lines
2)
sync_state()is not just about power on/off. It's also about the power domain level. Can you handle that too please?Well, this patchset only tries to delay the disabling of unused power domains until all consumers have had a chance to probe. So we use sync state only to queue up a power-off request to make sure those unused ones get disabled.
Quoted 5 lines
Sure, but the design is completely unusable for a more complete
sync_state()behavior. I'm okay if you want to improve thesync_state()behavior in layers, but don't do it in a way where the current design will definitely not work for what you want to add in the future.
But you would still be OK with the qcom_cc sync state wrapper, I guess, right? Your concern is only about the sync state callback being not genpd generic one, AFAIU.
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
3) In your GDSC drivers, it's not clear to me if you are preventing power off until
sync_state()only for GDSCs that were already on at boot. So if an off-at-boot GDSC gets turned on, and then you attempt to turn it off before all its consumers have probed, it'll fail to power it off even though that wasn't necessary?
Quoted 6 lines
Quoted 3 lines
I think we can circumvent looking at a GDSC by knowing it there was ever a power on request since boot. I'll try to come up with something in the new version.
Please no. There's nothing wrong with reading the GDSC values. Please read them and don't turn on GDSC's that weren't on at boot.
Sorry for the typos above, I basically said that for this concern of yours, we can add the 'state at boot' thing you mentioned above by looking at the GDSC (as in reading reg).
Quoted 162 lines
Otherwise you are making it a hassle for the case where there is a consumer without a driver for a GDSC that was off at boot. You are now forcing the use of timeouts or writing to
state_syncedfile. Those should be absolute last resorts, but you are making that a requirement with your current implementation. If you implement it correctly by reading the GDSC register, things will "just work". And it's not even hard to do.NACK'ed until this is handled correctly.
Quoted 10 lines
Quoted 8 lines
4) The returning
-EBUSYwhen a power off is attempted seems to be quite wasteful. The framework will go through the whole sequence of trying to power down, send the notifications and then fail and then send the undo notifications. Combined with point (2) I think this can be handled better at the aggregation level in the framework to avoid even going that far into the power off sequence.Again, have a look at [1] (above).
See my reply above. If you do it properly at the framework level, this can be done in a clean way and will work for all power domains.
-Saravana
Quoted 135 lines
Ulf, any thoughts on this 4th point?
Quoted 132 lines
-Saravana
Quoted 129 lines
I've been doing extensive testing on SM8450, but I've also spinned this on my X13s (SC8280XP). Both patches that add the sync state callback to the SC8280XP and SM8450 are here to provide context. Once we agree on the form, I intend to add the sync state callback to all gdsc providers.
Currently, some of the gdsc providers might not reach sync state due to list of consumers not probing yet (or at all). The sync state can be enforced by writing 1 to the
state_syncedsysfs attribute of the provider, thanks to Saravana's commit [1] which has been already merged.[1] https://lore.kernel.org/r/[email protected]
V2 (RFC) of this patchset was here:
https://lore.kernel.org/all/[email protected]/Changes since v2:
* renamedgenpd_queue_power_off_worktopm_genpd_queue_power_offand added comment about its purpose w.r.t. it being exported.
* added theqcom_ccgeneric sync state callback to all providers that register GDSCs, instead of SM8450 and SC8280XPChanges since v1:
* Added theqcom_ccsync state callback which calls in turn the gdsc one
* dropped extra semicolon frompm_domain.hAbel Vesa (4):
PM: domains: Allow power off queuing from providers
soc: qcom: rpmhpd: Do proper power off when state synced
clk: qcom: gdsc: Avoid actual power off until sync state
clk: qcom: Add sync state callback to all providersdrivers/base/power/domain.c | 18 ++++++++++-------- drivers/clk/qcom/apss-ipq6018.c | 1 + drivers/clk/qcom/camcc-sc7180.c | 1 + drivers/clk/qcom/camcc-sc7280.c | 1 + drivers/clk/qcom/camcc-sdm845.c | 1 + drivers/clk/qcom/camcc-sm6350.c | 1 + drivers/clk/qcom/camcc-sm8250.c | 1 + drivers/clk/qcom/camcc-sm8450.c | 1 + drivers/clk/qcom/common.c | 19 +++++++++++++++++++ drivers/clk/qcom/common.h | 2 ++ drivers/clk/qcom/dispcc-qcm2290.c | 1 + drivers/clk/qcom/dispcc-sc7180.c | 1 + drivers/clk/qcom/dispcc-sc7280.c | 1 + drivers/clk/qcom/dispcc-sc8280xp.c | 1 + drivers/clk/qcom/dispcc-sdm845.c | 1 + drivers/clk/qcom/dispcc-sm6115.c | 1 + drivers/clk/qcom/dispcc-sm6125.c | 1 + drivers/clk/qcom/dispcc-sm6350.c | 1 + drivers/clk/qcom/dispcc-sm6375.c | 1 + drivers/clk/qcom/dispcc-sm8250.c | 1 + drivers/clk/qcom/dispcc-sm8450.c | 1 + drivers/clk/qcom/dispcc-sm8550.c | 1 + drivers/clk/qcom/gcc-apq8084.c | 1 + drivers/clk/qcom/gcc-ipq806x.c | 1 + drivers/clk/qcom/gcc-ipq8074.c | 1 + drivers/clk/qcom/gcc-mdm9615.c | 1 + drivers/clk/qcom/gcc-msm8660.c | 1 + drivers/clk/qcom/gcc-msm8909.c | 1 + drivers/clk/qcom/gcc-msm8916.c | 1 + drivers/clk/qcom/gcc-msm8939.c | 1 + drivers/clk/qcom/gcc-msm8953.c | 1 + drivers/clk/qcom/gcc-msm8960.c | 1 + drivers/clk/qcom/gcc-msm8974.c | 1 + drivers/clk/qcom/gcc-msm8976.c | 1 + drivers/clk/qcom/gcc-msm8994.c | 1 + drivers/clk/qcom/gcc-msm8996.c | 1 + drivers/clk/qcom/gcc-msm8998.c | 1 + drivers/clk/qcom/gcc-qcm2290.c | 1 + drivers/clk/qcom/gcc-qcs404.c | 1 + drivers/clk/qcom/gcc-qdu1000.c | 1 + drivers/clk/qcom/gcc-sa8775p.c | 1 + drivers/clk/qcom/gcc-sc7180.c | 1 + drivers/clk/qcom/gcc-sc7280.c | 1 + drivers/clk/qcom/gcc-sc8180x.c | 1 + drivers/clk/qcom/gcc-sc8280xp.c | 1 + drivers/clk/qcom/gcc-sdm660.c | 1 + drivers/clk/qcom/gcc-sdm845.c | 1 + drivers/clk/qcom/gcc-sdx55.c | 1 + drivers/clk/qcom/gcc-sdx65.c | 1 + drivers/clk/qcom/gcc-sm6115.c | 1 + drivers/clk/qcom/gcc-sm6125.c | 1 + drivers/clk/qcom/gcc-sm6350.c | 1 + drivers/clk/qcom/gcc-sm6375.c | 1 + drivers/clk/qcom/gcc-sm7150.c | 1 + drivers/clk/qcom/gcc-sm8150.c | 1 + drivers/clk/qcom/gcc-sm8250.c | 1 + drivers/clk/qcom/gcc-sm8350.c | 1 + drivers/clk/qcom/gcc-sm8450.c | 1 + drivers/clk/qcom/gcc-sm8550.c | 1 + drivers/clk/qcom/gdsc.c | 26 ++++++++++++++++++++++++++ drivers/clk/qcom/gdsc.h | 6 ++++++ drivers/clk/qcom/gpucc-msm8998.c | 1 + drivers/clk/qcom/gpucc-sc7180.c | 1 + drivers/clk/qcom/gpucc-sc7280.c | 1 + drivers/clk/qcom/gpucc-sc8280xp.c | 1 + drivers/clk/qcom/gpucc-sdm660.c | 1 + drivers/clk/qcom/gpucc-sdm845.c | 1 + drivers/clk/qcom/gpucc-sm6115.c | 1 + drivers/clk/qcom/gpucc-sm6125.c | 1 + drivers/clk/qcom/gpucc-sm6350.c | 1 + drivers/clk/qcom/gpucc-sm6375.c | 1 + drivers/clk/qcom/gpucc-sm8150.c | 1 + drivers/clk/qcom/gpucc-sm8250.c | 1 + drivers/clk/qcom/gpucc-sm8350.c | 1 + drivers/clk/qcom/lcc-ipq806x.c | 1 + drivers/clk/qcom/lpassaudiocc-sc7280.c | 1 + drivers/clk/qcom/lpasscc-sc7280.c | 1 + drivers/clk/qcom/lpasscorecc-sc7180.c | 2 ++ drivers/clk/qcom/lpasscorecc-sc7280.c | 2 ++ drivers/clk/qcom/mmcc-apq8084.c | 1 + drivers/clk/qcom/mmcc-msm8974.c | 1 + drivers/clk/qcom/mmcc-msm8994.c | 1 + drivers/clk/qcom/mmcc-msm8996.c | 1 + drivers/clk/qcom/mmcc-msm8998.c | 1 + drivers/clk/qcom/mmcc-sdm660.c | 1 + drivers/clk/qcom/videocc-sc7180.c | 1 + drivers/clk/qcom/videocc-sc7280.c | 1 + drivers/clk/qcom/videocc-sdm845.c | 1 + drivers/clk/qcom/videocc-sm8150.c | 1 + drivers/clk/qcom/videocc-sm8250.c | 1 + drivers/soc/qcom/rpmhpd.c | 19 +++++++------------ include/linux/pm_domain.h | 4 ++++ 92 files changed, 161 insertions(+), 20 deletions(-)--
2.34.1
Abel, Saravana,
Quoted 38 lines · Abel Vesa
Quoted 26 lines · Saravana Kannan
Quoted 25 lines · Abel Vesa
Quoted 22 lines · Saravana Kannan
Quoted 7 lines · Abel Vesa
There have been already a couple of tries to make the genpd "disable unused" late initcall skip the powering off of domains that might be needed until later on (i.e. until some consumer probes). The conclusion was that the provider could return
-EBUSYfrom thepower_offcallback until the provider's sync state has been reached. This patch series tries to provide a proof-of-concept that is working on Qualcomm platforms.I'm giving my thoughts in the cover letter instead of spreading it around all the patches so that there's context between the comments.
1) Why can't all the logic in this patch series be implemented at the framework level? And then allow the drivers to opt into this behavior by setting the
sync_state()callback.That way, you can land it only for QC drivers by setting up
sync_state()callback only for QC drivers, but actually have the same code function correctly for non-QC drivers too. And then once we have this functionality working properly for QC drivers for one kernel version (or two), we'll just have the framework set the device's driver'ssync_state()if it doesn't have one already.Quoted 9 lines
Quoted 2 lines
I think Ulf has already NACK'ed that approach here:
[1] https://lore.kernel.org/lkml/CAPDyKFon35wcQ+5kx3QZb-awN_S_q8y1Sir-G+GoxkCvpN=iiA@mail.gmail.com/I would have NACK'ed that too because that's an incomplete fix. As I said further below, the fix needs to be at the aggregation level where you aggregate all the current consumer requests. In there, you need to add in the "state at boot" input that gets cleared out after a
sync_state()call is received for that power domain.
Quoted 8 lines
So, just to make sure I understand your point. You would rather have the
genpd_power_offcheck if 'state at boot' is 'on' and return busy and then clear then, via a generic genpd sync state you would mark 'state at boot' as 'off' and queue up a power off request for each PD from there. And as for 'state at boot' it would check the enable bit through provider.Am I right so far?
I am not sure I completely follow what you are suggesting here.
Although, let me point out that there is no requirement from the genpd API point of view, that the provider needs to be a driver. This means that the sync_state callback may not even be applicable for all genpd providers.
In other words, it looks to me that we may need some new genpd helper functions, no matter what. More importantly, it looks like we need an opt-in behaviour, unless we can figure out a common way for genpd to understand whether the sync_state thing is going to be applicable or not. Maybe Saravana has some ideas around this?
Note that, I don't object to extending genpd to be more clever and to share common code, of course. We could, for example, make genpd_power_off() to bail out earlier, rather than calling the ->power_off() callback and waiting for it to return -EBUSY. Both of you have pointed this out to me, in some of the earlier replies/discussions too.
Quoted 35 lines
Quoted 13 lines
Quoted 5 lines
And suggested this new approach that this patch series proposes. (Unless I missunderstood his point)
Quoted 1 line
Quoted 7 lines
Quoted 2 lines
2)
sync_state()is not just about power on/off. It's also about the power domain level. Can you handle that too please?Well, this patchset only tries to delay the disabling of unused power domains until all consumers have had a chance to probe. So we use sync state only to queue up a power-off request to make sure those unused ones get disabled.
Quoted 5 lines
Sure, but the design is completely unusable for a more complete
sync_state()behavior. I'm okay if you want to improve thesync_state()behavior in layers, but don't do it in a way where the current design will definitely not work for what you want to add in the future.But you would still be OK with the
qcom_ccsync state wrapper, I guess, right? Your concern is only about the sync state callback being not genpd generic one, AFAIU.Quoted 12 lines
Quoted 11 lines
Quoted 7 lines
3) In your GDSC drivers, it's not clear to me if you are preventing power off until
sync_state()only for GDSCs that were already on at boot. So if an off-at-boot GDSC gets turned on, and then you attempt to turn it off before all its consumers have probed, it'll fail to power it off even though that wasn't necessary?I think we can circumvent looking at a GDSC by knowing it there was ever a power on request since boot. I'll try to come up with something in the new version.
Quoted 36 lines
Quoted 2 lines
Please no. There's nothing wrong with reading the GDSC values. Please read them and don't turn on GDSC's that weren't on at boot.
Sorry for the typos above, I basically said that for this concern of yours, we can add the 'state at boot' thing you mentioned above by looking at the GDSC (as in reading reg).
Quoted 29 lines
Otherwise you are making it a hassle for the case where there is a consumer without a driver for a GDSC that was off at boot. You are now forcing the use of timeouts or writing to
state_syncedfile. Those should be absolute last resorts, but you are making that a requirement with your current implementation. If you implement it correctly by reading the GDSC register, things will "just work". And it's not even hard to do.NACK'ed until this is handled correctly.
Quoted 10 lines
Quoted 8 lines
4) The returning
-EBUSYwhen a power off is attempted seems to be quite wasteful. The framework will go through the whole sequence of trying to power down, send the notifications and then fail and then send the undo notifications. Combined with point (2) I think this can be handled better at the aggregation level in the framework to avoid even going that far into the power off sequence.Again, have a look at [1] (above).
See my reply above. If you do it properly at the framework level, this can be done in a clean way and will work for all power domains.
-Saravana
Quoted 2 lines
Ulf, any thoughts on this 4th point?
Please, see my reply above.
[...]
Kind regards
Uffe
Quoted 48 lines · Ulf Hansson
Abel, Saravana,
Quoted 45 lines · Abel Vesa
Quoted 26 lines · Saravana Kannan
Quoted 25 lines · Abel Vesa
Quoted 22 lines · Saravana Kannan
Quoted 7 lines · Abel Vesa
There have been already a couple of tries to make the genpd "disable unused" late initcall skip the powering off of domains that might be needed until later on (i.e. until some consumer probes). The conclusion was that the provider could return
-EBUSYfrom thepower_offcallback until the provider's sync state has been reached. This patch series tries to provide a proof-of-concept that is working on Qualcomm platforms.I'm giving my thoughts in the cover letter instead of spreading it around all the patches so that there's context between the comments.
1) Why can't all the logic in this patch series be implemented at the framework level? And then allow the drivers to opt into this behavior by setting the
sync_state()callback.That way, you can land it only for QC drivers by setting up
sync_state()callback only for QC drivers, but actually have the same code function correctly for non-QC drivers too. And then once we have this functionality working properly for QC drivers for one kernel version (or two), we'll just have the framework set the device's driver'ssync_state()if it doesn't have one already.Quoted 9 lines
Quoted 2 lines
I think Ulf has already NACK'ed that approach here:
[1] https://lore.kernel.org/lkml/CAPDyKFon35wcQ+5kx3QZb-awN_S_q8y1Sir-G+GoxkCvpN=iiA@mail.gmail.com/I would have NACK'ed that too because that's an incomplete fix. As I said further below, the fix needs to be at the aggregation level where you aggregate all the current consumer requests. In there, you need to add in the "state at boot" input that gets cleared out after a
sync_state()call is received for that power domain.So, just to make sure I understand your point. You would rather have the
genpd_power_offcheck if 'state at boot' is 'on' and return busy and then clear then, via a generic genpd sync state you would mark 'state at boot' as 'off' and queue up a power off request for each PD from there. And as for 'state at boot' it would check the enable bit through provider.
Quoted 3 lines
Quoted 1 line
Am I right so far?
I am not sure I completely follow what you are suggesting here.
Please have a look at this:
https://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux.git/commit/?h=qcom/genpd/ignore_unused_until_sync_state&id=4f9e6140dfe77884012383f8ba2140cadb62ca4a
Keep in mind that is WIP for now. Once I have something, I'll post it on mailing list. Right now, there is a missing piece mentioned in that commit message.
Quoted 5 lines
Although, let me point out that there is no requirement from the genpd API point of view, that the provider needs to be a driver. This means that the
sync_statecallback may not even be applicable for all genpd providers.
Yes, I'm considering that case too.
Quoted 7 lines
In other words, it looks to me that we may need some new genpd helper functions, no matter what. More importantly, it looks like we need an opt-in behaviour, unless we can figure out a common way for genpd to understand whether the
sync_statething is going to be applicable or not. Maybe Saravana has some ideas around this?
Quoted 6 lines
Note that, I don't object to extending genpd to be more clever and to share common code, of course. We could, for example, make
genpd_power_off()to bail out earlier, rather than calling the ->power_off() callback and waiting for it to return-EBUSY. Both of you have pointed this out to me, in some of the earlier replies/discussions too.
The above link basically does this. I hope this is what Saravana has in mind as well.
Quoted 79 lines
Quoted 36 lines
Quoted 14 lines
Quoted 6 lines
And suggested this new approach that this patch series proposes. (Unless I missunderstood his point)
Quoted 1 line
Quoted 7 lines
Quoted 2 lines
2)
sync_state()is not just about power on/off. It's also about the power domain level. Can you handle that too please?Well, this patchset only tries to delay the disabling of unused power domains until all consumers have had a chance to probe. So we use sync state only to queue up a power-off request to make sure those unused ones get disabled.
Quoted 5 lines
Sure, but the design is completely unusable for a more complete
sync_state()behavior. I'm okay if you want to improve thesync_state()behavior in layers, but don't do it in a way where the current design will definitely not work for what you want to add in the future.But you would still be OK with the
qcom_ccsync state wrapper, I guess, right? Your concern is only about the sync state callback being not genpd generic one, AFAIU.Quoted 12 lines
Quoted 11 lines
Quoted 7 lines
3) In your GDSC drivers, it's not clear to me if you are preventing power off until
sync_state()only for GDSCs that were already on at boot. So if an off-at-boot GDSC gets turned on, and then you attempt to turn it off before all its consumers have probed, it'll fail to power it off even though that wasn't necessary?I think we can circumvent looking at a GDSC by knowing it there was ever a power on request since boot. I'll try to come up with something in the new version.
Quoted 36 lines
Quoted 2 lines
Please no. There's nothing wrong with reading the GDSC values. Please read them and don't turn on GDSC's that weren't on at boot.
Sorry for the typos above, I basically said that for this concern of yours, we can add the 'state at boot' thing you mentioned above by looking at the GDSC (as in reading reg).
Quoted 29 lines
Otherwise you are making it a hassle for the case where there is a consumer without a driver for a GDSC that was off at boot. You are now forcing the use of timeouts or writing to
state_syncedfile. Those should be absolute last resorts, but you are making that a requirement with your current implementation. If you implement it correctly by reading the GDSC register, things will "just work". And it's not even hard to do.NACK'ed until this is handled correctly.
Quoted 10 lines
Quoted 8 lines
4) The returning
-EBUSYwhen a power off is attempted seems to be quite wasteful. The framework will go through the whole sequence of trying to power down, send the notifications and then fail and then send the undo notifications. Combined with point (2) I think this can be handled better at the aggregation level in the framework to avoid even going that far into the power off sequence.Again, have a look at [1] (above).
See my reply above. If you do it properly at the framework level, this can be done in a clean way and will work for all power domains.
-Saravana
Quoted 2 lines
Ulf, any thoughts on this 4th point?
Please, see my reply above.
[...]
Kind regards
Uffe
Quoted 52 lines · Abel Vesa
Quoted 50 lines · Ulf Hansson
Abel, Saravana,
Quoted 46 lines · Abel Vesa
Quoted 26 lines · Saravana Kannan
Quoted 25 lines · Abel Vesa
Quoted 22 lines · Saravana Kannan
Quoted 7 lines · Abel Vesa
There have been already a couple of tries to make the genpd "disable unused" late initcall skip the powering off of domains that might be needed until later on (i.e. until some consumer probes). The conclusion was that the provider could return
-EBUSYfrom thepower_offcallback until the provider's sync state has been reached. This patch series tries to provide a proof-of-concept that is working on Qualcomm platforms.I'm giving my thoughts in the cover letter instead of spreading it around all the patches so that there's context between the comments.
1) Why can't all the logic in this patch series be implemented at the framework level? And then allow the drivers to opt into this behavior by setting the
sync_state()callback.That way, you can land it only for QC drivers by setting up
sync_state()callback only for QC drivers, but actually have the same code function correctly for non-QC drivers too. And then once we have this functionality working properly for QC drivers for one kernel version (or two), we'll just have the framework set the device's driver'ssync_state()if it doesn't have one already.Quoted 9 lines
Quoted 2 lines
I think Ulf has already NACK'ed that approach here:
[1] https://lore.kernel.org/lkml/CAPDyKFon35wcQ+5kx3QZb-awN_S_q8y1Sir-G+GoxkCvpN=iiA@mail.gmail.com/I would have NACK'ed that too because that's an incomplete fix. As I said further below, the fix needs to be at the aggregation level where you aggregate all the current consumer requests. In there, you need to add in the "state at boot" input that gets cleared out after a
sync_state()call is received for that power domain.So, just to make sure I understand your point. You would rather have the
genpd_power_offcheck if 'state at boot' is 'on' and return busy and then clear then, via a generic genpd sync state you would mark 'state at boot' as 'off' and queue up a power off request for each PD from there. And as for 'state at boot' it would check the enable bit through provider.Am I right so far?
Quoted 8 lines
Quoted 1 line
I am not sure I completely follow what you are suggesting here.
Please have a look at this:
https://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux.git/commit/?h=qcom/genpd/ignore_unused_until_sync_state&id=4f9e6140dfe77884012383f8ba2140cadb62ca4aKeep in mind that is WIP for now. Once I have something, I'll post it on mailing list. Right now, there is a missing piece mentioned in that commit message.
I had a quick look and it seems rather promising, but I will have a closer look when you post it.
Quoted 8 lines
Quoted 6 lines
Although, let me point out that there is no requirement from the genpd API point of view, that the provider needs to be a driver. This means that the
sync_statecallback may not even be applicable for all genpd providers.Yes, I'm considering that case too.
Good.
Quoted 15 lines
Quoted 8 lines
In other words, it looks to me that we may need some new genpd helper functions, no matter what. More importantly, it looks like we need an opt-in behaviour, unless we can figure out a common way for genpd to understand whether the
sync_statething is going to be applicable or not. Maybe Saravana has some ideas around this?Quoted 6 lines
Note that, I don't object to extending genpd to be more clever and to share common code, of course. We could, for example, make
genpd_power_off()to bail out earlier, rather than calling the ->power_off() callback and waiting for it to return-EBUSY. Both of you have pointed this out to me, in some of the earlier replies/discussions too.
Quoted 2 lines
The above link basically does this. I hope this is what Saravana has in mind as well.
Okay, let's see what Saravana thinks.
Maybe it's easier to post an RFC, based upon the above and continue the discussion around that?
Kind regards
Uffe