cpufreq: manage common sysfs attributes from core
Subsystems (16)
Viresh Kumar
maintainercover cpufreq: manage common sysfs attributes from core
Hello,
Most of the drivers add available and boost frequencies related attributes. This patch series tries to avoid duplication and simplify driver's code by managing these from core code.
A quick search revealed that only the drivers that set the policy->freq_table field, enable these attributes. Which makes sense as well, since the show_available_freqs() helper works only if the freq_table is present.
In order to simplify drivers, create the relevant sysfs files forcefully from cpufreq core.
Pushed here:
git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git cpufreq/core-attr
--
Viresh
Viresh Kumar (33):
cpufreq: Always create freq-table related sysfs file
cpufreq: dt: Stop setting cpufreq_driver->attr field
cpufreq: acpi: Stop setting common freq attributes
cpufreq: apple: Stop setting cpufreq_driver->attr field
cpufreq: bmips: Stop setting cpufreq_driver->attr field
cpufreq: brcmstb: Stop setting common freq attributes
cpufreq: davinci: Stop setting cpufreq_driver->attr field
cpufreq: e_powersaver: Stop setting cpufreq_driver->attr field
cpufreq: elanfreq: Stop setting cpufreq_driver->attr field
cpufreq: imx6q: Stop setting cpufreq_driver->attr field
cpufreq: kirkwood: Stop setting cpufreq_driver->attr field
cpufreq: longhaul: Stop setting cpufreq_driver->attr field
cpufreq: loongson: Stop setting cpufreq_driver->attr field
cpufreq: mediatek: Stop setting cpufreq_driver->attr field
cpufreq: omap: Stop setting cpufreq_driver->attr field
cpufreq: p4: Stop setting cpufreq_driver->attr field
cpufreq: pasemi: Stop setting cpufreq_driver->attr field
cpufreq: pmac: Stop setting cpufreq_driver->attr field
cpufreq: powernow: Stop setting cpufreq_driver->attr field
cpufreq: powernv: Stop setting common freq attributes
cpufreq: qcom: Stop setting cpufreq_driver->attr field
cpufreq: qoriq: Stop setting cpufreq_driver->attr field
cpufreq: sc520_freq: Stop setting cpufreq_driver->attr field
cpufreq: scmi: Stop setting cpufreq_driver->attr field
cpufreq: scpi: Stop setting cpufreq_driver->attr field
cpufreq: sh: Stop setting cpufreq_driver->attr field
cpufreq: spear: Stop setting cpufreq_driver->attr field
cpufreq: speedstep: Stop setting cpufreq_driver->attr field
cpufreq: tegra: Stop setting cpufreq_driver->attr field
cpufreq: vexpress: Stop setting cpufreq_driver->attr field
cpufreq: virtual: Stop setting cpufreq_driver->attr field
cpufreq: Remove cpufreq_generic_attrs
cpufreq: Stop checking for duplicate available/boost freq attributes
drivers/cpufreq/acpi-cpufreq.c | 1 - drivers/cpufreq/apple-soc-cpufreq.c | 8 -------- drivers/cpufreq/bmips-cpufreq.c | 1 - drivers/cpufreq/brcmstb-avs-cpufreq.c | 1 - drivers/cpufreq/cpufreq-dt.c | 8 -------- drivers/cpufreq/cpufreq.c | 15 +++++++++++++++ drivers/cpufreq/davinci-cpufreq.c | 1 - drivers/cpufreq/e_powersaver.c | 1 - drivers/cpufreq/elanfreq.c | 1 - drivers/cpufreq/freq_table.c | 8 -------- drivers/cpufreq/imx6q-cpufreq.c | 1 - drivers/cpufreq/kirkwood-cpufreq.c | 1 - drivers/cpufreq/longhaul.c | 1 - drivers/cpufreq/loongson2_cpufreq.c | 1 - drivers/cpufreq/loongson3_cpufreq.c | 1 - drivers/cpufreq/mediatek-cpufreq-hw.c | 1 - drivers/cpufreq/mediatek-cpufreq.c | 1 - drivers/cpufreq/omap-cpufreq.c | 1 - drivers/cpufreq/p4-clockmod.c | 1 - drivers/cpufreq/pasemi-cpufreq.c | 1 - drivers/cpufreq/pmac32-cpufreq.c | 1 - drivers/cpufreq/pmac64-cpufreq.c | 1 - drivers/cpufreq/powernow-k6.c | 1 - drivers/cpufreq/powernow-k7.c | 1 - drivers/cpufreq/powernow-k8.c | 1 - drivers/cpufreq/powernv-cpufreq.c | 2 -- drivers/cpufreq/qcom-cpufreq-hw.c | 7 ------- drivers/cpufreq/qoriq-cpufreq.c | 1 - drivers/cpufreq/sc520_freq.c | 1 - drivers/cpufreq/scmi-cpufreq.c | 8 -------- drivers/cpufreq/scpi-cpufreq.c | 1 - drivers/cpufreq/sh-cpufreq.c | 1 - drivers/cpufreq/spear-cpufreq.c | 1 - drivers/cpufreq/speedstep-centrino.c | 1 - drivers/cpufreq/speedstep-ich.c | 1 - drivers/cpufreq/speedstep-smi.c | 1 - drivers/cpufreq/tegra186-cpufreq.c | 1 - drivers/cpufreq/tegra194-cpufreq.c | 1 - drivers/cpufreq/vexpress-spc-cpufreq.c | 1 - drivers/cpufreq/virtual-cpufreq.c | 1 - include/linux/cpufreq.h | 1 - 41 files changed, 15 insertions(+), 75 deletions(-)
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 1/33 cpufreq: Always create freq-table related sysfs file
Currently it is left for the individual drivers to set the available and boost frequencies related attributes in the cpufreq_driver->attr field. Some drivers provide them, while others don't.
A quick search revealed that only the drivers that set the policy->freq_table field, enable these attributes. Which makes sense as well, since the show_available_freqs() helper works only if the freq_table is present.
In order to simplify drivers, create the relevant sysfs files forcefully from cpufreq core.
For now, skip adding them twice. This can be removed once all the drivers are updated.
--- drivers/cpufreq/cpufreq.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/cpufreq/cpufreq.c +22 -0
@@ -1058,9 +1058,31 @@ static int cpufreq_add_dev_interface(struct cpufreq_policy *policy)struct freq_attr **drv_attr;int ret =0 ; +/* Attributes that need freq_table */ +if (policy->freq_table) { + ret =sysfs_create_file (&policy->kobj, + &cpufreq_freq_attr_scaling_available_freqs.attr); +if (ret) +return ret; + +if (cpufreq_boost_supported ()) { + ret =sysfs_create_file (&policy->kobj, + &cpufreq_freq_attr_scaling_boost_freqs.attr); +if (ret) +return ret; + } + } +/* set up files for this cpu device */ drv_attr = cpufreq_driver->attr;while (drv_attr && *drv_attr) { +/* These are already added, skip them */ +if (*drv_attr == &cpufreq_freq_attr_scaling_available_freqs || + *drv_attr == &cpufreq_freq_attr_scaling_boost_freqs) { + drv_attr++; +continue ; + } + ret =sysfs_create_file (&policy->kobj, &((*drv_attr)->attr));if (ret)return ret;
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 2/33 cpufreq: dt: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/cpufreq-dt.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/cpufreq/cpufreq-dt.c +0 -8
@@ -36,12 +36,6 @@ struct private_data {static LIST_HEAD (priv_list); -static struct freq_attr *cpufreq_dt_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, -NULL ,/* Extra space for boost-attr if required */ -NULL , -}; -static struct private_data *cpufreq_dt_find_data (int cpu) {struct private_data *priv;
@@ -126,7 +120,6 @@ static int cpufreq_init(struct cpufreq_policy *policy) ret =cpufreq_enable_boost_support ();if (ret) goto out_clk_put; - cpufreq_dt_attr[1 ] = &cpufreq_freq_attr_scaling_boost_freqs; }return 0 ;
@@ -169,7 +162,6 @@ static struct cpufreq_driver dt_cpufreq_driver = { .offline = cpufreq_offline, .register_em = cpufreq_register_em_with_opp, .name = "cpufreq-dt", - .attr = cpufreq_dt_attr, .suspend = cpufreq_generic_suspend, };
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 3/33 cpufreq: acpi: Stop setting common freq attributes
In reply to Viresh KumarThe core handles this now, the driver can skip setting it.
--- drivers/cpufreq/acpi-cpufreq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/acpi-cpufreq.c +0 -1
@@ -936,7 +936,6 @@ static int acpi_cpufreq_resume(struct cpufreq_policy *policy) }static struct freq_attr *acpi_cpufreq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, &freqdomain_cpus, #ifdef CONFIG_X86_ACPI_CPUFREQ_CPB &cpb,
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 4/33 cpufreq: apple: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/apple-soc-cpufreq.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/cpufreq/apple-soc-cpufreq.c +0 -8
@@ -229,12 +229,6 @@ static int apple_soc_cpufreq_find_cluster(struct cpufreq_policy *policy,return 0 ; } -static struct freq_attr *apple_soc_cpufreq_hw_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, -NULL ,/* Filled in below if boost is enabled */ -NULL , -}; -static int apple_soc_cpufreq_init (struct cpufreq_policy *policy) {int ret, i;
@@ -321,7 +315,6 @@ static int apple_soc_cpufreq_init(struct cpufreq_policy *policy)if (ret) {dev_warn (cpu_dev,"failed to enable boost: %d\n" , ret); }else { - apple_soc_cpufreq_hw_attr[1 ] = &cpufreq_freq_attr_scaling_boost_freqs; apple_soc_cpufreq_driver.boost_enabled = true; } }
@@ -360,7 +353,6 @@ static struct cpufreq_driver apple_soc_cpufreq_driver = { .target_index = apple_soc_cpufreq_set_target, .fast_switch = apple_soc_cpufreq_fast_switch, .register_em = cpufreq_register_em_with_opp, - .attr = apple_soc_cpufreq_hw_attr, .suspend = cpufreq_generic_suspend, };
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 5/33 cpufreq: bmips: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/bmips-cpufreq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/bmips-cpufreq.c +0 -1
@@ -150,7 +150,6 @@ static struct cpufreq_driver bmips_cpufreq_driver = { .get = bmips_cpufreq_get, .init = bmips_cpufreq_init, .exit = bmips_cpufreq_exit, - .attr = cpufreq_generic_attr, .name = BMIPS_CPUFREQ_PREFIX, };
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 6/33 cpufreq: brcmstb: Stop setting common freq attributes
In reply to Viresh KumarThe cpufreq core handles this now, the driver can skip setting it.
--- drivers/cpufreq/brcmstb-avs-cpufreq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/brcmstb-avs-cpufreq.c +0 -1
@@ -720,7 +720,6 @@ cpufreq_freq_attr_ro(brcm_avs_voltage);cpufreq_freq_attr_ro (brcm_avs_frequency);static struct freq_attr *brcm_avs_cpufreq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, &brcm_avs_pstate, &brcm_avs_mode, &brcm_avs_pmap,
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 7/33 cpufreq: davinci: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/davinci-cpufreq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/davinci-cpufreq.c +0 -1
@@ -101,7 +101,6 @@ static struct cpufreq_driver davinci_driver = { .get = cpufreq_generic_get, .init = davinci_cpu_init, .name = "davinci", - .attr = cpufreq_generic_attr, };static int __init davinci_cpufreq_probe (struct platform_device *pdev)
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 8/33 cpufreq: e_powersaver: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/e_powersaver.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/e_powersaver.c +0 -1
@@ -376,7 +376,6 @@ static struct cpufreq_driver eps_driver = { .exit = eps_cpu_exit, .get = eps_get, .name = "e_powersaver", - .attr = cpufreq_generic_attr, };
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 9/33 cpufreq: elanfreq: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/elanfreq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/elanfreq.c +0 -1
@@ -194,7 +194,6 @@ static struct cpufreq_driver elanfreq_driver = { .target_index = elanfreq_target, .init = elanfreq_cpu_init, .name = "elanfreq", - .attr = cpufreq_generic_attr, };static const struct x86_cpu_id elan_id[] = {
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 10/33 cpufreq: imx6q: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/imx6q-cpufreq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/imx6q-cpufreq.c +0 -1
@@ -207,7 +207,6 @@ static struct cpufreq_driver imx6q_cpufreq_driver = { .init = imx6q_cpufreq_init, .register_em = cpufreq_register_em_with_opp, .name = "imx6q-cpufreq", - .attr = cpufreq_generic_attr, .suspend = cpufreq_generic_suspend, };
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 11/33 cpufreq: kirkwood: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/kirkwood-cpufreq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/kirkwood-cpufreq.c +0 -1
@@ -96,7 +96,6 @@ static struct cpufreq_driver kirkwood_cpufreq_driver = { .target_index = kirkwood_cpufreq_target, .init = kirkwood_cpufreq_cpu_init, .name = "kirkwood-cpufreq", - .attr = cpufreq_generic_attr, };static int kirkwood_cpufreq_probe (struct platform_device *pdev)
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 12/33 cpufreq: longhaul: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/longhaul.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/longhaul.c +0 -1
@@ -906,7 +906,6 @@ static struct cpufreq_driver longhaul_driver = { .get = longhaul_get, .init = longhaul_cpu_init, .name = "longhaul", - .attr = cpufreq_generic_attr, };static const struct x86_cpu_id longhaul_id[] = {
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 13/33 cpufreq: loongson: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the drivers can skip setting them.
--- drivers/cpufreq/loongson2_cpufreq.c | 1 - drivers/cpufreq/loongson3_cpufreq.c | 1 - 2 files changed, 2 deletions(-)
drivers/cpufreq/loongson2_cpufreq.c +0 -1
@@ -91,7 +91,6 @@ static struct cpufreq_driver loongson2_cpufreq_driver = { .verify = cpufreq_generic_frequency_table_verify, .target_index = loongson2_cpufreq_target, .get = cpufreq_generic_get, - .attr = cpufreq_generic_attr, };static const struct platform_device_id platform_device_ids[] = {
drivers/cpufreq/loongson3_cpufreq.c +0 -1
@@ -337,7 +337,6 @@ static struct cpufreq_driver loongson3_cpufreq_driver = { .offline = loongson3_cpufreq_cpu_offline, .get = loongson3_cpufreq_get, .target_index = loongson3_cpufreq_target, - .attr = cpufreq_generic_attr, .verify = cpufreq_generic_frequency_table_verify, .suspend = cpufreq_generic_suspend, };
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 14/33 cpufreq: mediatek: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/mediatek-cpufreq-hw.c | 1 - drivers/cpufreq/mediatek-cpufreq.c | 1 - 2 files changed, 2 deletions(-)
drivers/cpufreq/mediatek-cpufreq-hw.c +0 -1
@@ -293,7 +293,6 @@ static struct cpufreq_driver cpufreq_mtk_hw_driver = { .register_em = mtk_cpufreq_register_em, .fast_switch = mtk_cpufreq_hw_fast_switch, .name = "mtk-cpufreq-hw", - .attr = cpufreq_generic_attr, };static int mtk_cpufreq_hw_driver_probe (struct platform_device *pdev)
drivers/cpufreq/mediatek-cpufreq.c +0 -1
@@ -618,7 +618,6 @@ static struct cpufreq_driver mtk_cpufreq_driver = { .exit = mtk_cpufreq_exit, .register_em = cpufreq_register_em_with_opp, .name = "mtk-cpufreq", - .attr = cpufreq_generic_attr, };static int mtk_cpufreq_probe (struct platform_device *pdev)
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 15/33 cpufreq: omap: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/omap-cpufreq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/omap-cpufreq.c +0 -1
@@ -147,7 +147,6 @@ static struct cpufreq_driver omap_driver = { .exit = omap_cpu_exit, .register_em = cpufreq_register_em_with_opp, .name = "omap", - .attr = cpufreq_generic_attr, };static int omap_cpufreq_probe (struct platform_device *pdev)
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 16/33 cpufreq: p4: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/p4-clockmod.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/p4-clockmod.c +0 -1
@@ -227,7 +227,6 @@ static struct cpufreq_driver p4clockmod_driver = { .init = cpufreq_p4_cpu_init, .get = cpufreq_p4_get, .name = "p4-clockmod", - .attr = cpufreq_generic_attr, };static const struct x86_cpu_id cpufreq_p4_id[] = {
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 17/33 cpufreq: pasemi: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/pasemi-cpufreq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/pasemi-cpufreq.c +0 -1
@@ -245,7 +245,6 @@ static struct cpufreq_driver pas_cpufreq_driver = { .exit = pas_cpufreq_cpu_exit, .verify = cpufreq_generic_frequency_table_verify, .target_index = pas_cpufreq_target, - .attr = cpufreq_generic_attr, };/*
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 18/33 cpufreq: pmac: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the drivers can skip setting them.
--- drivers/cpufreq/pmac32-cpufreq.c | 1 - drivers/cpufreq/pmac64-cpufreq.c | 1 - 2 files changed, 2 deletions(-)
drivers/cpufreq/pmac32-cpufreq.c +0 -1
@@ -439,7 +439,6 @@ static struct cpufreq_driver pmac_cpufreq_driver = { .suspend = pmac_cpufreq_suspend, .resume = pmac_cpufreq_resume, .flags = CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING, - .attr = cpufreq_generic_attr, .name = "powermac", };
drivers/cpufreq/pmac64-cpufreq.c +0 -1
@@ -332,7 +332,6 @@ static struct cpufreq_driver g5_cpufreq_driver = { .verify = cpufreq_generic_frequency_table_verify, .target_index = g5_cpufreq_target, .get = g5_cpufreq_get_speed, - .attr = cpufreq_generic_attr, };
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 19/33 cpufreq: powernow: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/powernow-k6.c | 1 - drivers/cpufreq/powernow-k7.c | 1 - drivers/cpufreq/powernow-k8.c | 1 - 3 files changed, 3 deletions(-)
drivers/cpufreq/powernow-k6.c +0 -1
@@ -253,7 +253,6 @@ static struct cpufreq_driver powernow_k6_driver = { .exit = powernow_k6_cpu_exit, .get = powernow_k6_get, .name = "powernow-k6", - .attr = cpufreq_generic_attr, };static const struct x86_cpu_id powernow_k6_ids[] = {
drivers/cpufreq/powernow-k7.c +0 -1
@@ -667,7 +667,6 @@ static struct cpufreq_driver powernow_driver = { .init = powernow_cpu_init, .exit = powernow_cpu_exit, .name = "powernow-k7", - .attr = cpufreq_generic_attr, };static int __init powernow_init (void )
drivers/cpufreq/powernow-k8.c +0 -1
@@ -1143,7 +1143,6 @@ static struct cpufreq_driver cpufreq_amd64_driver = { .exit = powernowk8_cpu_exit, .get = powernowk8_get, .name = "powernow-k8", - .attr = cpufreq_generic_attr, };static void __request_acpi_cpufreq (void )
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 20/33 cpufreq: powernv: Stop setting common freq attributes
In reply to Viresh KumarThe cpufreq core handles this now, the driver can skip setting it.
--- drivers/cpufreq/powernv-cpufreq.c | 2 -- 1 file changed, 2 deletions(-)
drivers/cpufreq/powernv-cpufreq.c +0 -2
@@ -388,9 +388,7 @@ static struct freq_attr cpufreq_freq_attr_cpuinfo_nominal_freq =#define SCALING_BOOST_FREQS_ATTR_INDEX 2static struct freq_attr *powernv_cpu_freq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, &cpufreq_freq_attr_cpuinfo_nominal_freq, - &cpufreq_freq_attr_scaling_boost_freqs,NULL , };
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 21/33 cpufreq: qcom: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/qcom-cpufreq-hw.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/cpufreq/qcom-cpufreq-hw.c +0 -7
@@ -595,12 +595,6 @@ static void qcom_cpufreq_ready(struct cpufreq_policy *policy)enable_irq (data->throttle_irq); } -static struct freq_attr *qcom_cpufreq_hw_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - &cpufreq_freq_attr_scaling_boost_freqs, -NULL -}; -static struct cpufreq_driver cpufreq_qcom_hw_driver = { .flags =CPUFREQ_NEED_INITIAL_FREQ_CHECK | CPUFREQ_HAVE_GOVERNOR_PER_POLICY |
@@ -615,7 +609,6 @@ static struct cpufreq_driver cpufreq_qcom_hw_driver = { .register_em = cpufreq_register_em_with_opp, .fast_switch = qcom_cpufreq_hw_fast_switch, .name = "qcom-cpufreq-hw", - .attr = qcom_cpufreq_hw_attr, .ready = qcom_cpufreq_ready, };
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 22/33 cpufreq: qoriq: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/qoriq-cpufreq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/qoriq-cpufreq.c +0 -1
@@ -254,7 +254,6 @@ static struct cpufreq_driver qoriq_cpufreq_driver = { .verify = cpufreq_generic_frequency_table_verify, .target_index = qoriq_cpufreq_target, .get = cpufreq_generic_get, - .attr = cpufreq_generic_attr, };static const struct of_device_id qoriq_cpufreq_blacklist[] = {
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 23/33 cpufreq: sc520_freq: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/sc520_freq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/sc520_freq.c +0 -1
@@ -92,7 +92,6 @@ static struct cpufreq_driver sc520_freq_driver = { .target_index = sc520_freq_target, .init = sc520_freq_cpu_init, .name = "sc520_freq", - .attr = cpufreq_generic_attr, };static const struct x86_cpu_id sc520_ids[] = {
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 24/33 cpufreq: scmi: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/scmi-cpufreq.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/cpufreq/scmi-cpufreq.c +0 -8
@@ -171,12 +171,6 @@ scmi_get_rate_limit(u32 domain, bool has_fast_switch)return rate_limit; } -static struct freq_attr *scmi_cpufreq_hw_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, -NULL , -NULL , -}; -static int scmi_limit_notify_cb (struct notifier_block *nb,unsigned long event,void *data) { struct scmi_data *priv = container_of(nb, struct scmi_data, limit_notify_nb);
@@ -309,7 +303,6 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)dev_warn (cpu_dev,"failed to enable boost: %d\n" , ret); goto out_free_table; }else { - scmi_cpufreq_hw_attr[1 ] = &cpufreq_freq_attr_scaling_boost_freqs; scmi_cpufreq_driver.boost_enabled = true; } }
@@ -395,7 +388,6 @@ static struct cpufreq_driver scmi_cpufreq_driver = {CPUFREQ_NEED_INITIAL_FREQ_CHECK | CPUFREQ_IS_COOLING_DEV, .verify = cpufreq_generic_frequency_table_verify, - .attr = scmi_cpufreq_hw_attr, .target_index = scmi_cpufreq_set_target, .fast_switch = scmi_cpufreq_fast_switch, .get = scmi_cpufreq_get_rate,
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 25/33 cpufreq: scpi: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/scpi-cpufreq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/scpi-cpufreq.c +0 -1
@@ -183,7 +183,6 @@ static struct cpufreq_driver scpi_cpufreq_driver = {CPUFREQ_NEED_INITIAL_FREQ_CHECK | CPUFREQ_IS_COOLING_DEV, .verify = cpufreq_generic_frequency_table_verify, - .attr = cpufreq_generic_attr, .get = scpi_cpufreq_get_rate, .init = scpi_cpufreq_init, .exit = scpi_cpufreq_exit,
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 26/33 cpufreq: sh: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/sh-cpufreq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/sh-cpufreq.c +0 -1
@@ -151,7 +151,6 @@ static struct cpufreq_driver sh_cpufreq_driver = { .verify = sh_cpufreq_verify, .init = sh_cpufreq_cpu_init, .exit = sh_cpufreq_cpu_exit, - .attr = cpufreq_generic_attr, };static int __init sh_cpufreq_module_init (void )
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 27/33 cpufreq: spear: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/spear-cpufreq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/spear-cpufreq.c +0 -1
@@ -165,7 +165,6 @@ static struct cpufreq_driver spear_cpufreq_driver = { .target_index = spear_cpufreq_target, .get = cpufreq_generic_get, .init = spear_cpufreq_init, - .attr = cpufreq_generic_attr, };static int spear_cpufreq_probe (struct platform_device *pdev)
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 28/33 cpufreq: speedstep: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/speedstep-centrino.c | 1 - drivers/cpufreq/speedstep-ich.c | 1 - drivers/cpufreq/speedstep-smi.c | 1 - 3 files changed, 3 deletions(-)
drivers/cpufreq/speedstep-centrino.c +0 -1
@@ -507,7 +507,6 @@ static struct cpufreq_driver centrino_driver = { .verify = cpufreq_generic_frequency_table_verify, .target_index = centrino_target, .get = get_cur_freq, - .attr = cpufreq_generic_attr, };/*
drivers/cpufreq/speedstep-ich.c +0 -1
@@ -315,7 +315,6 @@ static struct cpufreq_driver speedstep_driver = { .target_index = speedstep_target, .init = speedstep_cpu_init, .get = speedstep_get, - .attr = cpufreq_generic_attr, };static const struct x86_cpu_id ss_smi_ids[] = {
drivers/cpufreq/speedstep-smi.c +0 -1
@@ -295,7 +295,6 @@ static struct cpufreq_driver speedstep_driver = { .init = speedstep_cpu_init, .get = speedstep_get, .resume = speedstep_resume, - .attr = cpufreq_generic_attr, };static const struct x86_cpu_id ss_smi_ids[] = {
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 29/33 cpufreq: tegra: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the drivers can skip setting them.
--- drivers/cpufreq/tegra186-cpufreq.c | 1 - drivers/cpufreq/tegra194-cpufreq.c | 1 - 2 files changed, 2 deletions(-)
drivers/cpufreq/tegra186-cpufreq.c +0 -1
@@ -123,7 +123,6 @@ static struct cpufreq_driver tegra186_cpufreq_driver = { .verify = cpufreq_generic_frequency_table_verify, .target_index = tegra186_cpufreq_set_target, .init = tegra186_cpufreq_init, - .attr = cpufreq_generic_attr, }; static struct cpufreq_frequency_table *init_vhint_table(
drivers/cpufreq/tegra194-cpufreq.c +0 -1
@@ -589,7 +589,6 @@ static struct cpufreq_driver tegra194_cpufreq_driver = { .exit = tegra194_cpufreq_exit, .online = tegra194_cpufreq_online, .offline = tegra194_cpufreq_offline, - .attr = cpufreq_generic_attr, };static struct tegra_cpufreq_ops tegra194_cpufreq_ops = {
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 30/33 cpufreq: vexpress: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/vexpress-spc-cpufreq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/vexpress-spc-cpufreq.c +0 -1
@@ -471,7 +471,6 @@ static struct cpufreq_driver ve_spc_cpufreq_driver = { .init = ve_spc_cpufreq_init, .exit = ve_spc_cpufreq_exit, .register_em = cpufreq_register_em_with_opp, - .attr = cpufreq_generic_attr, };#ifdef CONFIG_BL_SWITCHER
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 31/33 cpufreq: virtual: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarThe cpufreq core handles this for basic attributes now, the driver can skip setting them.
--- drivers/cpufreq/virtual-cpufreq.c | 1 - 1 file changed, 1 deletion(-)
drivers/cpufreq/virtual-cpufreq.c +0 -1
@@ -265,7 +265,6 @@ static struct cpufreq_driver cpufreq_virt_driver = { .verify = virt_cpufreq_verify_policy, .target = virt_cpufreq_target, .fast_switch = virt_cpufreq_fast_switch, - .attr = cpufreq_generic_attr, };static int virt_cpufreq_driver_probe (struct platform_device *pdev)
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 32/33 cpufreq: Remove cpufreq_generic_attrs
In reply to Viresh KumarAll users of cpufreq_generic_attr are migrated now, remove it. While at it, also stop exporting attributes for available and boost frequencies as they are only used by cpufreq core now.
--- drivers/cpufreq/freq_table.c | 8 -------- include/linux/cpufreq.h | 1 - 2 files changed, 9 deletions(-)
drivers/cpufreq/freq_table.c +0 -8
@@ -276,7 +276,6 @@ static ssize_t scaling_available_frequencies_show(struct cpufreq_policy *policy,return show_available_freqs (policy, buf, false); }cpufreq_attr_available_freq (scaling_available); -EXPORT_SYMBOL_GPL (cpufreq_freq_attr_scaling_available_freqs);/* * scaling_boost_frequencies_show - show available boost frequencies for
@@ -288,13 +287,6 @@ static ssize_t scaling_boost_frequencies_show(struct cpufreq_policy *policy,return show_available_freqs (policy, buf, true); }cpufreq_attr_available_freq (scaling_boost); -EXPORT_SYMBOL_GPL (cpufreq_freq_attr_scaling_boost_freqs); - -struct freq_attr *cpufreq_generic_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, -NULL , -}; -EXPORT_SYMBOL_GPL (cpufreq_generic_attr);static int set_freq_table_sorted (struct cpufreq_policy *policy) {
include/linux/cpufreq.h +0 -1
@@ -1198,7 +1198,6 @@ void arch_set_freq_scale(const struct cpumask *cpus,/* the following are really really optional */ extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs;extern struct freq_attr cpufreq_freq_attr_scaling_boost_freqs; -extern struct freq_attr *cpufreq_generic_attr[];int cpufreq_table_validate_and_sort (struct cpufreq_policy *policy);unsigned int cpufreq_generic_get (unsigned int cpu);
Signature · 1 line
2.31.1.272.g89b43f80a514
Viresh Kumar
maintainerPATCH 33/33 cpufreq: Stop checking for duplicate available/boost freq attributes
In reply to Viresh KumarNone of the drivers set these attributes directly now, remove the unnecessary check.
--- drivers/cpufreq/cpufreq.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/cpufreq/cpufreq.c +0 -7
@@ -1076,13 +1076,6 @@ static int cpufreq_add_dev_interface(struct cpufreq_policy *policy)/* set up files for this cpu device */ drv_attr = cpufreq_driver->attr;while (drv_attr && *drv_attr) { -/* These are already added, skip them */ -if (*drv_attr == &cpufreq_freq_attr_scaling_available_freqs || - *drv_attr == &cpufreq_freq_attr_scaling_boost_freqs) { - drv_attr++; -continue ; - } - ret =sysfs_create_file (&policy->kobj, &((*drv_attr)->attr));if (ret)return ret;
Signature · 1 line
2.31.1.272.g89b43f80a514
Re: [PATCH 30/33] cpufreq: vexpress: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarQuoted 3 lines · Viresh Kumar
The cpufreq core handles this for basic attributes now, the driver can skip setting them.
Signature · 2 lines
Regards, Sudeep
Re: [PATCH 25/33] cpufreq: scpi: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarQuoted 3 lines · Viresh Kumar
The cpufreq core handles this for basic attributes now, the driver can skip setting them.
Signature · 2 lines
Regards, Sudeep
Re: [PATCH 24/33] cpufreq: scmi: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarQuoted 3 lines · Viresh Kumar
The cpufreq core handles this for basic attributes now, the driver can skip setting them.
I know this is boiler plate commit message but it made me go check if boosts are handled too even though I checked it in 01/33. So if possible, you can add "basic attributes including boost frequencies", that would be good, aligns with the change below and makes it easy to refer in the future if required. Not a must, I will leave that to you. Anyways,
--
Regards,
Sudeep
Re: [PATCH 01/33] cpufreq: Always create freq-table related sysfs file
In reply to Viresh KumarQuoted 10 lines · Viresh Kumar
Currently it is left for the individual drivers to set the available and boost frequencies related attributes in the
cpufreq_driver->attrfield. Some drivers provide them, while others don't.A quick search revealed that only the drivers that set the
policy->freq_tablefield, enable these attributes. Which makes sense as well, since theshow_available_freqs()helper works only if thefreq_tableis present.
Quoted 7 lines
In order to simplify drivers, create the relevant sysfs files forcefully from cpufreq core.
For now, skip adding them twice. This can be removed once all the drivers are updated.
Signed-off-by Viresh Kumar <[email protected]>
Quoted 43 lines
--- drivers/cpufreq/cpufreq.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)drivers/cpufreq/cpufreq.c +22
-1@@ -1058,9 +1058,31 @@ static int cpufreq_add_dev_interface(struct cpufreq_policy *policy)struct freq_attr **drv_attr;int ret =0 ; +/* Attributes that need freq_table */ +if (policy->freq_table) { + ret =sysfs_create_file (&policy->kobj, + &cpufreq_freq_attr_scaling_available_freqs.attr); +if (ret) +return ret; + +if (cpufreq_boost_supported ()) { + ret =sysfs_create_file (&policy->kobj, + &cpufreq_freq_attr_scaling_boost_freqs.attr); +if (ret) +return ret; + } + } +/* set up files for this cpu device */ drv_attr = cpufreq_driver->attr;while (drv_attr && *drv_attr) { +/* These are already added, skip them */ +if (*drv_attr == &cpufreq_freq_attr_scaling_available_freqs || + *drv_attr == &cpufreq_freq_attr_scaling_boost_freqs) { + drv_attr++; +continue ; + } + ret =sysfs_create_file (&policy->kobj, &((*drv_attr)->attr));if (ret)return ret; --2.31.1.272.g89b43f80a514
Quoted 12 lines · Viresh Kumar
Hello,
Most of the drivers add available and boost frequencies related attributes. This patch series tries to avoid duplication and simplify driver's code by managing these from core code.
A quick search revealed that only the drivers that set the
policy->freq_tablefield, enable these attributes. Which makes sense as well, since theshow_available_freqs()helper works only if thefreq_tableis present.
Quoted 6 lines
In order to simplify drivers, create the relevant sysfs files forcefully from cpufreq core.
Pushed here:
git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.gitcpufreq/core-attr
for the series.
Thanks!
Quoted 84 lines
--
VireshViresh Kumar (33):
cpufreq: Always create freq-table related sysfs file
cpufreq: dt: Stop settingcpufreq_driver->attrfield
cpufreq: acpi: Stop setting common freq attributes
cpufreq: apple: Stop settingcpufreq_driver->attrfield
cpufreq: bmips: Stop settingcpufreq_driver->attrfield
cpufreq: brcmstb: Stop setting common freq attributes
cpufreq: davinci: Stop settingcpufreq_driver->attrfield
cpufreq:e_powersaver: Stop settingcpufreq_driver->attrfield
cpufreq: elanfreq: Stop settingcpufreq_driver->attrfield
cpufreq: imx6q: Stop settingcpufreq_driver->attrfield
cpufreq: kirkwood: Stop settingcpufreq_driver->attrfield
cpufreq: longhaul: Stop settingcpufreq_driver->attrfield
cpufreq: loongson: Stop settingcpufreq_driver->attrfield
cpufreq: mediatek: Stop settingcpufreq_driver->attrfield
cpufreq: omap: Stop settingcpufreq_driver->attrfield
cpufreq: p4: Stop settingcpufreq_driver->attrfield
cpufreq: pasemi: Stop settingcpufreq_driver->attrfield
cpufreq: pmac: Stop settingcpufreq_driver->attrfield
cpufreq: powernow: Stop settingcpufreq_driver->attrfield
cpufreq: powernv: Stop setting common freq attributes
cpufreq: qcom: Stop settingcpufreq_driver->attrfield
cpufreq: qoriq: Stop settingcpufreq_driver->attrfield
cpufreq:sc520_freq: Stop settingcpufreq_driver->attrfield
cpufreq: scmi: Stop settingcpufreq_driver->attrfield
cpufreq: scpi: Stop settingcpufreq_driver->attrfield
cpufreq: sh: Stop settingcpufreq_driver->attrfield
cpufreq: spear: Stop settingcpufreq_driver->attrfield
cpufreq: speedstep: Stop settingcpufreq_driver->attrfield
cpufreq: tegra: Stop settingcpufreq_driver->attrfield
cpufreq: vexpress: Stop settingcpufreq_driver->attrfield
cpufreq: virtual: Stop settingcpufreq_driver->attrfield
cpufreq: Removecpufreq_generic_attrs
cpufreq: Stop checking for duplicate available/boost freq attributesdrivers/cpufreq/acpi-cpufreq.c | 1 - drivers/cpufreq/apple-soc-cpufreq.c | 8 -------- drivers/cpufreq/bmips-cpufreq.c | 1 - drivers/cpufreq/brcmstb-avs-cpufreq.c | 1 - drivers/cpufreq/cpufreq-dt.c | 8 -------- drivers/cpufreq/cpufreq.c | 15 +++++++++++++++ drivers/cpufreq/davinci-cpufreq.c | 1 - drivers/cpufreq/e_powersaver.c | 1 - drivers/cpufreq/elanfreq.c | 1 - drivers/cpufreq/freq_table.c | 8 -------- drivers/cpufreq/imx6q-cpufreq.c | 1 - drivers/cpufreq/kirkwood-cpufreq.c | 1 - drivers/cpufreq/longhaul.c | 1 - drivers/cpufreq/loongson2_cpufreq.c | 1 - drivers/cpufreq/loongson3_cpufreq.c | 1 - drivers/cpufreq/mediatek-cpufreq-hw.c | 1 - drivers/cpufreq/mediatek-cpufreq.c | 1 - drivers/cpufreq/omap-cpufreq.c | 1 - drivers/cpufreq/p4-clockmod.c | 1 - drivers/cpufreq/pasemi-cpufreq.c | 1 - drivers/cpufreq/pmac32-cpufreq.c | 1 - drivers/cpufreq/pmac64-cpufreq.c | 1 - drivers/cpufreq/powernow-k6.c | 1 - drivers/cpufreq/powernow-k7.c | 1 - drivers/cpufreq/powernow-k8.c | 1 - drivers/cpufreq/powernv-cpufreq.c | 2 -- drivers/cpufreq/qcom-cpufreq-hw.c | 7 ------- drivers/cpufreq/qoriq-cpufreq.c | 1 - drivers/cpufreq/sc520_freq.c | 1 - drivers/cpufreq/scmi-cpufreq.c | 8 -------- drivers/cpufreq/scpi-cpufreq.c | 1 - drivers/cpufreq/sh-cpufreq.c | 1 - drivers/cpufreq/spear-cpufreq.c | 1 - drivers/cpufreq/speedstep-centrino.c | 1 - drivers/cpufreq/speedstep-ich.c | 1 - drivers/cpufreq/speedstep-smi.c | 1 - drivers/cpufreq/tegra186-cpufreq.c | 1 - drivers/cpufreq/tegra194-cpufreq.c | 1 - drivers/cpufreq/vexpress-spc-cpufreq.c | 1 - drivers/cpufreq/virtual-cpufreq.c | 1 - include/linux/cpufreq.h | 1 - 41 files changed, 15 insertions(+), 75 deletions(-)--
2.31.1.272.g89b43f80a514
Re: [PATCH 06/33] cpufreq: brcmstb: Stop setting common freq attributes
In reply to Viresh KumarQuoted 3 lines · Viresh Kumar
The cpufreq core handles this now, the driver can skip setting it.
Signed-off-by Viresh Kumar <[email protected]>
Signature · 1 line
Florian
Re: [PATCH 05/33] cpufreq: bmips: Stop setting cpufreq_driver->attr field
In reply to Viresh KumarQuoted 4 lines · Viresh Kumar
The cpufreq core handles this for basic attributes now, the driver can skip setting them.
Signed-off-by Viresh Kumar <[email protected]>
Signature · 1 line
Florian
Viresh Kumar
maintainerRe: [PATCH 24/33] cpufreq: scmi: Stop setting cpufreq_driver->attr field
In reply to Sudeep HollaQuoted 10 lines · Sudeep Holla
Quoted 3 lines · Viresh Kumar
The cpufreq core handles this for basic attributes now, the driver can skip setting them.
I know this is boiler plate commit message but it made me go check if boosts are handled too even though I checked it in 01/33. So if possible, you can add "basic attributes including boost frequencies", that would be good, aligns with the change below and makes it easy to refer in the future if required. Not a must, I will leave that to you. Anyways,
Even if it creates doubt for a single person, its better to go fix it (for all commits).
I will do that while applying the series (unless I need to send another version now for other reasons).
Signature · 1 line
viresh
Viresh Kumar
maintainerPATCH 20/33 cpufreq: powernv: Stop setting common freq attributes
In reply to Viresh KumarThe cpufreq core handles this now, the driver can skip setting it.
---
V1.1:
- Drop runtime updates to freq attr.
drivers/cpufreq/powernv-cpufreq.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/cpufreq/powernv-cpufreq.c +0 -6
@@ -386,12 +386,8 @@ static ssize_t cpuinfo_nominal_freq_show(struct cpufreq_policy *policy,static struct freq_attr cpufreq_freq_attr_cpuinfo_nominal_freq =__ATTR_RO (cpuinfo_nominal_freq); -#define SCALING_BOOST_FREQS_ATTR_INDEX 2 -static struct freq_attr *powernv_cpu_freq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, &cpufreq_freq_attr_cpuinfo_nominal_freq, - &cpufreq_freq_attr_scaling_boost_freqs,NULL , };
@@ -1129,8 +1125,6 @@ static int __init powernv_cpufreq_init(void)if (powernv_pstate_info.wof_enabled) powernv_cpufreq_driver.boost_enabled = true; -else - powernv_cpu_freq_attr[SCALING_BOOST_FREQS_ATTR_INDEX ] =NULL ; rc =cpufreq_register_driver (&powernv_cpufreq_driver);if (rc) {
Signature · 1 line
2.31.1.272.g89b43f80a514