Skip to content

Commit bc62158

Browse files
committed
Merge branch 'pm-cpufreq'
Merge cpufreq fixes for 5.19-rc5, including ARM cpufreq fixes and the following one: - Make amd-pstate enable CPPC on resume from S3 (Jinzhou Su). * pm-cpufreq: cpufreq: Add MT8186 to cpufreq-dt-platdev blocklist cpufreq: pmac32-cpufreq: Fix refcount leak bug cpufreq: qcom-hw: Don't do lmh things without a throttle interrupt drivers: cpufreq: Add missing of_node_put() in qoriq-cpufreq.c cpufreq: amd-pstate: Add resume and suspend callbacks
2 parents 589cb2c + 049b1ed commit bc62158

File tree

5 files changed

+36
-0
lines changed

5 files changed

+36
-0
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,28 @@ static int amd_pstate_cpu_exit(struct cpufreq_policy *policy)
566566
return 0;
567567
}
568568

569+
static int amd_pstate_cpu_resume(struct cpufreq_policy *policy)
570+
{
571+
int ret;
572+
573+
ret = amd_pstate_enable(true);
574+
if (ret)
575+
pr_err("failed to enable amd-pstate during resume, return %d\n", ret);
576+
577+
return ret;
578+
}
579+
580+
static int amd_pstate_cpu_suspend(struct cpufreq_policy *policy)
581+
{
582+
int ret;
583+
584+
ret = amd_pstate_enable(false);
585+
if (ret)
586+
pr_err("failed to disable amd-pstate during suspend, return %d\n", ret);
587+
588+
return ret;
589+
}
590+
569591
/* Sysfs attributes */
570592

571593
/*
@@ -636,6 +658,8 @@ static struct cpufreq_driver amd_pstate_driver = {
636658
.target = amd_pstate_target,
637659
.init = amd_pstate_cpu_init,
638660
.exit = amd_pstate_cpu_exit,
661+
.suspend = amd_pstate_cpu_suspend,
662+
.resume = amd_pstate_cpu_resume,
639663
.set_boost = amd_pstate_set_boost,
640664
.name = "amd-pstate",
641665
.attr = amd_pstate_attr,

drivers/cpufreq/cpufreq-dt-platdev.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ static const struct of_device_id blocklist[] __initconst = {
127127
{ .compatible = "mediatek,mt8173", },
128128
{ .compatible = "mediatek,mt8176", },
129129
{ .compatible = "mediatek,mt8183", },
130+
{ .compatible = "mediatek,mt8186", },
130131
{ .compatible = "mediatek,mt8365", },
131132
{ .compatible = "mediatek,mt8516", },
132133

drivers/cpufreq/pmac32-cpufreq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,10 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
470470
if (slew_done_gpio_np)
471471
slew_done_gpio = read_gpio(slew_done_gpio_np);
472472

473+
of_node_put(volt_gpio_np);
474+
of_node_put(freq_gpio_np);
475+
of_node_put(slew_done_gpio_np);
476+
473477
/* If we use the frequency GPIOs, calculate the min/max speeds based
474478
* on the bus frequencies
475479
*/

drivers/cpufreq/qcom-cpufreq-hw.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,9 @@ static int qcom_cpufreq_hw_cpu_online(struct cpufreq_policy *policy)
442442
struct platform_device *pdev = cpufreq_get_driver_data();
443443
int ret;
444444

445+
if (data->throttle_irq <= 0)
446+
return 0;
447+
445448
ret = irq_set_affinity_hint(data->throttle_irq, policy->cpus);
446449
if (ret)
447450
dev_err(&pdev->dev, "Failed to set CPU affinity of %s[%d]\n",
@@ -469,6 +472,9 @@ static int qcom_cpufreq_hw_cpu_offline(struct cpufreq_policy *policy)
469472

470473
static void qcom_cpufreq_hw_lmh_exit(struct qcom_cpufreq_data *data)
471474
{
475+
if (data->throttle_irq <= 0)
476+
return;
477+
472478
free_irq(data->throttle_irq, data);
473479
}
474480

drivers/cpufreq/qoriq-cpufreq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ static int qoriq_cpufreq_probe(struct platform_device *pdev)
275275

276276
np = of_find_matching_node(NULL, qoriq_cpufreq_blacklist);
277277
if (np) {
278+
of_node_put(np);
278279
dev_info(&pdev->dev, "Disabling due to erratum A-008083");
279280
return -ENODEV;
280281
}

0 commit comments

Comments
 (0)