Latest commit d477bf3 Sep 21, 2017 @Suniel-Mahesh Suniel-Mahesh committed with Rafael J. Wysocki cpufreq: dt: Fix sysfs duplicate filename creation for platform-device
ti-cpufreq and cpufreq-dt-platdev drivers are registering platform-device
with same name "cpufreq-dt" using platform_device_register_*() routines.
This is leading to build warnings appended below.

Providing hardware information to OPP framework along with the platform-
device creation should be done by ti-cpufreq driver before cpufreq-dt
driver comes into place.

This patch add's TI am33xx, am43 and dra7 platforms (which use opp-v2
property) to the blacklist of devices in cpufreq-dt-platform driver to
avoid creating platform-device twice and remove build warnings.

[    2.370167] ------------[ cut here ]------------
[    2.375087] WARNING: CPU: 0 PID: 1 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x58/0x78
[    2.383112] sysfs: cannot create duplicate filename '/devices/platform/cpufreq-dt'
[    2.391219] Modules linked in:
[    2.394506] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.13.0-next-20170912 #1
[    2.402006] Hardware name: Generic AM33XX (Flattened Device Tree)
[    2.408437] [<c0110a28>] (unwind_backtrace) from [<c010ca84>] (show_stack+0x10/0x14)
[    2.416568] [<c010ca84>] (show_stack) from [<c0827d64>] (dump_stack+0xac/0xe0)
[    2.424165] [<c0827d64>] (dump_stack) from [<c0137470>] (__warn+0xd8/0x104)
[    2.431488] [<c0137470>] (__warn) from [<c01374d0>] (warn_slowpath_fmt+0x34/0x44)
[    2.439351] [<c01374d0>] (warn_slowpath_fmt) from [<c03459d0>] (sysfs_warn_dup+0x58/0x78)
[    2.447938] [<c03459d0>] (sysfs_warn_dup) from [<c0345ab8>] (sysfs_create_dir_ns+0x80/0x98)
[    2.456719] [<c0345ab8>] (sysfs_create_dir_ns) from [<c082c554>] (kobject_add_internal+0x9c/0x2d4)
[    2.466124] [<c082c554>] (kobject_add_internal) from [<c082c7d8>] (kobject_add+0x4c/0x9c)
[    2.474712] [<c082c7d8>] (kobject_add) from [<c05803e4>] (device_add+0xcc/0x57c)
[    2.482489] [<c05803e4>] (device_add) from [<c0584b74>] (platform_device_add+0x100/0x220)
[    2.491085] [<c0584b74>] (platform_device_add) from [<c05855a8>] (platform_device_register_full+0xf4/0x118)
[    2.501305] [<c05855a8>] (platform_device_register_full) from [<c067023c>] (ti_cpufreq_init+0x150/0x22c)
[    2.511253] [<c067023c>] (ti_cpufreq_init) from [<c0101df4>] (do_one_initcall+0x3c/0x170)
[    2.519838] [<c0101df4>] (do_one_initcall) from [<c0c00eb4>] (kernel_init_freeable+0x1fc/0x2c4)
[    2.528974] [<c0c00eb4>] (kernel_init_freeable) from [<c083bcac>] (kernel_init+0x8/0x110)
[    2.537565] [<c083bcac>] (kernel_init) from [<c0107d18>] (ret_from_fork+0x14/0x3c)
[    2.545981] ---[ end trace 2fc00e213c13ab20 ]---
[    2.551051] ------------[ cut here ]------------
[    2.555931] WARNING: CPU: 0 PID: 1 at lib/kobject.c:240 kobject_add_internal+0x254/0x2d4
[    2.564578] kobject_add_internal failed for cpufreq-dt with -EEXIST, don't try to register
things with the same name in the same directory.
[    2.577977] Modules linked in:
[    2.581261] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G        W       4.13.0-next-20170912 #1
[    2.590013] Hardware name: Generic AM33XX (Flattened Device Tree)
[    2.596437] [<c0110a28>] (unwind_backtrace) from [<c010ca84>] (show_stack+0x10/0x14)
[    2.604573] [<c010ca84>] (show_stack) from [<c0827d64>] (dump_stack+0xac/0xe0)
[    2.612172] [<c0827d64>] (dump_stack) from [<c0137470>] (__warn+0xd8/0x104)
[    2.619494] [<c0137470>] (__warn) from [<c01374d0>] (warn_slowpath_fmt+0x34/0x44)
[    2.627362] [<c01374d0>] (warn_slowpath_fmt) from [<c082c70c>] (kobject_add_internal+0x254/0x2d4)
[    2.636666] [<c082c70c>] (kobject_add_internal) from [<c082c7d8>] (kobject_add+0x4c/0x9c)
[    2.645255] [<c082c7d8>] (kobject_add) from [<c05803e4>] (device_add+0xcc/0x57c)
[    2.653027] [<c05803e4>] (device_add) from [<c0584b74>] (platform_device_add+0x100/0x220)
[    2.661615] [<c0584b74>] (platform_device_add) from [<c05855a8>] (platform_device_register_full+0xf4/0x118)
[    2.671833] [<c05855a8>] (platform_device_register_full) from [<c067023c>] (ti_cpufreq_init+0x150/0x22c)
[    2.681779] [<c067023c>] (ti_cpufreq_init) from [<c0101df4>] (do_one_initcall+0x3c/0x170)
[    2.690377] [<c0101df4>] (do_one_initcall) from [<c0c00eb4>] (kernel_init_freeable+0x1fc/0x2c4)
[    2.699510] [<c0c00eb4>] (kernel_init_freeable) from [<c083bcac>] (kernel_init+0x8/0x110)
[    2.708106] [<c083bcac>] (kernel_init) from [<c0107d18>] (ret_from_fork+0x14/0x3c)
[    2.716217] ---[ end trace 2fc00e213c13ab21 ]---

Fixes: edeec42 (cpufreq: dt-cpufreq: platdev Automatically create device with OPP v2)
Signed-off-by: Suniel Mahesh <sunil.m@techveda.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Permalink
..
Failed to load latest commit information.
Kconfig cpufreq: qoriq: add ARM64 SoCs support Feb 9, 2017
Kconfig.arm cpufreq: dbx500: Delete obsolete driver Aug 22, 2017
Kconfig.powerpc cpufreq: qoriq: rename the driver Mar 18, 2015
Kconfig.x86 sched/x86: Change CONFIG_SCHED_ITMT to CONFIG_SCHED_MC_PRIO Nov 30, 2016
Makefile cpufreq: dbx500: Delete obsolete driver Aug 22, 2017
acpi-cpufreq.c cpufreq: Remove CPU hotplug callbacks only if they were initialized Dec 21, 2016
amd_freq_sensitivity.c cpufreq: Reuse new freq-table helpers Jul 6, 2016
arm_big_little.c cpufreq: arm_big_little: Make ->get_transition_latency() mandatory Jul 25, 2017
arm_big_little.h cpufreq: arm_big_little: use generic OPP functions for {init, free}_o… May 4, 2016
arm_big_little_dt.c cpufreq: arm_big_little: use generic OPP functions for {init, free}_o… May 4, 2016
at32ap-cpufreq.c cpufreq: at32ap: don't declare local variable as static Apr 7, 2014
blackfin-cpufreq.c blackfin-cpufreq: Mark cpu_set_cclk() as static Dec 28, 2015
bmips-cpufreq.c cpufreq: bmips-cpufreq: CPUfreq driver for Broadcom's BMIPS SoCs Feb 9, 2017
brcmstb-avs-cpufreq.c cpufreq: brcmstb-avs-cpufreq: remove unnecessary platform_set_drvdata() Feb 9, 2017
cppc_cpufreq.c cpufreq: remove setting of policy->cpu in policy->cpus during init Aug 17, 2017
cpufreq-dt-platdev.c cpufreq: dt: Fix sysfs duplicate filename creation for platform-device Sep 25, 2017
cpufreq-dt.c cpufreq: Process remote callbacks from any CPU if the platform permits Aug 1, 2017
cpufreq-dt.h cpufreq: dt: Support governor tunables per policy Sep 13, 2016
cpufreq-nforce2.c cpufreq: Add CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING cpufreq driver flag Jul 25, 2017
cpufreq.c Merge branch 'pm-cpufreq-sched' Sep 3, 2017
cpufreq_conservative.c cpufreq: governor: Drop min_sampling_rate Jul 22, 2017
cpufreq_governor.c Merge branch 'pm-cpufreq-sched' Sep 3, 2017
cpufreq_governor.h cpufreq: Replace "max_transition_latency" with "dynamic_switching" Jul 25, 2017
cpufreq_governor_attr_set.c cpufreq: governor: Move abstract gov_attr_set code to seperate file Apr 1, 2016
cpufreq_ondemand.c cpufreq: governor: Drop min_sampling_rate Jul 22, 2017
cpufreq_ondemand.h cpufreq: ondemand: Don't keep a copy of freq_table pointer Jun 8, 2016
cpufreq_performance.c cpufreq: governor: Get rid of governor events Jun 2, 2016
cpufreq_powersave.c cpufreq: governor: Get rid of governor events Jun 2, 2016
cpufreq_stats.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/… Jul 14, 2017
cpufreq_userspace.c cpufreq: governor: Get rid of governor events Jun 2, 2016
cris-artpec3-cpufreq.c cpufreq: create another field .flags in cpufreq_frequency_table Apr 7, 2014
cris-etraxfs-cpufreq.c cpufreq: create another field .flags in cpufreq_frequency_table Apr 7, 2014
davinci-cpufreq.c ARM: davinci: da850: fix da850_set_pll0rate() Jan 2, 2017
e_powersaver.c cpufreq: e_powersaver: Use IS_ENABLED() instead of checking for built… Apr 27, 2016
elanfreq.c cpufreq: Add CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING cpufreq driver flag Jul 25, 2017
exynos5440-cpufreq.c cpufreq: exynos5440: Fix inconsistent indenting Jun 23, 2017
freq_table.c cpufreq: Handle sorted frequency tables more efficiently Jul 6, 2016
gx-suspmod.c cpufreq: Add CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING cpufreq driver flag Jul 25, 2017
highbank-cpufreq.c Merge branch 'mailbox-for-linus' of git://git.linaro.org/landing-team… Oct 21, 2014
ia64-acpi-cpufreq.c cpufreq/ia64: Replace racy task affinity logic Apr 15, 2017
imx6q-cpufreq.c cpufreq: imx6q: Fix imx6sx low frequency support Aug 28, 2017
intel_pstate.c Merge tag 'acpi-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kerne… Sep 5, 2017
kirkwood-cpufreq.c cpufreq: kirkwood-cpufreq:- Handle return value of clk_prepare_enable() May 29, 2017
longhaul.c Merge tag 'pm-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/g… May 17, 2016
longhaul.h cpufreq: delete __cpuinit usage from all cpufreq files Jul 14, 2013
longrun.c cpufreq: Don't set transition_latency for setpolicy drivers Jul 25, 2017
loongson1-cpufreq.c CPUFREQ: Loongson1: Replace goto out with return in ls1x_cpufreq_probe() May 13, 2016
loongson2_cpufreq.c cpufreq: Loongson2: constify platform_device_id Aug 17, 2017
maple-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt Apr 8, 2016
mediatek-cpufreq.c cpufreq: mediatek: add support of cpufreq to MT7622 SoC Aug 9, 2017
mvebu-cpufreq.c cpufreq: mvebu: fix integer to pointer cast Jun 13, 2016
omap-cpufreq.c PM / OPP: Update OPP users to put reference Jan 30, 2017
p4-clockmod.c cpufreq: Use consistent prefixing via pr_fmt Apr 8, 2016
pasemi-cpufreq.c cpufreq/pasemi: Adjust system_state check May 23, 2017
pcc-cpufreq.c Revert "cpufreq: pcc-cpufreq: update default value of cpuinfo_transit… Jul 22, 2016
pmac32-cpufreq.c cpufreq: Add CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING cpufreq driver flag Jul 25, 2017
pmac64-cpufreq.c cpufreq: Convert to using %pOF instead of full_name Aug 24, 2017
powernow-k6.c cpufreq: Use consistent prefixing via pr_fmt Apr 8, 2016
powernow-k7.c dmi: Mark all struct dmi_system_id instances const Sep 14, 2017
powernow-k7.h [CPUFREQ] Move x86 drivers to drivers/cpufreq/ May 19, 2011
powernow-k8.c format-security: move static strings to const May 9, 2017
powernow-k8.h cpufreq: powernow-k8: Suppress checkpatch warnings May 16, 2014
powernv-cpufreq.c cpufreq: powernv: Add boost files to export ultra-turbo frequencies Feb 3, 2017
ppc_cbe_cpufreq.c cpufreq: Use cpufreq_for_each_* macros for frequency table iteration Apr 29, 2014
ppc_cbe_cpufreq.h cpufreq: e_powersaver: Use IS_ENABLED() instead of checking for built… Apr 27, 2016
ppc_cbe_cpufreq_pervasive.c cpufreq: powerpc/platforms/cell: move cpufreq driver to drivers/cpufreq Apr 10, 2013
ppc_cbe_cpufreq_pmi.c cpufreq: Remove CPUFREQ_START notifier event Feb 3, 2017
pxa2xx-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt Apr 8, 2016
pxa3xx-cpufreq.c cpufreq: Remove cpufreq_generic_exit() Mar 12, 2014
qoriq-cpufreq.c thermal: cpu_cooling: use cpufreq_policy to register cooling device May 28, 2017
s3c2410-cpufreq.c cpufreq: s3c24xx: Remove some dead code Jul 18, 2014
s3c2412-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt Apr 8, 2016
s3c2416-cpufreq.c cpufreq: s3c2416: double free on driver init error path Feb 9, 2017
s3c2440-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt Apr 8, 2016
s3c24xx-cpufreq-debugfs.c cpufreq: Use consistent prefixing via pr_fmt Apr 8, 2016
s3c24xx-cpufreq.c cpufreq: Return index from cpufreq_frequency_table_target() Jun 8, 2016
s3c64xx-cpufreq.c cpufreq: s3c64xx: remove incorrect __init annotation Dec 21, 2016
s5pv210-cpufreq.c cpufreq: s5pv210: add missing of_node_put() Jul 26, 2017
sa1100-cpufreq.c cpufreq: Add CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING cpufreq driver flag Jul 25, 2017
sa1110-cpufreq.c cpufreq: Add CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING cpufreq driver flag Jul 25, 2017
sc520_freq.c cpufreq: Use consistent prefixing via pr_fmt Apr 8, 2016
scpi-cpufreq.c cpufreq: scpi: use new scpi_ops functions to remove duplicate code Jun 5, 2017
sfi-cpufreq.c cpufreq: sfi: make freq_table static Jun 23, 2017
sh-cpufreq.c cpufreq: Add CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING cpufreq driver flag Jul 25, 2017
sparc-us2e-cpufreq.c cpufreq/sparc-us2e: Replace racy task affinity logic Apr 15, 2017
sparc-us3-cpufreq.c cpufreq/sparc-us3: Replace racy task affinity logic Apr 15, 2017
spear-cpufreq.c cpufreq: drop owner assignment from platform_drivers Oct 20, 2014
speedstep-centrino.c cpufreq: Use consistent prefixing via pr_fmt Apr 8, 2016
speedstep-ich.c cpufreq: speedstep: remove unnecessary static in speedstep_detect_chi… Jul 16, 2017
speedstep-lib.c cpufreq: speedstep-lib: make several arrays static, makes code smaller Aug 28, 2017
speedstep-lib.h [CPUFREQ] Move x86 drivers to drivers/cpufreq/ May 19, 2011
speedstep-smi.c cpufreq: Add CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING cpufreq driver flag Jul 25, 2017
sti-cpufreq.c cpufreq: Convert to using %pOF instead of full_name Aug 24, 2017
tango-cpufreq.c cpufreq: dt: Don't use generic platdev driver for tango Jul 22, 2017
tegra124-cpufreq.c cpufreq: tegra124: No need of setting platform-data Apr 8, 2016
tegra186-cpufreq.c cpufreq: Add Tegra186 cpufreq driver Apr 19, 2017
tegra20-cpufreq.c cpufreq: tegra20: remove superfluous CONFIG_PM ifdefs Sep 26, 2015
ti-cpufreq.c cpufreq: ti-cpufreq: Support additional am43xx platforms Sep 19, 2017
unicore2-cpufreq.c cpufreq: Add CPUFREQ_NO_AUTO_DYNAMIC_SWITCHING cpufreq driver flag Jul 25, 2017
vexpress-spc-cpufreq.c cpufreq: arm_big_little: use generic OPP functions for {init, free}_o… May 4, 2016