linux/drivers/cpufreq
viresh kumar 6964d91db2 cpufreq: remove sysfs link when a cpu != policy->cpu, is removed
Commit 42f921a (cpufreq: remove sysfs files for CPUs which failed to
come back after resume) tried to do this but missed this piece of code
to fix.

Currently we are getting this on suspend/resume:

------------[ cut here ]------------
WARNING: CPU: 0 PID: 877 at fs/sysfs/dir.c:52 sysfs_warn_dup+0x68/0x84()
sysfs: cannot create duplicate filename '/devices/system/cpu/cpu1/cpufreq'
Modules linked in: brcmfmac brcmutil
CPU: 0 PID: 877 Comm: test-rtc-resume Not tainted 3.14.0-rc2-00259-g9398a10cd964 #12
[<c0015bac>] (unwind_backtrace) from [<c0011850>] (show_stack+0x10/0x14)
[<c0011850>] (show_stack) from [<c056e018>] (dump_stack+0x80/0xcc)
[<c056e018>] (dump_stack) from [<c0025e44>] (warn_slowpath_common+0x64/0x88)
[<c0025e44>] (warn_slowpath_common) from [<c0025efc>] (warn_slowpath_fmt+0x30/0x40)
[<c0025efc>] (warn_slowpath_fmt) from [<c012776c>] (sysfs_warn_dup+0x68/0x84)
[<c012776c>] (sysfs_warn_dup) from [<c0127a54>] (sysfs_do_create_link_sd+0xb0/0xb8)
[<c0127a54>] (sysfs_do_create_link_sd) from [<c038ef64>] (__cpufreq_add_dev.isra.27+0x2a8/0x814)
[<c038ef64>] (__cpufreq_add_dev.isra.27) from [<c038f548>] (cpufreq_cpu_callback+0x70/0x8c)
[<c038f548>] (cpufreq_cpu_callback) from [<c0043864>] (notifier_call_chain+0x44/0x84)
[<c0043864>] (notifier_call_chain) from [<c0025f60>] (__cpu_notify+0x28/0x44)
[<c0025f60>] (__cpu_notify) from [<c00261e8>] (_cpu_up+0xf0/0x140)
[<c00261e8>] (_cpu_up) from [<c0569eb8>] (enable_nonboot_cpus+0x68/0xb0)
[<c0569eb8>] (enable_nonboot_cpus) from [<c006339c>] (suspend_devices_and_enter+0x198/0x2dc)
[<c006339c>] (suspend_devices_and_enter) from [<c0063654>] (pm_suspend+0x174/0x1e8)
[<c0063654>] (pm_suspend) from [<c00624e0>] (state_store+0x6c/0xbc)
[<c00624e0>] (state_store) from [<c01fc200>] (kobj_attr_store+0x14/0x20)
[<c01fc200>] (kobj_attr_store) from [<c0126e50>] (sysfs_kf_write+0x44/0x48)
[<c0126e50>] (sysfs_kf_write) from [<c012a274>] (kernfs_fop_write+0xb4/0x14c)
[<c012a274>] (kernfs_fop_write) from [<c00d4818>] (vfs_write+0xa8/0x180)
[<c00d4818>] (vfs_write) from [<c00d4bb8>] (SyS_write+0x3c/0x70)
[<c00d4bb8>] (SyS_write) from [<c000e620>] (ret_fast_syscall+0x0/0x30)
---[ end trace 76969904b614c18f ]---

Fix this by removing sysfs link for cpufreq directory when cpu removed
isn't policy->cpu.

Revamps: 42f921a (cpufreq: remove sysfs files for CPUs which failed to come back after resume)
Reported-and-tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-02-19 01:04:40 +01:00
..
acpi-cpufreq.c acpi-cpufreq: De-register CPU notifier and free struct msr on error. 2014-01-28 22:36:30 +01:00
amd_freq_sensitivity.c cpufreq: AMD "frequency sensitivity feedback" powersave bias for ondemand governor 2013-04-10 13:19:26 +02:00
arm_big_little.c cpufreq: Mark ARM drivers with CPUFREQ_NEED_INITIAL_FREQ_CHECK flag 2014-01-06 14:17:25 +01:00
arm_big_little.h cpufreq: arm_big_little: add in-kernel switching (IKS) support 2013-10-31 00:10:53 +01:00
arm_big_little_dt.c PM / OPP: rename header to linux/pm_opp.h 2013-10-25 22:33:23 +02:00
at32ap-cpufreq.c cpufreq: introduce cpufreq_generic_get() routine 2014-01-17 02:00:44 +01:00
blackfin-cpufreq.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
cpufreq-cpu0.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2014-01-24 17:13:49 -08:00
cpufreq-nforce2.c cpufreq: nforce2: don't initialize part of policy set by core 2013-10-16 00:50:29 +02:00
cpufreq.c cpufreq: remove sysfs link when a cpu != policy->cpu, is removed 2014-02-19 01:04:40 +01:00
cpufreq_conservative.c cpufreq: conservative: set requested_freq to policy max when it is over policy max 2013-11-12 23:18:20 +01:00
cpufreq_governor.c cpufreq: Fix timer/workqueue corruption by protecting reading governor_enabled 2014-01-06 01:22:02 +01:00
cpufreq_governor.h cpufreq: Fix timer/workqueue corruption by protecting reading governor_enabled 2014-01-06 01:22:02 +01:00
cpufreq_ondemand.c cpufreq: ondemand: Remove redundant return statement 2013-11-01 00:44:34 +01:00
cpufreq_performance.c cpufreq: Clean up header files included in the core 2013-08-07 23:34:09 +02:00
cpufreq_powersave.c cpufreq: Clean up header files included in the core 2013-08-07 23:34:09 +02:00
cpufreq_stats.c cpufreq: stats: create sysfs entries when cpufreq_stats is a module 2014-01-17 02:00:44 +01:00
cpufreq_userspace.c cpufreq / governor: Remove fossil comment 2013-10-17 23:00:20 +02:00
cris-artpec3-cpufreq.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
cris-etraxfs-cpufreq.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
davinci-cpufreq.c cpufreq: introduce cpufreq_generic_get() routine 2014-01-17 02:00:44 +01:00
dbx500-cpufreq.c cpufreq: introduce cpufreq_generic_get() routine 2014-01-17 02:00:44 +01:00
e_powersaver.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
elanfreq.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
exynos-cpufreq.c cpufreq: exynos: Extend Exynos cpufreq driver to support boost 2014-01-17 02:00:45 +01:00
exynos-cpufreq.h cpufreq: exynos: move definitions for exynos-cpufreq into drivers/cpufreq/ 2013-12-19 05:21:18 +09:00
exynos4x12-cpufreq.c ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
exynos4210-cpufreq.c Samsung cleanup 2nd for v3.14 2013-12-28 15:12:07 -08:00
exynos5250-cpufreq.c ACPI and power management updates for 3.14-rc1 2014-01-24 15:51:02 -08:00
exynos5440-cpufreq.c cpufreq: introduce cpufreq_generic_get() routine 2014-01-17 02:00:44 +01:00
freq_table.c cpufreq: Add boost frequency support in core 2014-01-17 02:00:44 +01:00
gx-suspmod.c cpufreq: gx: don't initialize part of policy set by core 2013-10-16 00:50:30 +02:00
highbank-cpufreq.c cpufreq: highbank-cpufreq: Enable Midway/ECX-2000 2013-10-17 00:53:08 +02:00
ia64-acpi-cpufreq.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
imx6q-cpufreq.c cpufreq: introduce cpufreq_generic_get() routine 2014-01-17 02:00:44 +01:00
integrator-cpufreq.c cpufreq: Mark ARM drivers with CPUFREQ_NEED_INITIAL_FREQ_CHECK flag 2014-01-06 14:17:25 +01:00
intel_pstate.c intel_pstate: Remove energy reporting from pstate_sample tracepoint 2014-02-13 02:11:18 +01:00
Kconfig Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2014-01-24 17:13:49 -08:00
Kconfig.arm cpufreq / boost: Kconfig: Support for software-managed BOOST 2014-01-17 02:00:45 +01:00
Kconfig.powerpc cpufreq: remove CONFIG_CPU_FREQ_TABLE 2013-10-16 00:50:33 +02:00
Kconfig.x86 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-11-15 16:47:22 -08:00
kirkwood-cpufreq.c cpufreq: Mark ARM drivers with CPUFREQ_NEED_INITIAL_FREQ_CHECK flag 2014-01-06 14:17:25 +01:00
longhaul.c cpufreq: Implement light weight ->target_index() routine 2013-10-25 22:42:24 +02:00
longhaul.h cpufreq: delete __cpuinit usage from all cpufreq files 2013-07-14 19:36:57 -04:00
longrun.c cpufreq: add new routine cpufreq_verify_within_cpu_limits() 2013-10-16 00:50:23 +02:00
loongson2_cpufreq.c cpufreq: introduce cpufreq_generic_get() routine 2014-01-17 02:00:44 +01:00
Makefile cpufreq: arm_big_little: add vexpress SPC interface driver 2013-10-30 00:48:26 +01:00
maple-cpufreq.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
omap-cpufreq.c cpufreq: introduce cpufreq_generic_get() routine 2014-01-17 02:00:44 +01:00
p4-clockmod.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
pasemi-cpufreq.c ACPI and power management updates for 3.13-rc1 2013-11-14 13:41:48 +09:00
pcc-cpufreq.c cpufreq: send new set of notification for transition failures 2014-01-06 01:43:44 +01:00
pmac32-cpufreq.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
pmac64-cpufreq.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
powernow-k6.c powernow-k6: reorder frequencies 2014-01-06 15:53:07 +01:00
powernow-k7.c cpufreq: Implement light weight ->target_index() routine 2013-10-25 22:42:24 +02:00
powernow-k7.h [CPUFREQ] Move x86 drivers to drivers/cpufreq/ 2011-05-19 18:51:07 -04:00
powernow-k8.c cpufreq: send new set of notification for transition failures 2014-01-06 01:43:44 +01:00
powernow-k8.h cpufreq: Remove support for hardware P-state chips from powernow-k8 2012-09-09 22:05:30 +02:00
ppc-corenet-cpufreq.c cpufreq: introduce cpufreq_generic_get() routine 2014-01-17 02:00:44 +01:00
ppc_cbe_cpufreq.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
ppc_cbe_cpufreq.h cpufreq: powerpc/platforms/cell: move cpufreq driver to drivers/cpufreq 2013-04-10 13:19:26 +02:00
ppc_cbe_cpufreq_pervasive.c cpufreq: powerpc/platforms/cell: move cpufreq driver to drivers/cpufreq 2013-04-10 13:19:26 +02:00
ppc_cbe_cpufreq_pmi.c cpufreq: powerpc/platforms/cell: move cpufreq driver to drivers/cpufreq 2013-04-10 13:19:26 +02:00
pxa2xx-cpufreq.c cpufreq: Mark ARM drivers with CPUFREQ_NEED_INITIAL_FREQ_CHECK flag 2014-01-06 14:17:25 +01:00
pxa3xx-cpufreq.c cpufreq: Mark ARM drivers with CPUFREQ_NEED_INITIAL_FREQ_CHECK flag 2014-01-06 14:17:25 +01:00
s3c24xx-cpufreq-debugfs.c cpufreq: s3c24xx: move cpufreq driver to drivers/cpufreq 2013-05-20 23:04:28 +09:00
s3c24xx-cpufreq.c cpufreq: introduce cpufreq_generic_get() routine 2014-01-17 02:00:44 +01:00
s3c64xx-cpufreq.c cpufreq: introduce cpufreq_generic_get() routine 2014-01-17 02:00:44 +01:00
s3c2410-cpufreq.c cpufreq: s3c24xx: move cpufreq driver to drivers/cpufreq 2013-05-20 23:04:28 +09:00
s3c2412-cpufreq.c cpufreq: s3c24xx: move cpufreq driver to drivers/cpufreq 2013-05-20 23:04:28 +09:00
s3c2416-cpufreq.c cpufreq: Mark ARM drivers with CPUFREQ_NEED_INITIAL_FREQ_CHECK flag 2014-01-06 14:17:25 +01:00
s3c2440-cpufreq.c cpufreq: s3c2440: Staticize local variables 2014-01-06 01:18:33 +01:00
s5pv210-cpufreq.c cpufreq: introduce cpufreq_generic_get() routine 2014-01-17 02:00:44 +01:00
sa1100-cpufreq.c cpufreq: Mark ARM drivers with CPUFREQ_NEED_INITIAL_FREQ_CHECK flag 2014-01-06 14:17:25 +01:00
sa1110-cpufreq.c cpufreq: Mark ARM drivers with CPUFREQ_NEED_INITIAL_FREQ_CHECK flag 2014-01-06 14:17:25 +01:00
sc520_freq.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
sh-cpufreq.c cpufreq: sh: don't initialize part of policy set by core 2013-10-16 00:50:32 +02:00
sparc-us2e-cpufreq.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
sparc-us3-cpufreq.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
spear-cpufreq.c cpufreq: introduce cpufreq_generic_get() routine 2014-01-17 02:00:44 +01:00
speedstep-centrino.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
speedstep-ich.c cpufreq: move freq change notifications to cpufreq core 2013-10-31 00:11:08 +01:00
speedstep-lib.c cpufreq: Add support for x86 cpuinfo auto loading v4 2012-01-26 16:49:06 -08:00
speedstep-lib.h [CPUFREQ] Move x86 drivers to drivers/cpufreq/ 2011-05-19 18:51:07 -04:00
speedstep-smi.c cpufreq: speedstep: remove unused speedstep_get_state 2014-01-17 02:00:43 +01:00
tegra-cpufreq.c cpufreq: introduce cpufreq_generic_get() routine 2014-01-17 02:00:44 +01:00
unicore2-cpufreq.c cpufreq: introduce cpufreq_generic_get() routine 2014-01-17 02:00:44 +01:00
vexpress-spc-cpufreq.c cpufreq: arm_big_little: add vexpress SPC interface driver 2013-10-30 00:48:26 +01:00