Message ID | 20231127151931.47055-1-ulf.hansson@linaro.org (mailing list archive) |
---|---|
State | Handled Elsewhere, archived |
Headers | show |
Series | PM: domains: Drop the unused pm_genpd_opp_to_performance_state() | expand |
On Mon, Nov 27, 2023 at 4:19 PM Ulf Hansson <ulf.hansson@linaro.org> wrote: > > Since commit 7c41cdcd3bbe ("OPP: Simplify the over-designed pstate <-> > level dance"), there is no longer any users of the > pm_genpd_opp_to_performance_state() API. Let's therefore drop it and its > corresponding ->opp_to_performance_state() callback, which also no longer > has any users. > > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> I can take this in principle, but I'm wondering if you'd prefer to apply patches modifying domain.c yourself? They are definitely related to the pmdomain tree. > --- > drivers/base/power/domain.c | 32 -------------------------------- > include/linux/pm_domain.h | 12 ------------ > 2 files changed, 44 deletions(-) > > diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c > index da1777e39eaa..cf65b5a9783c 100644 > --- a/drivers/base/power/domain.c > +++ b/drivers/base/power/domain.c > @@ -3042,38 +3042,6 @@ int of_genpd_parse_idle_states(struct device_node *dn, > } > EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states); > > -/** > - * pm_genpd_opp_to_performance_state - Gets performance state of the genpd from its OPP node. > - * > - * @genpd_dev: Genpd's device for which the performance-state needs to be found. > - * @opp: struct dev_pm_opp of the OPP for which we need to find performance > - * state. > - * > - * Returns performance state encoded in the OPP of the genpd. This calls > - * platform specific genpd->opp_to_performance_state() callback to translate > - * power domain OPP to performance state. > - * > - * Returns performance state on success and 0 on failure. > - */ > -unsigned int pm_genpd_opp_to_performance_state(struct device *genpd_dev, > - struct dev_pm_opp *opp) > -{ > - struct generic_pm_domain *genpd = NULL; > - int state; > - > - genpd = container_of(genpd_dev, struct generic_pm_domain, dev); > - > - if (unlikely(!genpd->opp_to_performance_state)) > - return 0; > - > - genpd_lock(genpd); > - state = genpd->opp_to_performance_state(genpd, opp); > - genpd_unlock(genpd); > - > - return state; > -} > -EXPORT_SYMBOL_GPL(pm_genpd_opp_to_performance_state); > - > static int __init genpd_bus_init(void) > { > return bus_register(&genpd_bus_type); > diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h > index 34663d0d5c55..b97c5e9820f9 100644 > --- a/include/linux/pm_domain.h > +++ b/include/linux/pm_domain.h > @@ -118,7 +118,6 @@ struct genpd_power_state { > }; > > struct genpd_lock_ops; > -struct dev_pm_opp; > struct opp_table; > > struct generic_pm_domain { > @@ -146,8 +145,6 @@ struct generic_pm_domain { > int (*power_on)(struct generic_pm_domain *domain); > struct raw_notifier_head power_notifiers; /* Power on/off notifiers */ > struct opp_table *opp_table; /* OPP table of the genpd */ > - unsigned int (*opp_to_performance_state)(struct generic_pm_domain *genpd, > - struct dev_pm_opp *opp); > int (*set_performance_state)(struct generic_pm_domain *genpd, > unsigned int state); > struct gpd_dev_ops dev_ops; > @@ -348,8 +345,6 @@ int of_genpd_remove_subdomain(struct of_phandle_args *parent_spec, > struct generic_pm_domain *of_genpd_remove_last(struct device_node *np); > int of_genpd_parse_idle_states(struct device_node *dn, > struct genpd_power_state **states, int *n); > -unsigned int pm_genpd_opp_to_performance_state(struct device *genpd_dev, > - struct dev_pm_opp *opp); > > int genpd_dev_pm_attach(struct device *dev); > struct device *genpd_dev_pm_attach_by_id(struct device *dev, > @@ -395,13 +390,6 @@ static inline int of_genpd_parse_idle_states(struct device_node *dn, > return -ENODEV; > } > > -static inline unsigned int > -pm_genpd_opp_to_performance_state(struct device *genpd_dev, > - struct dev_pm_opp *opp) > -{ > - return 0; > -} > - > static inline int genpd_dev_pm_attach(struct device *dev) > { > return 0; > -- > 2.34.1 >
On Mon, 11 Dec 2023 at 21:44, Rafael J. Wysocki <rafael@kernel.org> wrote: > > On Mon, Nov 27, 2023 at 4:19 PM Ulf Hansson <ulf.hansson@linaro.org> wrote: > > > > Since commit 7c41cdcd3bbe ("OPP: Simplify the over-designed pstate <-> > > level dance"), there is no longer any users of the > > pm_genpd_opp_to_performance_state() API. Let's therefore drop it and its > > corresponding ->opp_to_performance_state() callback, which also no longer > > has any users. > > > > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> > > I can take this in principle, but I'm wondering if you'd prefer to > apply patches modifying domain.c yourself? They are definitely > related to the pmdomain tree. Yes, it makes sense for me to pick the genpd core patches through the pmdomain tree. In some cases there may be overlapping patches that are more generic and not only limited to genpd, but I guess we can decide on a case by case basis for those ones. I can add the pmdomain tree to the GENERIC PM DOMAINS section in the MAINTAINERS file to reflect this, if you think this is a good idea? Kind regards Uffe > > > --- > > drivers/base/power/domain.c | 32 -------------------------------- > > include/linux/pm_domain.h | 12 ------------ > > 2 files changed, 44 deletions(-) > > > > diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c > > index da1777e39eaa..cf65b5a9783c 100644 > > --- a/drivers/base/power/domain.c > > +++ b/drivers/base/power/domain.c > > @@ -3042,38 +3042,6 @@ int of_genpd_parse_idle_states(struct device_node *dn, > > } > > EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states); > > > > -/** > > - * pm_genpd_opp_to_performance_state - Gets performance state of the genpd from its OPP node. > > - * > > - * @genpd_dev: Genpd's device for which the performance-state needs to be found. > > - * @opp: struct dev_pm_opp of the OPP for which we need to find performance > > - * state. > > - * > > - * Returns performance state encoded in the OPP of the genpd. This calls > > - * platform specific genpd->opp_to_performance_state() callback to translate > > - * power domain OPP to performance state. > > - * > > - * Returns performance state on success and 0 on failure. > > - */ > > -unsigned int pm_genpd_opp_to_performance_state(struct device *genpd_dev, > > - struct dev_pm_opp *opp) > > -{ > > - struct generic_pm_domain *genpd = NULL; > > - int state; > > - > > - genpd = container_of(genpd_dev, struct generic_pm_domain, dev); > > - > > - if (unlikely(!genpd->opp_to_performance_state)) > > - return 0; > > - > > - genpd_lock(genpd); > > - state = genpd->opp_to_performance_state(genpd, opp); > > - genpd_unlock(genpd); > > - > > - return state; > > -} > > -EXPORT_SYMBOL_GPL(pm_genpd_opp_to_performance_state); > > - > > static int __init genpd_bus_init(void) > > { > > return bus_register(&genpd_bus_type); > > diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h > > index 34663d0d5c55..b97c5e9820f9 100644 > > --- a/include/linux/pm_domain.h > > +++ b/include/linux/pm_domain.h > > @@ -118,7 +118,6 @@ struct genpd_power_state { > > }; > > > > struct genpd_lock_ops; > > -struct dev_pm_opp; > > struct opp_table; > > > > struct generic_pm_domain { > > @@ -146,8 +145,6 @@ struct generic_pm_domain { > > int (*power_on)(struct generic_pm_domain *domain); > > struct raw_notifier_head power_notifiers; /* Power on/off notifiers */ > > struct opp_table *opp_table; /* OPP table of the genpd */ > > - unsigned int (*opp_to_performance_state)(struct generic_pm_domain *genpd, > > - struct dev_pm_opp *opp); > > int (*set_performance_state)(struct generic_pm_domain *genpd, > > unsigned int state); > > struct gpd_dev_ops dev_ops; > > @@ -348,8 +345,6 @@ int of_genpd_remove_subdomain(struct of_phandle_args *parent_spec, > > struct generic_pm_domain *of_genpd_remove_last(struct device_node *np); > > int of_genpd_parse_idle_states(struct device_node *dn, > > struct genpd_power_state **states, int *n); > > -unsigned int pm_genpd_opp_to_performance_state(struct device *genpd_dev, > > - struct dev_pm_opp *opp); > > > > int genpd_dev_pm_attach(struct device *dev); > > struct device *genpd_dev_pm_attach_by_id(struct device *dev, > > @@ -395,13 +390,6 @@ static inline int of_genpd_parse_idle_states(struct device_node *dn, > > return -ENODEV; > > } > > > > -static inline unsigned int > > -pm_genpd_opp_to_performance_state(struct device *genpd_dev, > > - struct dev_pm_opp *opp) > > -{ > > - return 0; > > -} > > - > > static inline int genpd_dev_pm_attach(struct device *dev) > > { > > return 0; > > -- > > 2.34.1 > >
On Tue, Dec 12, 2023 at 11:37 AM Ulf Hansson <ulf.hansson@linaro.org> wrote: > > On Mon, 11 Dec 2023 at 21:44, Rafael J. Wysocki <rafael@kernel.org> wrote: > > > > On Mon, Nov 27, 2023 at 4:19 PM Ulf Hansson <ulf.hansson@linaro.org> wrote: > > > > > > Since commit 7c41cdcd3bbe ("OPP: Simplify the over-designed pstate <-> > > > level dance"), there is no longer any users of the > > > pm_genpd_opp_to_performance_state() API. Let's therefore drop it and its > > > corresponding ->opp_to_performance_state() callback, which also no longer > > > has any users. > > > > > > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> > > > > I can take this in principle, but I'm wondering if you'd prefer to > > apply patches modifying domain.c yourself? They are definitely > > related to the pmdomain tree. > > Yes, it makes sense for me to pick the genpd core patches through the > pmdomain tree. In some cases there may be overlapping patches that are > more generic and not only limited to genpd, but I guess we can decide > on a case by case basis for those ones. > > I can add the pmdomain tree to the GENERIC PM DOMAINS section in the > MAINTAINERS file to reflect this, if you think this is a good idea? Yes, please. What about moving drivers/base/power/domain.c to drivers/pmdomain/ ?
On Tue, 12 Dec 2023 at 12:59, Rafael J. Wysocki <rafael@kernel.org> wrote: > > On Tue, Dec 12, 2023 at 11:37 AM Ulf Hansson <ulf.hansson@linaro.org> wrote: > > > > On Mon, 11 Dec 2023 at 21:44, Rafael J. Wysocki <rafael@kernel.org> wrote: > > > > > > On Mon, Nov 27, 2023 at 4:19 PM Ulf Hansson <ulf.hansson@linaro.org> wrote: > > > > > > > > Since commit 7c41cdcd3bbe ("OPP: Simplify the over-designed pstate <-> > > > > level dance"), there is no longer any users of the > > > > pm_genpd_opp_to_performance_state() API. Let's therefore drop it and its > > > > corresponding ->opp_to_performance_state() callback, which also no longer > > > > has any users. > > > > > > > > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> > > > > > > I can take this in principle, but I'm wondering if you'd prefer to > > > apply patches modifying domain.c yourself? They are definitely > > > related to the pmdomain tree. > > > > Yes, it makes sense for me to pick the genpd core patches through the > > pmdomain tree. In some cases there may be overlapping patches that are > > more generic and not only limited to genpd, but I guess we can decide > > on a case by case basis for those ones. > > > > I can add the pmdomain tree to the GENERIC PM DOMAINS section in the > > MAINTAINERS file to reflect this, if you think this is a good idea? > > Yes, please. > > What about moving drivers/base/power/domain.c to drivers/pmdomain/ ? Yes, it seems reasonable to do that too. I will send a patch for you to have a look at shortly. Kind regards Uffe
On Mon, 27 Nov 2023 at 16:19, Ulf Hansson <ulf.hansson@linaro.org> wrote: > > Since commit 7c41cdcd3bbe ("OPP: Simplify the over-designed pstate <-> > level dance"), there is no longer any users of the > pm_genpd_opp_to_performance_state() API. Let's therefore drop it and its > corresponding ->opp_to_performance_state() callback, which also no longer > has any users. > > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> So, I have applied this for next and by adding your ack. Kind regards Uffe > --- > drivers/base/power/domain.c | 32 -------------------------------- > include/linux/pm_domain.h | 12 ------------ > 2 files changed, 44 deletions(-) > > diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c > index da1777e39eaa..cf65b5a9783c 100644 > --- a/drivers/base/power/domain.c > +++ b/drivers/base/power/domain.c > @@ -3042,38 +3042,6 @@ int of_genpd_parse_idle_states(struct device_node *dn, > } > EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states); > > -/** > - * pm_genpd_opp_to_performance_state - Gets performance state of the genpd from its OPP node. > - * > - * @genpd_dev: Genpd's device for which the performance-state needs to be found. > - * @opp: struct dev_pm_opp of the OPP for which we need to find performance > - * state. > - * > - * Returns performance state encoded in the OPP of the genpd. This calls > - * platform specific genpd->opp_to_performance_state() callback to translate > - * power domain OPP to performance state. > - * > - * Returns performance state on success and 0 on failure. > - */ > -unsigned int pm_genpd_opp_to_performance_state(struct device *genpd_dev, > - struct dev_pm_opp *opp) > -{ > - struct generic_pm_domain *genpd = NULL; > - int state; > - > - genpd = container_of(genpd_dev, struct generic_pm_domain, dev); > - > - if (unlikely(!genpd->opp_to_performance_state)) > - return 0; > - > - genpd_lock(genpd); > - state = genpd->opp_to_performance_state(genpd, opp); > - genpd_unlock(genpd); > - > - return state; > -} > -EXPORT_SYMBOL_GPL(pm_genpd_opp_to_performance_state); > - > static int __init genpd_bus_init(void) > { > return bus_register(&genpd_bus_type); > diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h > index 34663d0d5c55..b97c5e9820f9 100644 > --- a/include/linux/pm_domain.h > +++ b/include/linux/pm_domain.h > @@ -118,7 +118,6 @@ struct genpd_power_state { > }; > > struct genpd_lock_ops; > -struct dev_pm_opp; > struct opp_table; > > struct generic_pm_domain { > @@ -146,8 +145,6 @@ struct generic_pm_domain { > int (*power_on)(struct generic_pm_domain *domain); > struct raw_notifier_head power_notifiers; /* Power on/off notifiers */ > struct opp_table *opp_table; /* OPP table of the genpd */ > - unsigned int (*opp_to_performance_state)(struct generic_pm_domain *genpd, > - struct dev_pm_opp *opp); > int (*set_performance_state)(struct generic_pm_domain *genpd, > unsigned int state); > struct gpd_dev_ops dev_ops; > @@ -348,8 +345,6 @@ int of_genpd_remove_subdomain(struct of_phandle_args *parent_spec, > struct generic_pm_domain *of_genpd_remove_last(struct device_node *np); > int of_genpd_parse_idle_states(struct device_node *dn, > struct genpd_power_state **states, int *n); > -unsigned int pm_genpd_opp_to_performance_state(struct device *genpd_dev, > - struct dev_pm_opp *opp); > > int genpd_dev_pm_attach(struct device *dev); > struct device *genpd_dev_pm_attach_by_id(struct device *dev, > @@ -395,13 +390,6 @@ static inline int of_genpd_parse_idle_states(struct device_node *dn, > return -ENODEV; > } > > -static inline unsigned int > -pm_genpd_opp_to_performance_state(struct device *genpd_dev, > - struct dev_pm_opp *opp) > -{ > - return 0; > -} > - > static inline int genpd_dev_pm_attach(struct device *dev) > { > return 0; > -- > 2.34.1 >
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index da1777e39eaa..cf65b5a9783c 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -3042,38 +3042,6 @@ int of_genpd_parse_idle_states(struct device_node *dn, } EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states); -/** - * pm_genpd_opp_to_performance_state - Gets performance state of the genpd from its OPP node. - * - * @genpd_dev: Genpd's device for which the performance-state needs to be found. - * @opp: struct dev_pm_opp of the OPP for which we need to find performance - * state. - * - * Returns performance state encoded in the OPP of the genpd. This calls - * platform specific genpd->opp_to_performance_state() callback to translate - * power domain OPP to performance state. - * - * Returns performance state on success and 0 on failure. - */ -unsigned int pm_genpd_opp_to_performance_state(struct device *genpd_dev, - struct dev_pm_opp *opp) -{ - struct generic_pm_domain *genpd = NULL; - int state; - - genpd = container_of(genpd_dev, struct generic_pm_domain, dev); - - if (unlikely(!genpd->opp_to_performance_state)) - return 0; - - genpd_lock(genpd); - state = genpd->opp_to_performance_state(genpd, opp); - genpd_unlock(genpd); - - return state; -} -EXPORT_SYMBOL_GPL(pm_genpd_opp_to_performance_state); - static int __init genpd_bus_init(void) { return bus_register(&genpd_bus_type); diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 34663d0d5c55..b97c5e9820f9 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -118,7 +118,6 @@ struct genpd_power_state { }; struct genpd_lock_ops; -struct dev_pm_opp; struct opp_table; struct generic_pm_domain { @@ -146,8 +145,6 @@ struct generic_pm_domain { int (*power_on)(struct generic_pm_domain *domain); struct raw_notifier_head power_notifiers; /* Power on/off notifiers */ struct opp_table *opp_table; /* OPP table of the genpd */ - unsigned int (*opp_to_performance_state)(struct generic_pm_domain *genpd, - struct dev_pm_opp *opp); int (*set_performance_state)(struct generic_pm_domain *genpd, unsigned int state); struct gpd_dev_ops dev_ops; @@ -348,8 +345,6 @@ int of_genpd_remove_subdomain(struct of_phandle_args *parent_spec, struct generic_pm_domain *of_genpd_remove_last(struct device_node *np); int of_genpd_parse_idle_states(struct device_node *dn, struct genpd_power_state **states, int *n); -unsigned int pm_genpd_opp_to_performance_state(struct device *genpd_dev, - struct dev_pm_opp *opp); int genpd_dev_pm_attach(struct device *dev); struct device *genpd_dev_pm_attach_by_id(struct device *dev, @@ -395,13 +390,6 @@ static inline int of_genpd_parse_idle_states(struct device_node *dn, return -ENODEV; } -static inline unsigned int -pm_genpd_opp_to_performance_state(struct device *genpd_dev, - struct dev_pm_opp *opp) -{ - return 0; -} - static inline int genpd_dev_pm_attach(struct device *dev) { return 0;
Since commit 7c41cdcd3bbe ("OPP: Simplify the over-designed pstate <-> level dance"), there is no longer any users of the pm_genpd_opp_to_performance_state() API. Let's therefore drop it and its corresponding ->opp_to_performance_state() callback, which also no longer has any users. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> --- drivers/base/power/domain.c | 32 -------------------------------- include/linux/pm_domain.h | 12 ------------ 2 files changed, 44 deletions(-)