Commit 507f811f authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull more power management updates from Rafael Wysocki:
 "These are ARM cpufreq updates and operating performance points (OPP)
  updates plus one cpuidle update adding a new trace point.

  Specifics:

   - Fix return error code in mtk_cpu_dvfs_info_init (Yang Yingliang).

   - Minor cleanups and support for new boards for Qcom cpufreq drivers
     (Bryan O'Donoghue, Konrad Dybcio, Pierre Gondois, and Yicong Yang).

   - Fix sparse warnings for Tegra cpufreq driver (Viresh Kumar).

   - Make dev_pm_opp_set_regulators() accept NULL terminated list
     (Viresh Kumar).

   - Add dev_pm_opp_set_config() and friends and migrate other users and
     helpers to using them (Viresh Kumar).

   - Add support for multiple clocks for a device (Viresh Kumar and
     Krzysztof Kozlowski).

   - Configure resources before adding OPP table for Venus (Stanimir
     Varbanov).

   - Keep reference count up for opp->np and opp_table->np while they
     are still in use (Liang He).

   - Minor OPP cleanups (Viresh Kumar and Yang Li).

   - Add a trace event for cpuidle to track missed (too deep or too
     shallow) wakeups (Kajetan Puchalski)"

* tag 'pm-5.20-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (55 commits)
  cpuidle: Add cpu_idle_miss trace event
  venus: pm_helpers: Fix warning in OPP during probe
  OPP: Don't drop opp->np reference while it is still in use
  OPP: Don't drop opp_table->np reference while it is still in use
  cpufreq: tegra194: Staticize struct tegra_cpufreq_soc instances
  dt-bindings: cpufreq: cpufreq-qcom-hw: Add SM6375 compatible
  dt-bindings: opp: Add msm8939 to the compatible list
  dt-bindings: opp: Add missing compat devices
  dt-bindings: opp: opp-v2-kryo-cpu: Fix example binding checks
  cpufreq: Change order of online() CB and policy->cpus modification
  cpufreq: qcom-hw: Remove deprecated irq_set_affinity_hint() call
  cpufreq: qcom-hw: Disable LMH irq when disabling policy
  cpufreq: qcom-hw: Reset cancel_throttle when policy is re-enabled
  cpufreq: qcom-cpufreq-hw: use HZ_PER_KHZ macro in units.h
  cpufreq: mediatek: fix error return code in mtk_cpu_dvfs_info_init()
  OPP: Remove dev{m}_pm_opp_of_add_table_noclk()
  PM / devfreq: tegra30: Register config_clks helper
  OPP: Allow config_clks helper for single clk case
  OPP: Provide a simple implementation to configure multiple clocks
  OPP: Assert clk_count == 1 for single clk helpers
  ...
parents 033c88d5 c3f834df
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ properties:
      - description: v2 of CPUFREQ HW (EPSS)
        items:
          - enum:
              - qcom,sm6375-cpufreq-epss
              - qcom,sm8250-cpufreq-epss
          - const: qcom,cpufreq-epss

+7 −0
Original line number Diff line number Diff line
@@ -22,6 +22,13 @@ select:
    compatible:
      contains:
        enum:
          - qcom,apq8064
          - qcom,apq8096
          - qcom,ipq8064
          - qcom,msm8939
          - qcom,msm8960
          - qcom,msm8974
          - qcom,msm8996
          - qcom,qcs404
  required:
    - compatible
+10 −0
Original line number Diff line number Diff line
@@ -50,6 +50,16 @@ patternProperties:
          property to uniquely identify the OPP nodes exists. Devices like power
          domains must have another (implementation dependent) property.

          Entries for multiple clocks shall be provided in the same field, as
          array of frequencies.  The OPP binding doesn't provide any provisions
          to relate the values to their clocks or the order in which the clocks
          need to be configured and that is left for the implementation
          specific binding.
        minItems: 1
        maxItems: 16
        items:
          maxItems: 1

      opp-microvolt:
        description: |
          Voltage for the OPP
+15 −0
Original line number Diff line number Diff line
@@ -98,6 +98,8 @@ examples:
                capacity-dmips-mhz = <1024>;
                clocks = <&kryocc 0>;
                operating-points-v2 = <&cluster0_opp>;
                power-domains = <&cpr>;
                power-domain-names = "cpr";
                #cooling-cells = <2>;
                next-level-cache = <&L2_0>;
                L2_0: l2-cache {
@@ -115,6 +117,8 @@ examples:
                capacity-dmips-mhz = <1024>;
                clocks = <&kryocc 0>;
                operating-points-v2 = <&cluster0_opp>;
                power-domains = <&cpr>;
                power-domain-names = "cpr";
                #cooling-cells = <2>;
                next-level-cache = <&L2_0>;
            };
@@ -128,6 +132,8 @@ examples:
                capacity-dmips-mhz = <1024>;
                clocks = <&kryocc 1>;
                operating-points-v2 = <&cluster1_opp>;
                power-domains = <&cpr>;
                power-domain-names = "cpr";
                #cooling-cells = <2>;
                next-level-cache = <&L2_1>;
                L2_1: l2-cache {
@@ -145,6 +151,8 @@ examples:
                capacity-dmips-mhz = <1024>;
                clocks = <&kryocc 1>;
                operating-points-v2 = <&cluster1_opp>;
                power-domains = <&cpr>;
                power-domain-names = "cpr";
                #cooling-cells = <2>;
                next-level-cache = <&L2_1>;
            };
@@ -182,18 +190,21 @@ examples:
                opp-microvolt = <905000 905000 1140000>;
                opp-supported-hw = <0x7>;
                clock-latency-ns = <200000>;
                required-opps = <&cpr_opp1>;
            };
            opp-1401600000 {
                opp-hz = /bits/ 64 <1401600000>;
                opp-microvolt = <1140000 905000 1140000>;
                opp-supported-hw = <0x5>;
                clock-latency-ns = <200000>;
                required-opps = <&cpr_opp2>;
            };
            opp-1593600000 {
                opp-hz = /bits/ 64 <1593600000>;
                opp-microvolt = <1140000 905000 1140000>;
                opp-supported-hw = <0x1>;
                clock-latency-ns = <200000>;
                required-opps = <&cpr_opp3>;
            };
        };

@@ -207,24 +218,28 @@ examples:
                opp-microvolt = <905000 905000 1140000>;
                opp-supported-hw = <0x7>;
                clock-latency-ns = <200000>;
                required-opps = <&cpr_opp1>;
            };
            opp-1804800000 {
                opp-hz = /bits/ 64 <1804800000>;
                opp-microvolt = <1140000 905000 1140000>;
                opp-supported-hw = <0x6>;
                clock-latency-ns = <200000>;
                required-opps = <&cpr_opp4>;
            };
            opp-1900800000 {
                opp-hz = /bits/ 64 <1900800000>;
                opp-microvolt = <1140000 905000 1140000>;
                opp-supported-hw = <0x4>;
                clock-latency-ns = <200000>;
                required-opps = <&cpr_opp5>;
            };
            opp-2150400000 {
                opp-hz = /bits/ 64 <2150400000>;
                opp-microvolt = <1140000 905000 1140000>;
                opp-supported-hw = <0x1>;
                clock-latency-ns = <200000>;
                required-opps = <&cpr_opp6>;
            };
        };

+9 −10
Original line number Diff line number Diff line
@@ -29,9 +29,9 @@ struct private_data {

	cpumask_var_t cpus;
	struct device *cpu_dev;
	struct opp_table *opp_table;
	struct cpufreq_frequency_table *freq_table;
	bool have_static_opps;
	int opp_token;
};

static LIST_HEAD(priv_list);
@@ -193,7 +193,7 @@ static int dt_cpufreq_early_init(struct device *dev, int cpu)
	struct private_data *priv;
	struct device *cpu_dev;
	bool fallback = false;
	const char *reg_name;
	const char *reg_name[] = { NULL, NULL };
	int ret;

	/* Check if this CPU is already covered by some other policy */
@@ -218,12 +218,11 @@ static int dt_cpufreq_early_init(struct device *dev, int cpu)
	 * OPP layer will be taking care of regulators now, but it needs to know
	 * the name of the regulator first.
	 */
	reg_name = find_supply_name(cpu_dev);
	if (reg_name) {
		priv->opp_table = dev_pm_opp_set_regulators(cpu_dev, &reg_name,
							    1);
		if (IS_ERR(priv->opp_table)) {
			ret = PTR_ERR(priv->opp_table);
	reg_name[0] = find_supply_name(cpu_dev);
	if (reg_name[0]) {
		priv->opp_token = dev_pm_opp_set_regulators(cpu_dev, reg_name);
		if (priv->opp_token < 0) {
			ret = priv->opp_token;
			if (ret != -EPROBE_DEFER)
				dev_err(cpu_dev, "failed to set regulators: %d\n",
					ret);
@@ -295,7 +294,7 @@ static int dt_cpufreq_early_init(struct device *dev, int cpu)
out:
	if (priv->have_static_opps)
		dev_pm_opp_of_cpumask_remove_table(priv->cpus);
	dev_pm_opp_put_regulators(priv->opp_table);
	dev_pm_opp_put_regulators(priv->opp_token);
free_cpumask:
	free_cpumask_var(priv->cpus);
	return ret;
@@ -309,7 +308,7 @@ static void dt_cpufreq_release(void)
		dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &priv->freq_table);
		if (priv->have_static_opps)
			dev_pm_opp_of_cpumask_remove_table(priv->cpus);
		dev_pm_opp_put_regulators(priv->opp_table);
		dev_pm_opp_put_regulators(priv->opp_token);
		free_cpumask_var(priv->cpus);
		list_del(&priv->node);
	}
Loading