Rafael J. Wysocki
559ed40752
cpufreq: Avoid attempts to create duplicate symbolic links
...
After commit 87549141d5 (cpufreq: Stop migrating sysfs files on
hotplug) there is a problem with CPUs that share cpufreq policy
objects with other CPUs and are initially offline.
Say CPU1 shares a policy with CPU0 which is online and is registered
first. As part of the registration process, cpufreq_add_dev() is
called for it. It creates the policy object and a symbolic link
to it from the CPU1's sysfs directory. If CPU1 is registered
subsequently and it is offline at that time, cpufreq_add_dev() will
attempt to create a symbolic link to the policy object for it, but
that link is present already, so a warning about that will be
triggered.
To avoid that warning, make cpufreq use an additional CPU mask
containing related CPUs that are actually present for each policy
object. That mask is initialized when the policy object is populated
after its creation (for the first online CPU using it) and it includes
CPUs from the "policy CPUs" mask returned by the cpufreq driver's
->init() callback that are physically present at that time. Symbolic
links to the policy are created only for the CPUs in that mask.
If cpufreq_add_dev() is invoked for an offline CPU, it checks the
new mask and only creates the symlink if the CPU was not in it (the
CPU is added to the mask at the same time).
In turn, cpufreq_remove_dev() drops the given CPU from the new mask,
removes its symlink to the policy object and returns, unless it is
the CPU owning the policy object. In that case, the policy object
is moved to a new CPU's sysfs directory or deleted if the CPU being
removed was the last user of the policy.
While at it, notice that cpufreq_remove_dev() can't fail, because
its return value is ignored, so make it ignore return values from
__cpufreq_remove_dev_prepare() and __cpufreq_remove_dev_finish()
and prevent these functions from aborting on errors returned by
__cpufreq_governor(). Also drop the now unused sif argument from
them.
Fixes: 87549141d5 (cpufreq: Stop migrating sysfs files on hotplug)
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reported-and-tested-by: Russell King <linux@arm.linux.org.uk>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
2015-07-28 17:19:26 +02:00
..
acpi-cpufreq.c
acpi-cpufreq: Replace cpu_**_mask() with topology_**_cpumask()
2015-05-27 15:22:16 +02:00
amd_freq_sensitivity.c
arm_big_little.c
cpufreq: arm_big_little: remove compile-time dependency on BIG_LITTLE
2015-05-15 01:53:42 +02:00
arm_big_little.h
cpufreq: arm_big_little: free OPP table created during ->init()
2014-12-02 00:01:24 +01:00
arm_big_little_dt.c
Driver core patches for 3.19-rc1
2014-12-14 16:10:09 -08:00
at32ap-cpufreq.c
blackfin-cpufreq.c
cpufreq-dt.c
cpufreq: dt: allow driver to boot automatically
2015-06-17 00:02:34 +02:00
cpufreq-nforce2.c
cpufreq: nforce2: Fix typo in comment to function nforce2_init()
2015-06-15 15:45:24 +02:00
cpufreq.c
cpufreq: Avoid attempts to create duplicate symbolic links
2015-07-28 17:19:26 +02:00
cpufreq_conservative.c
cpufreq: governor: Serialize governor callbacks
2015-06-15 15:42:53 +02:00
cpufreq_governor.c
cpufreq: governor: Serialize governor callbacks
2015-06-15 15:42:53 +02:00
cpufreq_governor.h
cpufreq: governor: Serialize governor callbacks
2015-06-15 15:42:53 +02:00
cpufreq_ondemand.c
cpufreq: governor: Serialize governor callbacks
2015-06-15 15:42:53 +02:00
cpufreq_opp.c
cpufreq / OPP: Fix the order of arguments for kcalloc()
2014-09-08 00:02:58 +02:00
cpufreq_performance.c
cpufreq_powersave.c
cpufreq_stats.c
cpufreq: stats: drop unnecessary locking
2015-01-23 23:06:45 +01:00
cpufreq_userspace.c
cris-artpec3-cpufreq.c
cris-etraxfs-cpufreq.c
davinci-cpufreq.c
cpufreq: drop owner assignment from platform_drivers
2014-10-20 16:20:24 +02:00
dbx500-cpufreq.c
cpufreq: drop owner assignment from platform_drivers
2014-10-20 16:20:24 +02:00
e_powersaver.c
elanfreq.c
exynos-cpufreq.c
Fix up implicit <module.h> users that will break later.
2015-07-02 10:25:22 -07:00
exynos-cpufreq.h
cpufreq: exynos: remove Exynos4210 specific cpufreq driver support
2015-06-20 12:17:44 -07:00
exynos4x12-cpufreq.c
cpufreq: cpu0: rename driver and internals to 'cpufreq_dt'
2014-10-03 15:37:54 +02:00
exynos5250-cpufreq.c
cpufreq: cpu0: rename driver and internals to 'cpufreq_dt'
2014-10-03 15:37:54 +02:00
exynos5440-cpufreq.c
Driver core patches for 3.19-rc1
2014-12-14 16:10:09 -08:00
freq_table.c
cpufreq: Allow freq_table to be obtained for offline CPUs
2015-07-10 01:43:27 +02:00
gx-suspmod.c
cpufreq: gx-suspmod: Fix two typos in two comments
2015-06-15 15:46:15 +02:00
highbank-cpufreq.c
Merge branch 'mailbox-for-linus' of git://git.linaro.org/landing-teams/working/fujitsu/integration
2014-10-21 11:21:19 -07:00
hisi-acpu-cpufreq.c
cpufreq: hisilicon: add acpu driver
2015-04-02 02:24:54 +02:00
ia64-acpi-cpufreq.c
imx6q-cpufreq.c
Driver core patches for 3.19-rc1
2014-12-14 16:10:09 -08:00
integrator-cpufreq.c
cpufreq: drop owner assignment from platform_drivers
2014-10-20 16:20:24 +02:00
intel_pstate.c
intel_pstate: Add get_scaling cpu_defaults param to Knights Landing
2015-07-27 01:59:43 +02:00
Kconfig
cpufreq: qoriq: rename the driver
2015-03-18 22:35:16 +01:00
Kconfig.arm
The changes to the common clock framework for 4.2 are dominated by new
2015-07-01 19:22:00 -07:00
Kconfig.powerpc
cpufreq: qoriq: rename the driver
2015-03-18 22:35:16 +01:00
Kconfig.x86
cpufreq: Add SFI based cpufreq driver support
2014-12-20 13:37:37 -05:00
kirkwood-cpufreq.c
cpufreq: drop owner assignment from platform_drivers
2014-10-20 16:20:24 +02:00
longhaul.c
Update/Remove soon-to-be-dead email address
2014-12-19 12:56:15 -08:00
longhaul.h
longrun.c
loongson2_cpufreq.c
MIPS, CPUFREQ: Fix spelling of Institute.
2015-07-07 20:59:42 +02:00
ls1x-cpufreq.c
MIPS: Loongson: Naming style cleanup and rework
2015-06-21 21:53:59 +02:00
Makefile
cpufreq: exynos: remove Exynos4210 specific cpufreq driver support
2015-06-20 12:17:44 -07:00
maple-cpufreq.c
omap-cpufreq.c
cpufreq: drop owner assignment from platform_drivers
2014-10-20 16:20:24 +02:00
p4-clockmod.c
p4-clockmod: Replace cpu_sibling_mask() with topology_sibling_cpumask()
2015-05-27 15:22:16 +02:00
pasemi-cpufreq.c
pcc-cpufreq.c
cpufreq: pcc: Enable autoload of pcc-cpufreq for ACPI processors
2014-11-14 00:16:25 +01:00
pmac32-cpufreq.c
powerpc: Remove powerpc specific cmd_line
2014-10-02 17:33:55 +10:00
pmac64-cpufreq.c
of: Migrate of_find_node_by_name() users to for_each_node_by_name()
2014-06-26 17:12:24 +01:00
powernow-k6.c
Update/Remove soon-to-be-dead email address
2014-12-19 12:56:15 -08:00
powernow-k7.c
Update/Remove soon-to-be-dead email address
2014-12-19 12:56:15 -08:00
powernow-k7.h
powernow-k8.c
powernow-k8: Replace cpu_core_mask() with topology_core_cpumask()
2015-05-27 15:22:16 +02:00
powernow-k8.h
powernv-cpufreq.c
cpufreq: powernv: Report cpu frequency throttling
2015-04-01 23:02:24 +02:00
ppc_cbe_cpufreq.c
ppc_cbe_cpufreq.h
ppc_cbe_cpufreq_pervasive.c
ppc_cbe_cpufreq_pmi.c
pxa2xx-cpufreq.c
cpufreq: pxa: make pxa_freqs arrays const
2015-05-05 00:49:38 +02:00
pxa3xx-cpufreq.c
qoriq-cpufreq.c
cpufreq: qoriq: optimize the CPU frequency switching time
2015-06-15 15:47:28 +02:00
s3c24xx-cpufreq-debugfs.c
s3c24xx-cpufreq.c
cpufreq: s3c: remove last use of resume_clocks callback
2015-02-19 06:36:53 +01:00
s3c64xx-cpufreq.c
s3c2410-cpufreq.c
cpufreq: s3c24xx: Remove some dead code
2014-07-19 04:24:59 +09:00
s3c2412-cpufreq.c
cpufreq: s3c24xx: Remove some dead code
2014-07-19 04:24:59 +09:00
s3c2416-cpufreq.c
cpufreq: s3c: remove incorrect __init annotations
2015-02-19 06:36:53 +01:00
s3c2440-cpufreq.c
cpufreq: s3c24xx: Remove some dead code
2014-07-19 04:24:59 +09:00
s5pv210-cpufreq.c
drivers/cpufreq: Convert non-modular s5pv210-cpufreq.c to use builtin_platform_driver
2015-06-16 14:12:38 -04:00
sa1100-cpufreq.c
sa1110-cpufreq.c
cpufreq: sa1110: set memory type for h3600
2014-07-16 14:30:17 +02:00
sc520_freq.c
sfi-cpufreq.c
cpufreq: Add SFI based cpufreq driver support
2014-12-20 13:37:37 -05:00
sh-cpufreq.c
sparc-us2e-cpufreq.c
sparc-us3-cpufreq.c
spear-cpufreq.c
cpufreq: drop owner assignment from platform_drivers
2014-10-20 16:20:24 +02:00
speedstep-centrino.c
speedstep-ich.c
speedstep-ich: Replace cpu_sibling_mask() with topology_sibling_cpumask()
2015-05-27 15:22:16 +02:00
speedstep-lib.c
cpufreq: speedstep-smi: enable interrupts when waiting
2015-02-12 02:02:52 +01:00
speedstep-lib.h
speedstep-smi.c
cpufreq: speedstep-smi: enable interrupts when waiting
2015-02-12 02:02:52 +01:00
tegra-cpufreq.c
unicore2-cpufreq.c
vexpress-spc-cpufreq.c
cpufreq: drop owner assignment from platform_drivers
2014-10-20 16:20:24 +02:00