More power management updates for 6.6-rc1

- Add Georgian translation to Makefile LANGUAGES in cpupower (Shuah
    Khan).
 
  - Add support for per-policy performance boost to cpufreq (Jie Zhan).
 
  - Fix assorted issues in the cpufreq core, common governor code and in
    the pcc cpufreq driver (Liao Chang).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmT2DucSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxGR8P/2vCQ9yfjgummWwG5FD/s/nFAryZJ/Ba
 2wAj/RP6qG4azewt20wctO1J0sbSMcOEqDKg3Kl3DRm76+iYO3mMfYy27gXLuhMU
 VooFEVYSlKjxmR3SPDsrk+uGahEN2nbJzRb37PJCu8nJbMQ/M81cQ5uOySSZJpYi
 Sc8ejT7mpQcabBPuoN/kPv4YVxHqTHdRbrt9bYEbQM492SSNWZqHLp4wiXBmrjoT
 wVGbFi3wdmyA/Zj/N4meJMBhCSBF9Dcqz1hMGya0d6Tqo9SdYo+zn5xO7xP/Xoco
 PdOhstARA8H4hlUo6BVtGrYNOhXcObIUzwtnXUrw4CeQggDRiPtx8Ogd9oFZRx1O
 gprCjYSrE7njNkBm/+ywg0vOOpdcOP49JqaauegffuLKm5BZJfAicPyFAYyRQ265
 zXF9t+VMYBcwXOLlbPG12Dck00HQsO6mWsctwIcgGiaRwBxCebBohoA2luHQ/ceE
 pIBKFTtm+HVAFWMWHzuncIGMo20tq/JTB1qj1EQrvPa9QANN6yzWTD9oci5eCjAb
 CdWDKrcDToLHmQ3jXG3BnBVG3q7uzhpscu3knL+Zt06C0bISkxNTXmU+Q61Kxfbe
 J1gtAT+sOJqApG4iA/fuAWLKgQnaXZ5i1olVJculZ/KREMHUckAoqeRuiXyAAc1z
 PqY5mmUksK0Z
 =2mPX
 -----END PGP SIGNATURE-----

Merge tag 'pm-6.6-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull more power management updates from Rafael Wysocki:
 "These fix cpufreq core and the pcc cpufreq driver, add per-policy
  boost support to cpufreq and add Georgian translation Makefile
  LANGUAGES in cpupower.

  Specifics:

   - Add Georgian translation to Makefile LANGUAGES in cpupower (Shuah
     Khan).

   - Add support for per-policy performance boost to cpufreq (Jie Zhan).

   - Fix assorted issues in the cpufreq core, common governor code and
     in the pcc cpufreq driver (Liao Chang)"

* tag 'pm-6.6-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  cpufreq: Support per-policy performance boost
  cpufreq: pcc: Fix the potentinal scheduling delays in target_index()
  cpufreq: governor: Free dbs_data directly when gov->init() fails
  cpufreq: Fix the race condition while updating the transition_task of policy
  cpufreq: Avoid printing kernel addresses in cpufreq_resume()
  cpupower: Add Georgian translation to Makefile LANGUAGES
This commit is contained in:
Linus Torvalds 2023-09-04 15:21:55 -07:00
commit ea4f9c37f7
5 changed files with 57 additions and 7 deletions

View File

@ -86,6 +86,7 @@ static void cpufreq_governor_limits(struct cpufreq_policy *policy);
static int cpufreq_set_policy(struct cpufreq_policy *policy,
struct cpufreq_governor *new_gov,
unsigned int new_pol);
static bool cpufreq_boost_supported(void);
/*
* Two notifier lists: the "policy" list is involved in the
@ -455,8 +456,10 @@ void cpufreq_freq_transition_end(struct cpufreq_policy *policy,
policy->cur,
policy->cpuinfo.max_freq);
spin_lock(&policy->transition_lock);
policy->transition_ongoing = false;
policy->transition_task = NULL;
spin_unlock(&policy->transition_lock);
wake_up(&policy->transition_wait);
}
@ -621,6 +624,40 @@ static ssize_t store_boost(struct kobject *kobj, struct kobj_attribute *attr,
}
define_one_global_rw(boost);
static ssize_t show_local_boost(struct cpufreq_policy *policy, char *buf)
{
return sysfs_emit(buf, "%d\n", policy->boost_enabled);
}
static ssize_t store_local_boost(struct cpufreq_policy *policy,
const char *buf, size_t count)
{
int ret, enable;
ret = kstrtoint(buf, 10, &enable);
if (ret || enable < 0 || enable > 1)
return -EINVAL;
if (!cpufreq_driver->boost_enabled)
return -EINVAL;
if (policy->boost_enabled == enable)
return count;
cpus_read_lock();
ret = cpufreq_driver->set_boost(policy, enable);
cpus_read_unlock();
if (ret)
return ret;
policy->boost_enabled = enable;
return count;
}
static struct freq_attr local_boost = __ATTR(boost, 0644, show_local_boost, store_local_boost);
static struct cpufreq_governor *find_governor(const char *str_governor)
{
struct cpufreq_governor *t;
@ -1055,6 +1092,12 @@ static int cpufreq_add_dev_interface(struct cpufreq_policy *policy)
return ret;
}
if (cpufreq_boost_supported()) {
ret = sysfs_create_file(&policy->kobj, &local_boost.attr);
if (ret)
return ret;
}
return 0;
}
@ -1943,16 +1986,16 @@ void cpufreq_resume(void)
for_each_active_policy(policy) {
if (cpufreq_driver->resume && cpufreq_driver->resume(policy)) {
pr_err("%s: Failed to resume driver: %p\n", __func__,
policy);
pr_err("%s: Failed to resume driver: %s\n", __func__,
cpufreq_driver->name);
} else if (has_target()) {
down_write(&policy->rwsem);
ret = cpufreq_start_governor(policy);
up_write(&policy->rwsem);
if (ret)
pr_err("%s: Failed to start governor for policy: %p\n",
__func__, policy);
pr_err("%s: Failed to start governor for CPU%u's policy\n",
__func__, policy->cpu);
}
}
}
@ -2716,6 +2759,8 @@ int cpufreq_boost_trigger_state(int state)
ret = cpufreq_driver->set_boost(policy, state);
if (ret)
goto err_reset_state;
policy->boost_enabled = state;
}
cpus_read_unlock();

View File

@ -439,7 +439,7 @@ int cpufreq_dbs_governor_init(struct cpufreq_policy *policy)
ret = gov->init(dbs_data);
if (ret)
goto free_policy_dbs_info;
goto free_dbs_data;
/*
* The sampling interval should not be less than the transition latency
@ -474,6 +474,8 @@ int cpufreq_dbs_governor_init(struct cpufreq_policy *policy)
if (!have_governor_per_policy())
gov->gdbs_data = NULL;
gov->exit(dbs_data);
free_dbs_data:
kfree(dbs_data);
free_policy_dbs_info:

View File

@ -232,8 +232,8 @@ static int pcc_cpufreq_target(struct cpufreq_policy *policy,
status = ioread16(&pcch_hdr->status);
iowrite16(0, &pcch_hdr->status);
cpufreq_freq_transition_end(policy, &freqs, status != CMD_COMPLETE);
spin_unlock(&pcc_lock);
cpufreq_freq_transition_end(policy, &freqs, status != CMD_COMPLETE);
if (status != CMD_COMPLETE) {
pr_debug("target: FAILED for cpu %d, with status: 0x%x\n",

View File

@ -141,6 +141,9 @@ struct cpufreq_policy {
*/
bool dvfs_possible_from_any_cpu;
/* Per policy boost enabled flag. */
bool boost_enabled;
/* Cached frequency lookup from cpufreq_driver_resolve_freq. */
unsigned int cached_target_freq;
unsigned int cached_resolved_idx;

View File

@ -57,7 +57,7 @@ LIB_MIN= 1
PACKAGE = cpupower
PACKAGE_BUGREPORT = linux-pm@vger.kernel.org
LANGUAGES = de fr it cs pt
LANGUAGES = de fr it cs pt ka
# Directory definitions. These are default and most probably