From: Rafael J. Wysocki Date: Mon, 11 Mar 2024 14:59:51 +0000 (+0100) Subject: Merge branch 'pm-em' X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3bd834640baa1e220a79e27d2033e2ef3a29124a;p=linux.git Merge branch 'pm-em' 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() ... --- 3bd834640baa1e220a79e27d2033e2ef3a29124a diff --cc drivers/powercap/dtpm_cpu.c index ae7ee611978ba,ee0d1aa3e0239..bc90126f1b5f6 --- a/drivers/powercap/dtpm_cpu.c +++ b/drivers/powercap/dtpm_cpu.c @@@ -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);