Merge branch 'pm-em'
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 11 Mar 2024 14:59:51 +0000 (15:59 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 11 Mar 2024 14:59:51 +0000 (15:59 +0100)
Merge Enery Model changes for 6.9-rc1:

 - Allow the Energy Model to be updated dynamically (Lukasz Luba).

* pm-em: (24 commits)
  PM: EM: Fix nr_states warnings in static checks
  Documentation: EM: Update with runtime modification design
  PM: EM: Add em_dev_compute_costs()
  PM: EM: Remove old table
  PM: EM: Change debugfs configuration to use runtime EM table data
  drivers/thermal/devfreq_cooling: Use new Energy Model interface
  drivers/thermal/cpufreq_cooling: Use new Energy Model interface
  powercap/dtpm_devfreq: Use new Energy Model interface to get table
  powercap/dtpm_cpu: Use new Energy Model interface to get table
  PM: EM: Optimize em_cpu_energy() and remove division
  PM: EM: Support late CPUs booting and capacity adjustment
  PM: EM: Add performance field to struct em_perf_state and optimize
  PM: EM: Add em_perf_state_from_pd() to get performance states table
  PM: EM: Introduce em_dev_update_perf_domain() for EM updates
  PM: EM: Add functions for memory allocations for new EM tables
  PM: EM: Use runtime modified EM for CPUs energy estimation in EAS
  PM: EM: Introduce runtime modifiable table
  PM: EM: Split the allocation and initialization of the EM table
  PM: EM: Check if the get_cost() callback is present in em_compute_costs()
  PM: EM: Introduce em_compute_costs()
  ...

1  2 
drivers/powercap/dtpm_cpu.c

index ae7ee611978ba1ad44b44e92b92a254673658969,ee0d1aa3e0239e61e44b629520fe2f24188929ab..bc90126f1b5f60e3cef1f677ee05aef0c8cc8595
@@@ -143,7 -158,7 +158,7 @@@ static void pd_release(struct dtpm *dtp
  
                cpufreq_cpu_put(policy);
        }
--      
++
        kfree(dtpm_cpu);
  }
  
@@@ -216,10 -232,13 +232,13 @@@ static int __dtpm_cpu_setup(int cpu, st
        if (ret)
                goto out_kfree_dtpm_cpu;
  
+       rcu_read_lock();
+       table = em_perf_state_from_pd(pd);
        ret = freq_qos_add_request(&policy->constraints,
                                   &dtpm_cpu->qos_req, FREQ_QOS_MAX,
-                                  pd->table[pd->nr_perf_states - 1].frequency);
+                                  table[pd->nr_perf_states - 1].frequency);
+       rcu_read_unlock();
 -      if (ret)
 +      if (ret < 0)
                goto out_dtpm_unregister;
  
        cpufreq_cpu_put(policy);