Skip to content

Commit

Permalink
Merge branches 'pm-sleep' and 'pm-cpufreq'
Browse files Browse the repository at this point in the history
* pm-sleep:
  PM / sleep: fix freeze_ops NULL pointer dereferences
  PM / sleep: Fix request_firmware() error at resume

* pm-cpufreq:
  cpufreq: make table sentinel macros unsigned to match use
  cpufreq: move policy kobj to policy->cpu at resume
  cpufreq: cpu0: OPPs can be populated at runtime
  cpufreq: kirkwood: Reinstate cpufreq driver for ARCH_KIRKWOOD
  cpufreq: imx6q: Select PM_OPP
  cpufreq: sa1110: set memory type for h3600
  • Loading branch information
Rafael J. Wysocki committed Jul 18, 2014
3 parents 11634bd + 653a353 + 2b1987a commit 3962808
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 15 deletions.
6 changes: 4 additions & 2 deletions Documentation/devicetree/bindings/cpufreq/cpufreq-cpu0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ Both required and optional properties listed below must be defined
under node /cpus/cpu@0.

Required properties:
- operating-points: Refer to Documentation/devicetree/bindings/power/opp.txt
for details
- None

Optional properties:
- operating-points: Refer to Documentation/devicetree/bindings/power/opp.txt for
details. OPPs *must* be supplied either via DT, i.e. this property, or
populated at runtime.
- clock-latency: Specify the possible maximum transition latency for clock,
in unit of nanoseconds.
- voltage-tolerance: Specify the CPU voltage tolerance in percentage.
Expand Down
3 changes: 2 additions & 1 deletion drivers/cpufreq/Kconfig.arm
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ config ARM_IMX6Q_CPUFREQ
tristate "Freescale i.MX6 cpufreq support"
depends on ARCH_MXC
depends on REGULATOR_ANATOP
select PM_OPP
help
This adds cpufreq driver support for Freescale i.MX6 series SoCs.

Expand All @@ -118,7 +119,7 @@ config ARM_INTEGRATOR
If in doubt, say Y.

config ARM_KIRKWOOD_CPUFREQ
def_bool MACH_KIRKWOOD
def_bool ARCH_KIRKWOOD || MACH_KIRKWOOD
help
This adds the CPUFreq driver for Marvell Kirkwood
SoCs.
Expand Down
7 changes: 2 additions & 5 deletions drivers/cpufreq/cpufreq-cpu0.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,8 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
goto out_put_reg;
}

ret = of_init_opp_table(cpu_dev);
if (ret) {
pr_err("failed to init OPP table: %d\n", ret);
goto out_put_clk;
}
/* OPPs might be populated at runtime, don't check for error here */
of_init_opp_table(cpu_dev);

ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);
if (ret) {
Expand Down
6 changes: 4 additions & 2 deletions drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1153,10 +1153,12 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif)
* the creation of a brand new one. So we need to perform this update
* by invoking update_policy_cpu().
*/
if (recover_policy && cpu != policy->cpu)
if (recover_policy && cpu != policy->cpu) {
update_policy_cpu(policy, cpu);
else
WARN_ON(kobject_move(&policy->kobj, &dev->kobj));
} else {
policy->cpu = cpu;
}

cpumask_copy(policy->cpus, cpumask_of(cpu));

Expand Down
2 changes: 1 addition & 1 deletion drivers/cpufreq/sa1110-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ static int __init sa1110_clk_init(void)
name = "K4S641632D";
if (machine_is_h3100())
name = "KM416S4030CT";
if (machine_is_jornada720())
if (machine_is_jornada720() || machine_is_h3600())
name = "K4S281632B-1H";
if (machine_is_nanoengine())
name = "MT48LC8M16A2TG-75";
Expand Down
4 changes: 2 additions & 2 deletions include/linux/cpufreq.h
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,8 @@ extern struct cpufreq_governor cpufreq_gov_conservative;
*********************************************************************/

/* Special Values of .frequency field */
#define CPUFREQ_ENTRY_INVALID ~0
#define CPUFREQ_TABLE_END ~1
#define CPUFREQ_ENTRY_INVALID ~0u
#define CPUFREQ_TABLE_END ~1u
/* Special Values of .flags field */
#define CPUFREQ_BOOST_FREQ (1 << 0)

Expand Down
1 change: 1 addition & 0 deletions kernel/power/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ void thaw_processes(void)

printk("Restarting tasks ... ");

__usermodehelper_set_disable_depth(UMH_FREEZING);
thaw_workqueues();

read_lock(&tasklist_lock);
Expand Down
4 changes: 2 additions & 2 deletions kernel/power/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ int suspend_devices_and_enter(suspend_state_t state)
error = suspend_ops->begin(state);
if (error)
goto Close;
} else if (state == PM_SUSPEND_FREEZE && freeze_ops->begin) {
} else if (state == PM_SUSPEND_FREEZE && freeze_ops && freeze_ops->begin) {
error = freeze_ops->begin();
if (error)
goto Close;
Expand Down Expand Up @@ -335,7 +335,7 @@ int suspend_devices_and_enter(suspend_state_t state)
Close:
if (need_suspend_ops(state) && suspend_ops->end)
suspend_ops->end();
else if (state == PM_SUSPEND_FREEZE && freeze_ops->end)
else if (state == PM_SUSPEND_FREEZE && freeze_ops && freeze_ops->end)
freeze_ops->end();

return error;
Expand Down

0 comments on commit 3962808

Please sign in to comment.