cpufreq arm fixes for 6.2-rc4
- Fix double initialization and set suspend-freq for Apple's cpufreq driver (Arnd Bergmann and Hector Martin). - Fix reading of "reg" property, update cpufreq-dt's blocklist and update DT documentation for Qualcomm's cpufreq driver (Konrad Dybcio and Krzysztof Kozlowski). - Replace 0 with NULL for Armada driver (Miles Chen). - Fix potential overflows in CPPC driver (Pierre Gondois). - Update blocklist for Tegra234 Soc (Sumit Gupta). -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEx73Crsp7f6M6scA70rkcPK6BEhwFAmO85PsACgkQ0rkcPK6B EhzQehAAgTSEyTL9ptUxmuRv9BVyM6t7rVDkGILWTrmbVSfZ5big2Qc8u58eeFg6 BfJ75bRGdKZLZa6N3lU/wd9wUs9dnUOLwVO2xKEYhcoEJI2MMKRfhcul2WUD9U0w PXQKC8sJFLSdYoTwg8TfRSqSHuYabYbO3v3LsxT5+gq5Xt6cjw38X1WvZUzAq/rD RdBRdbl9oXt2jqDMVsVtOxrc122MDVcp90ntqvkGQM+4lK4icBTOGOycMgNDL//8 6CXGlrHFL5+yRDvu1AZbwgKbABFjFIe7KrzeUqQx54q8P13HUY1ZexdKGN3/gf2x LK0xgT6XDg3sxl/grGyZESmRvGc+yUZn/REz9f1m2LETpmyKIcfycXHKU4q/xx1L t1VE2vIN230wAbQHirsZGuTX/CsOhEnlxNE/Q/E49zFw2ym1Gi5hBivMf3B9Pzb0 W8Z9EV/c9vZmKqdJHvTl7FZGS6NPz26BWq82YPfwyv8oCAKU90bQRqq5kHftOthF NVtIikkGHXMhzy10vSSzMwlbv2q8m4blzqLnoTn3B3B2X1L6PfA4+55C+efTw+g4 8xKpugCLTXXVSUJ9FzXfLlRGETO/Mfi2mgKYFpBYqZg//D7LDLwQCCWdlbM3jza2 GYPm3s+79gew3SRymKzj6n+fyL1/zoi5fRUD8pAyc99iEuojb2I= =wSbZ -----END PGP SIGNATURE----- Merge tag 'cpufreq/arm/fixes-6.2-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull cpufreq ARM fixes for 6.2-rc4 from Viresh Kumar: "- Fix double initialization and set suspend-freq for Apple's cpufreq driver (Arnd Bergmann and Hector Martin). - Fix reading of "reg" property, update cpufreq-dt's blocklist and update DT documentation for Qualcomm's cpufreq driver (Konrad Dybcio and Krzysztof Kozlowski). - Replace 0 with NULL for Armada driver (Miles Chen). - Fix potential overflows in CPPC driver (Pierre Gondois). - Update blocklist for Tegra234 Soc (Sumit Gupta)."
This commit is contained in:
commit
7e834ff13c
Documentation/devicetree/bindings/cpufreq
drivers/cpufreq
@ -54,6 +54,17 @@ properties:
|
||||
- const: xo
|
||||
- const: alternate
|
||||
|
||||
interrupts:
|
||||
minItems: 1
|
||||
maxItems: 3
|
||||
|
||||
interrupt-names:
|
||||
minItems: 1
|
||||
items:
|
||||
- const: dcvsh-irq-0
|
||||
- const: dcvsh-irq-1
|
||||
- const: dcvsh-irq-2
|
||||
|
||||
'#freq-domain-cells':
|
||||
const: 1
|
||||
|
||||
|
@ -280,6 +280,7 @@ static int apple_soc_cpufreq_init(struct cpufreq_policy *policy)
|
||||
policy->cpuinfo.transition_latency = transition_latency;
|
||||
policy->dvfs_possible_from_any_cpu = true;
|
||||
policy->fast_switch_possible = true;
|
||||
policy->suspend_freq = freq_table[0].frequency;
|
||||
|
||||
if (policy_has_boost_freq(policy)) {
|
||||
ret = cpufreq_enable_boost_support();
|
||||
@ -321,7 +322,6 @@ static struct cpufreq_driver apple_soc_cpufreq_driver = {
|
||||
.flags = CPUFREQ_HAVE_GOVERNOR_PER_POLICY |
|
||||
CPUFREQ_NEED_INITIAL_FREQ_CHECK | CPUFREQ_IS_COOLING_DEV,
|
||||
.verify = cpufreq_generic_frequency_table_verify,
|
||||
.attr = cpufreq_generic_attr,
|
||||
.get = apple_soc_cpufreq_get_rate,
|
||||
.init = apple_soc_cpufreq_init,
|
||||
.exit = apple_soc_cpufreq_exit,
|
||||
@ -329,6 +329,7 @@ static struct cpufreq_driver apple_soc_cpufreq_driver = {
|
||||
.fast_switch = apple_soc_cpufreq_fast_switch,
|
||||
.register_em = cpufreq_register_em_with_opp,
|
||||
.attr = apple_soc_cpufreq_hw_attr,
|
||||
.suspend = cpufreq_generic_suspend,
|
||||
};
|
||||
|
||||
static int __init apple_soc_cpufreq_module_init(void)
|
||||
|
@ -445,7 +445,7 @@ static int __init armada37xx_cpufreq_driver_init(void)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
clk = clk_get(cpu_dev, 0);
|
||||
clk = clk_get(cpu_dev, NULL);
|
||||
if (IS_ERR(clk)) {
|
||||
dev_err(cpu_dev, "Cannot get clock for CPU0\n");
|
||||
return PTR_ERR(clk);
|
||||
|
@ -487,7 +487,8 @@ static unsigned int get_perf_level_count(struct cpufreq_policy *policy)
|
||||
cpu_data = policy->driver_data;
|
||||
perf_caps = &cpu_data->perf_caps;
|
||||
max_cap = arch_scale_cpu_capacity(cpu);
|
||||
min_cap = div_u64(max_cap * perf_caps->lowest_perf, perf_caps->highest_perf);
|
||||
min_cap = div_u64((u64)max_cap * perf_caps->lowest_perf,
|
||||
perf_caps->highest_perf);
|
||||
if ((min_cap == 0) || (max_cap < min_cap))
|
||||
return 0;
|
||||
return 1 + max_cap / CPPC_EM_CAP_STEP - min_cap / CPPC_EM_CAP_STEP;
|
||||
@ -519,10 +520,10 @@ static int cppc_get_cpu_power(struct device *cpu_dev,
|
||||
cpu_data = policy->driver_data;
|
||||
perf_caps = &cpu_data->perf_caps;
|
||||
max_cap = arch_scale_cpu_capacity(cpu_dev->id);
|
||||
min_cap = div_u64(max_cap * perf_caps->lowest_perf,
|
||||
perf_caps->highest_perf);
|
||||
|
||||
perf_step = CPPC_EM_CAP_STEP * perf_caps->highest_perf / max_cap;
|
||||
min_cap = div_u64((u64)max_cap * perf_caps->lowest_perf,
|
||||
perf_caps->highest_perf);
|
||||
perf_step = div_u64((u64)CPPC_EM_CAP_STEP * perf_caps->highest_perf,
|
||||
max_cap);
|
||||
min_step = min_cap / CPPC_EM_CAP_STEP;
|
||||
max_step = max_cap / CPPC_EM_CAP_STEP;
|
||||
|
||||
|
@ -137,6 +137,7 @@ static const struct of_device_id blocklist[] __initconst = {
|
||||
{ .compatible = "nvidia,tegra30", },
|
||||
{ .compatible = "nvidia,tegra124", },
|
||||
{ .compatible = "nvidia,tegra210", },
|
||||
{ .compatible = "nvidia,tegra234", },
|
||||
|
||||
{ .compatible = "qcom,apq8096", },
|
||||
{ .compatible = "qcom,msm8996", },
|
||||
@ -150,6 +151,7 @@ static const struct of_device_id blocklist[] __initconst = {
|
||||
{ .compatible = "qcom,sdm845", },
|
||||
{ .compatible = "qcom,sm6115", },
|
||||
{ .compatible = "qcom,sm6350", },
|
||||
{ .compatible = "qcom,sm6375", },
|
||||
{ .compatible = "qcom,sm8150", },
|
||||
{ .compatible = "qcom,sm8250", },
|
||||
{ .compatible = "qcom,sm8350", },
|
||||
|
@ -649,9 +649,10 @@ static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct clk_hw_onecell_data *clk_data;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct device_node *soc_node;
|
||||
struct device *cpu_dev;
|
||||
struct clk *clk;
|
||||
int ret, i, num_domains;
|
||||
int ret, i, num_domains, reg_sz;
|
||||
|
||||
clk = clk_get(dev, "xo");
|
||||
if (IS_ERR(clk))
|
||||
@ -679,7 +680,21 @@ static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
|
||||
/* Allocate qcom_cpufreq_data based on the available frequency domains in DT */
|
||||
num_domains = of_property_count_elems_of_size(dev->of_node, "reg", sizeof(u32) * 4);
|
||||
soc_node = of_get_parent(dev->of_node);
|
||||
if (!soc_node)
|
||||
return -EINVAL;
|
||||
|
||||
ret = of_property_read_u32(soc_node, "#address-cells", ®_sz);
|
||||
if (ret)
|
||||
goto of_exit;
|
||||
|
||||
ret = of_property_read_u32(soc_node, "#size-cells", &i);
|
||||
if (ret)
|
||||
goto of_exit;
|
||||
|
||||
reg_sz += i;
|
||||
|
||||
num_domains = of_property_count_elems_of_size(dev->of_node, "reg", sizeof(u32) * reg_sz);
|
||||
if (num_domains <= 0)
|
||||
return num_domains;
|
||||
|
||||
@ -743,6 +758,9 @@ static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev)
|
||||
else
|
||||
dev_dbg(dev, "QCOM CPUFreq HW driver initialized\n");
|
||||
|
||||
of_exit:
|
||||
of_node_put(soc_node);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user