Skip to contentSkip to conversation

cpufreq: bmips-cpufreq: CPUfreq driver for Broadcom's BMIPS SoCs

PATCH Superseded Markus Mayer 3 participants 10 messages Feb 2, 2017 – Feb 6, 2017

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover cpufreq: bmips-cpufreq: CPUfreq driver for Broadcom's BMIPS SoCs

From: Markus Mayer <[email protected]>

This series adds a CPUfreq driver for the BMIPS SoCs. In the first iteration only BMIPS5xxx SoCs are supported.

This series is based on 4.10-rc1.

Markus Mayer (3):
BMIPS: Enable prerequisites for CPUfreq in MIPS Kconfig.
cpufreq: bmips-cpufreq: CPUfreq driver for Broadcom's BMIPS SoCs
MIPS: BMIPS: enable CPUfreq

 arch/mips/Kconfig                     |   2 +
 arch/mips/configs/bmips_stb_defconfig |  10 ++
 drivers/cpufreq/Kconfig               |  10 ++
 drivers/cpufreq/Makefile              |   1 +
 drivers/cpufreq/bmips-cpufreq.c       | 205 ++++++++++++++++++++++++++++++++++
 5 files changed, 228 insertions(+)
 create mode 100644 drivers/cpufreq/bmips-cpufreq.c
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/3 BMIPS: Enable prerequisites for CPUfreq in MIPS Kconfig.

From: Markus Mayer <[email protected]>

Turn on CPU_SUPPORTS_CPUFREQ and MIPS_EXTERNAL_TIMER for BMIPS.

---
 arch/mips/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/mips/Kconfig +2 -0
index b3c5bde..e137eed 100644
@@ -1703,6 +1703,8 @@ config CPU_BMIPS
 	select WEAK_ORDERING
 	select CPU_SUPPORTS_HIGHMEM
 	select CPU_HAS_PREFETCH
+	select CPU_SUPPORTS_CPUFREQ
+	select MIPS_EXTERNAL_TIMER
 	help
 	  Support for BMIPS32/3300/4350/4380 and BMIPS5000 processors.
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/3 cpufreq: bmips-cpufreq: CPUfreq driver for Broadcom's BMIPS SoCs

In reply to Markus Mayer

From: Markus Mayer <[email protected]>

Add the MIPS CPUfreq driver. This driver currently supports CPUfreq on BMIPS5xxx-based SoCs.

---
 drivers/cpufreq/Kconfig         |  10 ++
 drivers/cpufreq/Makefile        |   1 +
 drivers/cpufreq/bmips-cpufreq.c | 205 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 216 insertions(+)
 create mode 100644 drivers/cpufreq/bmips-cpufreq.c
drivers/cpufreq/Kconfig +10 -0
index d8b164a..f21fe81 100644
@@ -271,6 +271,16 @@ config IA64_ACPI_CPUFREQ
 endif
 
 if MIPS
+config BMIPS_CPUFREQ
+	tristate "BMIPS CPUfreq Driver"
+	help
+	  This option adds a CPUfreq driver for BMIPS processors with
+	  support for configurable CPU frequency.
+
+	  For now, BMIPS5 chips are supported (such as the Broadcom 7425).
+
+	  If in doubt, say N.
+
 config LOONGSON2_CPUFREQ
 	tristate "Loongson2 CPUFreq Driver"
 	help
drivers/cpufreq/Makefile +1 -0
index 1e46c39..b7b3fc7 100644
@@ -98,6 +98,7 @@ obj-$(CONFIG_POWERNV_CPUFREQ)		+= powernv-cpufreq.o
 # Other platform drivers
 obj-$(CONFIG_AVR32_AT32AP_CPUFREQ)	+= at32ap-cpufreq.o
 obj-$(CONFIG_BFIN_CPU_FREQ)		+= blackfin-cpufreq.o
+obj-$(CONFIG_BMIPS_CPUFREQ)		+= bmips-cpufreq.o
 obj-$(CONFIG_CRIS_MACH_ARTPEC3)		+= cris-artpec3-cpufreq.o
 obj-$(CONFIG_ETRAXFS)			+= cris-etraxfs-cpufreq.o
 obj-$(CONFIG_IA64_ACPI_CPUFREQ)		+= ia64-acpi-cpufreq.o
drivers/cpufreq/bmips-cpufreq.c new file +205 -0

205 lines not on this page · raw message

Signature · 1 line
2.7.4
maintainer
#3 lore raw

You must be a cpufreq driver expert by now. What's the count? Is this the 3rd one you have written ? :)

drivers/cpufreq/bmips-cpufreq.c line 64

Quoted 3 lines · Markus Mayer
drivers/cpufreq/bmips-cpufreq.c +2 -0
+static struct cpufreq_frequency_table *
+bmips_cpufreq_get_freq_table(const struct cpufreq_policy *policy)

Maybe call it bmips_cpufreq_create_freq_table() as that's what you are doing. But its all up to you only.

drivers/cpufreq/bmips-cpufreq.c line 74

Quoted 10 lines
drivers/cpufreq/bmips-cpufreq.c +10 -0
+{
+	struct cpufreq_frequency_table *table;
+	struct cpufreq_compat *cc;
+	unsigned long cpu_freq;
+	int i;
+
+	cc = policy->driver_data;
+	cpu_freq = htp_freq_to_cpu_freq(cc->clk_mult);
+
+	table = kzalloc((cc->max_freqs + 1) * sizeof(*table), GFP_KERNEL);

Maybe kmalloc as you are updating all the entries.

Quoted 11 lines
drivers/cpufreq/bmips-cpufreq.c +11 -0
+	if (!table)
+		return ERR_PTR(-ENOMEM);
+
+	for (i = 0; i < cc->max_freqs; i++) {
+		table[i].frequency = cpu_freq / (1 << i);
+		table[i].driver_data = i;
+	}
+	table[i].frequency = CPUFREQ_TABLE_END;
+
+	return table;
+}

drivers/cpufreq/bmips-cpufreq.c line 95

Quoted 10 lines
drivers/cpufreq/bmips-cpufreq.c +10 -0
+
+static unsigned int bmips_cpufreq_get(unsigned int cpu)
+{
+	struct cpufreq_policy *policy;
+	struct cpufreq_compat *cc;
+	unsigned long freq, cpu_freq;
+	unsigned int div;
+	uint32_t mode;
+
+	policy = cpufreq_cpu_get(cpu);

You need to do a corresponding cpufreq_cpu_put().

Quoted 35 lines
drivers/cpufreq/bmips-cpufreq.c +35 -0
+	cc = policy->driver_data;
+
+	switch (cc->bmips_type) {
+	case BMIPS5200:
+	case BMIPS5000:
+		mode = read_c0_brcm_mode();
+		div = ((mode >> BMIPS5_CLK_DIV_SHIFT) & BMIPS5_CLK_DIV_MASK);
+		break;
+	default:
+		div = 0;
+	}
+
+	cpu_freq = htp_freq_to_cpu_freq(cc->clk_mult);
+	freq = cpu_freq / (1 << div);
+
+	return freq;
+}
+
+static int bmips_cpufreq_target_index(struct cpufreq_policy *policy,
+				      unsigned int index)
+{
+	struct cpufreq_compat *cc;
+	unsigned int div;
+
+	cc = policy->driver_data;
+	div = policy->freq_table[index].driver_data;
+
+	switch (cc->bmips_type) {
+	case BMIPS5200:
+	case BMIPS5000:
+		change_c0_brcm_mode(BMIPS5_CLK_DIV_MASK << BMIPS5_CLK_DIV_SHIFT,
+				    (1 << BMIPS5_CLK_DIV_SET_SHIFT) |
+				    (div << BMIPS5_CLK_DIV_SHIFT));
+		break;
+	default:

drivers/cpufreq/bmips-cpufreq.c line 140

Quoted 10 lines
drivers/cpufreq/bmips-cpufreq.c +10 -0
+		return -ENOTSUPP;
+	}
+
+	return 0;
+}
+
+static int bmips_cpufreq_exit(struct cpufreq_policy *policy)
+{
+	kfree(policy->freq_table);
+	policy->freq_table = NULL;

No need to set it to NULL.

drivers/cpufreq/bmips-cpufreq.c line 151

Quoted 11 lines
drivers/cpufreq/bmips-cpufreq.c +11 -0
+
+	return 0;
+}
+
+static int bmips_cpufreq_init(struct cpufreq_policy *policy)
+{
+	struct cpufreq_frequency_table *freq_table;
+	int ret;
+
+	/* Store the compatibility data with the policy. */
+	policy->driver_data = cpufreq_get_driver_data();

Hmm, I wouldn't mind keeping a global variable for this. This driver will be probed only once and so we can simplify the code a bit. Up to you.

Quoted 56 lines
drivers/cpufreq/bmips-cpufreq.c +54 -0
+
+	freq_table = bmips_cpufreq_get_freq_table(policy);
+	if (IS_ERR(freq_table)) {
+		ret = PTR_ERR(freq_table);
+		pr_err("%s: couldn't determine frequency table (%d).\n",
+			BMIPS_CPUFREQ_NAME, ret);
+		return ret;
+	}
+
+	ret = cpufreq_generic_init(policy, freq_table, TRANSITION_LATENCY);
+	if (ret)
+		bmips_cpufreq_exit(policy);
+	else
+		pr_info("%s: registered\n", BMIPS_CPUFREQ_NAME);
+
+	return ret;
+}
+
+static struct cpufreq_driver bmips_cpufreq_driver = {
+	.flags		= CPUFREQ_NEED_INITIAL_FREQ_CHECK,
+	.verify		= cpufreq_generic_frequency_table_verify,
+	.target_index	= bmips_cpufreq_target_index,
+	.get		= bmips_cpufreq_get,
+	.init		= bmips_cpufreq_init,
+	.exit		= bmips_cpufreq_exit,
+	.attr		= cpufreq_generic_attr,
+	.name		= BMIPS_CPUFREQ_PREFIX,
+};
+
+static int __init bmips_cpufreq_probe(void)
+{
+	struct cpufreq_compat *cc;
+	struct device_node *np;
+
+	for (cc = bmips_cpufreq_compat; cc->compatible; cc++) {
+		np = of_find_compatible_node(NULL, "cpu", cc->compatible);
+		if (np) {
+			of_node_put(np);
+			bmips_cpufreq_driver.driver_data = cc;
+			break;
+		}
+	}
+
+	/* We hit the guard element of the array. No compatible CPU found. */
+	if (!cc->compatible)
+		return -ENODEV;
+
+	return cpufreq_register_driver(&bmips_cpufreq_driver);
+}
+device_initcall(bmips_cpufreq_probe);
+
+MODULE_AUTHOR("Markus Mayer <[email protected]>");
+MODULE_DESCRIPTION("CPUfreq driver for Broadcom BMIPS SoCs");
+MODULE_LICENSE("GPL");
Signature · 1 line
2.7.4
Signature · 1 line
viresh
#4 lore raw
Quoted 2 lines · Viresh Kumar

You must be a cpufreq driver expert by now. What's the count? Is this the 3rd one you have written ? :)

Indeed. This is #3. We should be done now, though. We have ARM, legacy ARM and BMIPS covered. :-)

Quoted 7 lines · Markus Mayer

drivers/cpufreq/bmips-cpufreq.c line 64

Quoted 3 lines
drivers/cpufreq/bmips-cpufreq.c +2 -0
+static struct cpufreq_frequency_table *
+bmips_cpufreq_get_freq_table(const struct cpufreq_policy *policy)

Maybe call it bmips_cpufreq_create_freq_table() as that's what you are doing. But its all up to you only.

I was about to change the name, but then realized that the other two drivers use *get_freq_table(), too. So, I'd prefer to keep the name as is, so we don't get naming oddities between various Broadcom cpufreq drivers.

Quoted 4 lines
Quoted 4 lines
drivers/cpufreq/bmips-cpufreq.c +4 -0
+{
+     struct cpufreq_frequency_table *table;
+     struct cpufreq_compat *cc;
+     unsigned long cpu_freq;
Quoted 8 lines

drivers/cpufreq/bmips-cpufreq.c line 74

Quoted 6 lines
drivers/cpufreq/bmips-cpufreq.c +6 -0
+     int i;
+
+     cc = policy->driver_data;
+     cpu_freq = htp_freq_to_cpu_freq(cc->clk_mult);
+
+     table = kzalloc((cc->max_freqs + 1) * sizeof(*table), GFP_KERNEL);

Maybe kmalloc as you are updating all the entries.

Done.

Quoted 15 lines
Quoted 15 lines
drivers/cpufreq/bmips-cpufreq.c +15 -0
+     if (!table)
+             return ERR_PTR(-ENOMEM);
+
+     for (i = 0; i < cc->max_freqs; i++) {
+             table[i].frequency = cpu_freq / (1 << i);
+             table[i].driver_data = i;
+     }
+     table[i].frequency = CPUFREQ_TABLE_END;
+
+     return table;
+}
+
+static unsigned int bmips_cpufreq_get(unsigned int cpu)
+{
+     struct cpufreq_policy *policy;
Quoted 8 lines

drivers/cpufreq/bmips-cpufreq.c line 95

Quoted 6 lines
drivers/cpufreq/bmips-cpufreq.c +6 -0
+     struct cpufreq_compat *cc;
+     unsigned long freq, cpu_freq;
+     unsigned int div;
+     uint32_t mode;
+
+     policy = cpufreq_cpu_get(cpu);

You need to do a corresponding cpufreq_cpu_put().

Actually, I don't need the policy at all anymore. I converted to a global variable (as per suggestion below), which means no more policy in this function. So, rather than adding cpufreq_cpu_put(), I removed cpufreq_cpu_get().

Quoted 39 lines
Quoted 39 lines
drivers/cpufreq/bmips-cpufreq.c +39 -0
+     cc = policy->driver_data;
+
+     switch (cc->bmips_type) {
+     case BMIPS5200:
+     case BMIPS5000:
+             mode = read_c0_brcm_mode();
+             div = ((mode >> BMIPS5_CLK_DIV_SHIFT) & BMIPS5_CLK_DIV_MASK);
+             break;
+     default:
+             div = 0;
+     }
+
+     cpu_freq = htp_freq_to_cpu_freq(cc->clk_mult);
+     freq = cpu_freq / (1 << div);
+
+     return freq;
+}
+
+static int bmips_cpufreq_target_index(struct cpufreq_policy *policy,
+                                   unsigned int index)
+{
+     struct cpufreq_compat *cc;
+     unsigned int div;
+
+     cc = policy->driver_data;
+     div = policy->freq_table[index].driver_data;
+
+     switch (cc->bmips_type) {
+     case BMIPS5200:
+     case BMIPS5000:
+             change_c0_brcm_mode(BMIPS5_CLK_DIV_MASK << BMIPS5_CLK_DIV_SHIFT,
+                                 (1 << BMIPS5_CLK_DIV_SET_SHIFT) |
+                                 (div << BMIPS5_CLK_DIV_SHIFT));
+             break;
+     default:
+             return -ENOTSUPP;
+     }
+
+     return 0;
Quoted 8 lines

drivers/cpufreq/bmips-cpufreq.c line 140

Quoted 6 lines
drivers/cpufreq/bmips-cpufreq.c +6 -0
+}
+
+static int bmips_cpufreq_exit(struct cpufreq_policy *policy)
+{
+     kfree(policy->freq_table);
+     policy->freq_table = NULL;

No need to set it to NULL.

Removed.

Quoted 6 lines
Quoted 6 lines
drivers/cpufreq/bmips-cpufreq.c +6 -0
+
+     return 0;
+}
+
+static int bmips_cpufreq_init(struct cpufreq_policy *policy)
+{
Quoted 8 lines

drivers/cpufreq/bmips-cpufreq.c line 151

Quoted 5 lines
drivers/cpufreq/bmips-cpufreq.c +5 -0
+     struct cpufreq_frequency_table *freq_table;
+     int ret;
+
+     /* Store the compatibility data with the policy. */
+     policy->driver_data = cpufreq_get_driver_data();

Hmm, I wouldn't mind keeping a global variable for this. This driver will be probed only once and so we can simplify the code a bit. Up to you.

Done. Got rid of 10 lines of code overall.

Quoted 59 lines
Quoted 55 lines
drivers/cpufreq/bmips-cpufreq.c +54 -1
+
+     freq_table = bmips_cpufreq_get_freq_table(policy);
+     if (IS_ERR(freq_table)) {
+             ret = PTR_ERR(freq_table);
+             pr_err("%s: couldn't determine frequency table (%d).\n",
+                     BMIPS_CPUFREQ_NAME, ret);
+             return ret;
+     }
+
+     ret = cpufreq_generic_init(policy, freq_table, TRANSITION_LATENCY);
+     if (ret)
+             bmips_cpufreq_exit(policy);
+     else
+             pr_info("%s: registered\n", BMIPS_CPUFREQ_NAME);
+
+     return ret;
+}
+
+static struct cpufreq_driver bmips_cpufreq_driver = {
+     .flags          = CPUFREQ_NEED_INITIAL_FREQ_CHECK,
+     .verify         = cpufreq_generic_frequency_table_verify,
+     .target_index   = bmips_cpufreq_target_index,
+     .get            = bmips_cpufreq_get,
+     .init           = bmips_cpufreq_init,
+     .exit           = bmips_cpufreq_exit,
+     .attr           = cpufreq_generic_attr,
+     .name           = BMIPS_CPUFREQ_PREFIX,
+};
+
+static int __init bmips_cpufreq_probe(void)
+{
+     struct cpufreq_compat *cc;
+     struct device_node *np;
+
+     for (cc = bmips_cpufreq_compat; cc->compatible; cc++) {
+             np = of_find_compatible_node(NULL, "cpu", cc->compatible);
+             if (np) {
+                     of_node_put(np);
+                     bmips_cpufreq_driver.driver_data = cc;
+                     break;
+             }
+     }
+
+     /* We hit the guard element of the array. No compatible CPU found. */
+     if (!cc->compatible)
+             return -ENODEV;
+
+     return cpufreq_register_driver(&bmips_cpufreq_driver);
+}
+device_initcall(bmips_cpufreq_probe);
+
+MODULE_AUTHOR("Markus Mayer <[email protected]>");
+MODULE_DESCRIPTION("CPUfreq driver for Broadcom BMIPS SoCs");
+MODULE_LICENSE("GPL");
--
Quoted 1 line

2.7.4

--
viresh

#5 lore raw

PATCH 3/3 MIPS: BMIPS: enable CPUfreq

In reply to Markus Mayer

From: Markus Mayer <[email protected]>

Enable all applicable CPUfreq options.

---
 arch/mips/configs/bmips_stb_defconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/mips/configs/bmips_stb_defconfig +10 -0
index 4eb5d6e..6fda604 100644
@@ -26,6 +26,16 @@ CONFIG_INET=y
 # CONFIG_INET_XFRM_MODE_BEET is not set
 # CONFIG_INET_LRO is not set
 # CONFIG_INET_DIAG is not set
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_BMIPS_CPUFREQ=y
 CONFIG_CFG80211=y
 CONFIG_NL80211_TESTMODE=y
 CONFIG_MAC80211=y
Signature · 1 line
2.7.4
maintainer
#6 lore raw

Re: [PATCH 3/3] MIPS: BMIPS: enable CPUfreq

Quoted 20 lines · Markus Mayer

From: Markus Mayer <[email protected]>

Enable all applicable CPUfreq options.

---
 arch/mips/configs/bmips_stb_defconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/mips/configs/bmips_stb_defconfig +3 -0
index 4eb5d6e..6fda604 100644
@@ -26,6 +26,16 @@ CONFIG_INET=y
 # CONFIG_INET_XFRM_MODE_BEET is not set
 # CONFIG_INET_LRO is not set
 # CONFIG_INET_DIAG is not set
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y

arch/mips/configs/bmips_stb_defconfig CONFIG_INET=y · line 41

Quoted 10 lines
arch/mips/configs/bmips_stb_defconfig +7 -0
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_BMIPS_CPUFREQ=y
 CONFIG_CFG80211=y
 CONFIG_NL80211_TESTMODE=y
 CONFIG_MAC80211=y

Rebase your stuff over pm/linux-next and you will see some changes here. Also schedutil is the new governor in town, you must give it a try.

Signature · 1 line
viresh
#7 lore raw

Re: [PATCH 3/3] MIPS: BMIPS: enable CPUfreq

Quoted 26 lines · Viresh Kumar
Quoted 25 lines · Markus Mayer

From: Markus Mayer <[email protected]>

Enable all applicable CPUfreq options.

---
 arch/mips/configs/bmips_stb_defconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/mips/configs/bmips_stb_defconfig +8 -0
index 4eb5d6e..6fda604 100644
@@ -26,6 +26,16 @@ CONFIG_INET=y
 # CONFIG_INET_XFRM_MODE_BEET is not set
 # CONFIG_INET_LRO is not set
 # CONFIG_INET_DIAG is not set
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
Quoted 8 lines

arch/mips/configs/bmips_stb_defconfig CONFIG_INET=y · line 41

Quoted 5 lines
arch/mips/configs/bmips_stb_defconfig +2 -0
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_BMIPS_CPUFREQ=y
 CONFIG_CFG80211=y
 CONFIG_NL80211_TESTMODE=y
 CONFIG_MAC80211=y

Rebase your stuff over pm/linux-next and you will see some changes here. Also schedutil is the new governor in town, you must give it a try.

I'll definitely turn on SCHEDUTIL. As for the changes in next, I don't see any conflicts. My series applied fine on top of linux-next from
https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/. Did I use the wrong tree?

$ git log

commit f81d425292d7d14d45eedc16b9f59066e6640500

Author: Markus Mayer <[email protected]>
Date:   Wed Feb 1 16:45:06 2017 -0800

MIPS: BMIPS: enable CPUfreq

Enable all applicable CPUfreq options.

commit 9b71c19f3d9af3867f8ec144305b7f23bfaa42f3

Author: Markus Mayer <[email protected]>
Date:   Wed Feb 1 16:19:01 2017 -0800

cpufreq: bmips-cpufreq: CPUfreq driver for Broadcom's BMIPS SoCs

Add the MIPS CPUfreq driver. This driver currently supports CPUfreq on BMIPS5xxx-based SoCs.

commit 3a2894802066c8a24da6890bcc2c0b7fae1ccb40

Author: Markus Mayer <[email protected]>
Date:   Wed Feb 1 16:16:55 2017 -0800

BMIPS: Enable prerequisites for CPUfreq in MIPS Kconfig.

Turn on CPU_SUPPORTS_CPUFREQ and MIPS_EXTERNAL_TIMER for BMIPS.

commit fd4c9e3a71b4c967731c99525a2e94085a776638
Merge: ba358f6 a9306a6
Author: Rafael J. Wysocki <[email protected]>
Date: Sat Feb 4 00:45:12 2017 +0100

Merge branch 'pm-core-fixes' into linux-next

* pm-core-fixes:
PM / runtime: Avoid false-positive warnings from might_sleep_if()

...

Thanks,
-Markus

Quoted 2 lines

--
viresh

maintainer
#8 lore raw

Re: [PATCH 3/3] MIPS: BMIPS: enable CPUfreq

Quoted 36 lines · Markus Mayer
Quoted 26 lines · Viresh Kumar
Quoted 25 lines · Markus Mayer

From: Markus Mayer <[email protected]>

Enable all applicable CPUfreq options.

---
 arch/mips/configs/bmips_stb_defconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/mips/configs/bmips_stb_defconfig +8 -0
index 4eb5d6e..6fda604 100644
@@ -26,6 +26,16 @@ CONFIG_INET=y
 # CONFIG_INET_XFRM_MODE_BEET is not set
 # CONFIG_INET_LRO is not set
 # CONFIG_INET_DIAG is not set
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
Quoted 8 lines

arch/mips/configs/bmips_stb_defconfig CONFIG_INET=y · line 41

Quoted 5 lines
arch/mips/configs/bmips_stb_defconfig +2 -0
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_BMIPS_CPUFREQ=y
 CONFIG_CFG80211=y
 CONFIG_NL80211_TESTMODE=y
 CONFIG_MAC80211=y

Rebase your stuff over pm/linux-next and you will see some changes here. Also schedutil is the new governor in town, you must give it a try.

Quoted 4 lines

I'll definitely turn on SCHEDUTIL. As for the changes in next, I don't see any conflicts. My series applied fine on top of linux-next from
https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/. Did I use the wrong tree?

No, but you didn't follow the right process. You should use 'make savedefconfig' to update the defconfig.

The symbol CONFIG_CPU_FREQ_STAT_DETAILS is removed from the kernel now.

Signature · 1 line
viresh
#9 lore raw

Re: [PATCH 3/3] MIPS: BMIPS: enable CPUfreq

Quoted 43 lines · Viresh Kumar
Quoted 36 lines · Markus Mayer
Quoted 26 lines · Viresh Kumar
Quoted 25 lines · Markus Mayer

From: Markus Mayer <[email protected]>

Enable all applicable CPUfreq options.

---
 arch/mips/configs/bmips_stb_defconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/mips/configs/bmips_stb_defconfig +8 -0
index 4eb5d6e..6fda604 100644
@@ -26,6 +26,16 @@ CONFIG_INET=y
 # CONFIG_INET_XFRM_MODE_BEET is not set
 # CONFIG_INET_LRO is not set
 # CONFIG_INET_DIAG is not set
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_STAT=y
+CONFIG_CPU_FREQ_STAT_DETAILS=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
Quoted 8 lines

arch/mips/configs/bmips_stb_defconfig CONFIG_INET=y · line 41

Quoted 5 lines
arch/mips/configs/bmips_stb_defconfig +2 -0
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_BMIPS_CPUFREQ=y
 CONFIG_CFG80211=y
 CONFIG_NL80211_TESTMODE=y
 CONFIG_MAC80211=y

Rebase your stuff over pm/linux-next and you will see some changes here. Also schedutil is the new governor in town, you must give it a try.

Quoted 4 lines

I'll definitely turn on SCHEDUTIL. As for the changes in next, I don't see any conflicts. My series applied fine on top of linux-next from
https://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/. Did I use the wrong tree?

Quoted 5 lines

No, but you didn't follow the right process. You should use 'make savedefconfig' to update the defconfig.

The symbol CONFIG_CPU_FREQ_STAT_DETAILS is removed from the kernel now.

Okay. Got it. Will do.

-Markus