__cpufreq_add_dev() can fail sometimes while we are resuming our system.
Currently we are clearing all sysfs nodes for cpufreq's failed policy as that
could make userspace unstable. But if we suspend/resume again, we should atleast
try to bring back those policies.
This patch fixes this issue by clearing fallback data on failure and trying to
allocate a new struct cpufreq_policy on second resume.
Reported-and-tested-by: Bjørn Mork <bjorn(a)mork.no>
Signed-off-by: Viresh Kumar <viresh.kumar(a)linaro.org>
---
These are sent again (earlier sent as reply to emails), so that people can
give inputs if they have any.
Tested on my thinkpad T420.
drivers/cpufreq/cpufreq.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 16d7b4a..0a48e71 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1016,16 +1016,24 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif,
read_unlock_irqrestore(&cpufreq_driver_lock, flags);
#endif
- if (frozen)
+ if (frozen) {
/* Restore the saved policy when doing light-weight init */
policy = cpufreq_policy_restore(cpu);
- else
+
+ /*
+ * As we failed to resume cpufreq core last time, lets try to
+ * create a new policy.
+ */
+ if (!policy)
+ frozen = false;
+ }
+
+ if (!frozen)
policy = cpufreq_policy_alloc();
if (!policy)
goto nomem_out;
-
/*
* In the resume path, since we restore a saved policy, the assignment
* to policy->cpu is like an update of the existing policy, rather than
@@ -1118,8 +1126,14 @@ err_get_freq:
if (cpufreq_driver->exit)
cpufreq_driver->exit(policy);
err_set_policy_cpu:
- if (frozen)
+ if (frozen) {
+ /*
+ * Clear fallback data as we should try to make things work on
+ * next suspend/resume
+ */
+ per_cpu(cpufreq_cpu_data_fallback, cpu) = NULL;
cpufreq_policy_put_kobj(policy);
+ }
cpufreq_policy_free(policy);
nomem_out:
--
1.7.12.rc2.18.g61b472e
1) Added initial PMU support for exynos5260
2) Added exynos5260_iodesc for mapping 5260 specific SFRs. We modified
exynos5_map_io so that in case of exynos5260 only exynos5260_iodesc can
be initialized.
3) Added new macros for WAKEUP MASK for 5260, and modified exynos_pm_drvinit
accordingly.
4) Adds CMU virtual addresses for exynos5260.
rebased on kgene tree for-next branch
https://git.kernel.org/cgit/linux/kernel/git/kgene/linux-samsung.git/log/?h…
and on top of rahul's patches for basic support of exynos5260
http://www.mail-archive.com/linux-samsung-soc@vger.kernel.org/msg24573.html
Vikas Sajjan (1):
ARM: EXYNOS: Add initial support of PMU for Exynos5260
Young-Gun Jang (1):
ARM: EXYNOS: Add CMU virtual addresses for exynos5260
arch/arm/mach-exynos/common.c | 154 ++++++++++++++++-
arch/arm/mach-exynos/common.h | 5 +
arch/arm/mach-exynos/include/mach/map.h | 31 ++++
arch/arm/mach-exynos/include/mach/regs-clock.h | 17 ++
arch/arm/mach-exynos/include/mach/regs-pmu.h | 221 +++++++++++++++++++++++++
arch/arm/mach-exynos/pm.c | 33 +++-
arch/arm/mach-exynos/pmu.c | 140 ++++++++++++++++
arch/arm/plat-samsung/include/plat/map-s5p.h | 30 ++++
8 files changed, 620 insertions(+), 11 deletions(-)
--
1.7.12.4
From: Jean Pihet <jean.pihet(a)linaro.org>
Add perf support for the AARCH64 architecture. This includes the
support for:
- AARCH64 perf registers definition and hooks,
- compat mode registers use, i.e. profiling a 32-bit binary on
a 64-bit system,
- unwinding using the dwarf information from the .debug_frame
section of the ELF binary; only in 64-bit mode,
- unwinding using the frame pointer information; in 64-bit and
compat modes.
ToDo:
- add support for unwinding using the dwarf information in compat
mode. This requires some changes to the libunwind code.
Tested on ARMv7 and ARMv8 platforms. The compat mode has been tested
on ARMv8 using statically built 32-bit binaries.
Jean Pihet (3):
ARM64: perf: add support for perf registers API
ARM64: perf: wire up perf_regs and unwind support
ARM64: perf: add support for frame pointer unwinding in compat mode
arch/arm64/Kconfig | 2 +
arch/arm64/include/asm/ptrace.h | 1 +
arch/arm64/include/uapi/asm/Kbuild | 1 +
arch/arm64/include/uapi/asm/perf_regs.h | 40 ++++++++++++++
arch/arm64/kernel/Makefile | 1 +
arch/arm64/kernel/perf_event.c | 75 +++++++++++++++++++++++---
arch/arm64/kernel/perf_regs.c | 46 ++++++++++++++++
tools/perf/arch/arm64/Makefile | 7 +++
tools/perf/arch/arm64/include/perf_regs.h | 88 +++++++++++++++++++++++++++++++
tools/perf/arch/arm64/util/dwarf-regs.c | 81 ++++++++++++++++++++++++++++
tools/perf/arch/arm64/util/unwind.c | 82 ++++++++++++++++++++++++++++
tools/perf/config/Makefile | 8 ++-
12 files changed, 423 insertions(+), 9 deletions(-)
create mode 100644 arch/arm64/include/uapi/asm/perf_regs.h
create mode 100644 arch/arm64/kernel/perf_regs.c
create mode 100644 tools/perf/arch/arm64/Makefile
create mode 100644 tools/perf/arch/arm64/include/perf_regs.h
create mode 100644 tools/perf/arch/arm64/util/dwarf-regs.c
create mode 100644 tools/perf/arch/arm64/util/unwind.c
--
1.7.11.7