From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751574AbdIKOTm (ORCPT ); Mon, 11 Sep 2017 10:19:42 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:27340 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751176AbdIKOTk (ORCPT ); Mon, 11 Sep 2017 10:19:40 -0400 Subject: Re: [1/2] cpufreq: dt-platdev: Automatically create cpufreq device with OPP v2 To: Keerthy , Viresh Kumar , Simon Horman References: <20170821131332.GA14662@verge.net.au> <20170821131735.GB14662@verge.net.au> <20170829101146.GF3101@ubuntu> <9f37e244-7c6d-d556-ee7c-a5f3c9d5f756@ti.com> CC: Rafael Wysocki , , Vincent Guittot , , , , , , , , , , From: Dave Gerlach Message-ID: <7c607393-2a3d-1e5e-7b54-3745cee416e3@ti.com> Date: Mon, 11 Sep 2017 09:18:46 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <9f37e244-7c6d-d556-ee7c-a5f3c9d5f756@ti.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [128.247.59.203] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 09/11/2017 07:13 AM, Keerthy wrote: > > > On Tuesday 29 August 2017 03:41 PM, Viresh Kumar wrote: >> On 21-08-17, 15:17, Simon Horman wrote: >>> Sorry, I seem to have accidently sent this email as Virish rather than >>> myself. I will try again. >> >> No issues. I see that Rafael has already applied my patches, you can send >> additional patches over that to make sure everything is clear. > > Viresh, > > I see below warning with this patch on am57xx-beagle > > [ 3.545247] WARNING: CPU: 1 PID: 1 at fs/sysfs/dir.c:31 > sysfs_warn_dup+0x58/0x78 > [ 3.553099] sysfs: cannot create duplicate filename > '/devices/platform/cpufreq-dt' > [ 3.561126] Modules linked in: > [ 3.564402] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W > 4.13.0-next-20170911-12690-ga31cc45-dirty #7 > [ 3.575071] Hardware name: Generic DRA74X (Flattened Device Tree) > [ 3.581484] [] (unwind_backtrace) from [] > (show_stack+0x10/0x14) > [ 3.589620] [] (show_stack) from [] > (dump_stack+0xac/0xe0) > [ 3.597209] [] (dump_stack) from [] > (__warn+0xd8/0x104) > [ 3.604532] [] (__warn) from [] > (warn_slowpath_fmt+0x34/0x44) > [ 3.612390] [] (warn_slowpath_fmt) from [] > (sysfs_warn_dup+0x58/0x78) > [ 3.620988] [] (sysfs_warn_dup) from [] > (sysfs_create_dir_ns+0x80/0x98) > [ 3.629773] [] (sysfs_create_dir_ns) from [] > (kobject_add_internal+0x9c/0x2d4) > [ 3.639177] [] (kobject_add_internal) from [] > (kobject_add+0x4c/0x9c) > [ 3.647764] [] (kobject_add) from [] > (device_add+0xcc/0x57c) > [ 3.655542] [] (device_add) from [] > (platform_device_add+0x100/0x220) > [ 3.664138] [] (platform_device_add) from [] > (platform_device_register_full+0xf4/0x118) > [ 3.674378] [] (platform_device_register_full) from > [] (ti_cpufreq_init+0x150/0x22c) > [ 3.684326] [] (ti_cpufreq_init) from [] > (do_one_initcall+0x3c/0x170) > [ 3.692916] [] (do_one_initcall) from [] > (kernel_init_freeable+0x1fc/0x2c4) > [ 3.702049] [] (kernel_init_freeable) from [] > (kernel_init+0x8/0x110) > [ 3.710639] [] (kernel_init) from [] > (ret_from_fork+0x14/0x3c) > [ 3.718680] ---[ end trace 33482508cbb50156 ]--- > [ 3.720850] ata1: SATA link down (SStatus 0 SControl 300) > [ 3.729278] ------------[ cut here ]------------ > [ 3.734147] WARNING: CPU: 1 PID: 1 at lib/kobject.c:240 > kobject_add_internal+0x254/0x2d4 > [ 3.742709] kobject_add_internal failed for cpufreq-dt with -EEXIST, > don't try to register things with the same name in the same directory. > [ 3.755900] Modules linked in: > [ 3.759239] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W > 4.13.0-next-20170911-12690-ga31cc45-dirty #7 > [ 3.769907] Hardware name: Generic DRA74X (Flattened Device Tree) > [ 3.776321] [] (unwind_backtrace) from [] > (show_stack+0x10/0x14) > [ 3.784454] [] (show_stack) from [] > (dump_stack+0xac/0xe0) > [ 3.792043] [] (dump_stack) from [] > (__warn+0xd8/0x104) > [ 3.799364] [] (__warn) from [] > (warn_slowpath_fmt+0x34/0x44) > [ 3.807227] [] (warn_slowpath_fmt) from [] > (kobject_add_internal+0x254/0x2d4) > [ 3.816552] [] (kobject_add_internal) from [] > (kobject_add+0x4c/0x9c) > [ 3.825139] [] (kobject_add) from [] > (device_add+0xcc/0x57c) > [ 3.832913] [] (device_add) from [] > (platform_device_add+0x100/0x220) > [ 3.841504] [] (platform_device_add) from [] > (platform_device_register_full+0xf4/0x118) > [ 3.851729] [] (platform_device_register_full) from > [] (ti_cpufreq_init+0x150/0x22c) > [ 3.861686] [] (ti_cpufreq_init) from [] > (do_one_initcall+0x3c/0x170) > [ 3.870273] [] (do_one_initcall) from [] > (kernel_init_freeable+0x1fc/0x2c4) > [ 3.879412] [] (kernel_init_freeable) from [] > (kernel_init+0x8/0x110) > [ 3.888002] [] (kernel_init) from [] > (ret_from_fork+0x14/0x3c) > [ 3.896035] ---[ end trace 33482508cbb50157 ]--- > > I believe in two places platform_device_register_* calls are made with > the same name 'cpufreq-dt' > > First place is: cpufreq_dt_platdev_init and the other i believe is > ti_cpufreq_init. > > Dave, > > Should the ti-cpufreq driver also be calling > platform_device_register_simple? Yes, ti-cpufreq registers the cpufreq-dt platdev in order to ensure the ti-cpufreq driver probes first and provides the necessary opp-supported-hw for cpufreq-dt. This applies to am335x, am437x, dra7xx, and am57xx. I suppose these platforms will need to be added to the 'blacklist' to prevent the cpufreq-dt platdev from being created automatically, unless there is a better way to handle this dependency... Regards, Dave > > Regards, > Keerthy > >> From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Gerlach Subject: Re: [1/2] cpufreq: dt-platdev: Automatically create cpufreq device with OPP v2 Date: Mon, 11 Sep 2017 09:18:46 -0500 Message-ID: <7c607393-2a3d-1e5e-7b54-3745cee416e3@ti.com> References: <20170821131332.GA14662@verge.net.au> <20170821131735.GB14662@verge.net.au> <20170829101146.GF3101@ubuntu> <9f37e244-7c6d-d556-ee7c-a5f3c9d5f756@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Return-path: Received: from fllnx210.ext.ti.com ([198.47.19.17]:27340 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751176AbdIKOTk (ORCPT ); Mon, 11 Sep 2017 10:19:40 -0400 In-Reply-To: <9f37e244-7c6d-d556-ee7c-a5f3c9d5f756@ti.com> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Keerthy , Viresh Kumar , Simon Horman Cc: Rafael Wysocki , linux-pm@vger.kernel.org, Vincent Guittot , geert@linux-m68k.org, maxime.ripard@free-electrons.com, wens@csie.org, xuwei5@hisilicon.com, kgene@kernel.org, krzk@kernel.org, yamada.masahiro@socionext.com, jun.nie@linaro.org, baoyou.xie@linaro.org, linux-kernel@vger.kernel.org Hi, On 09/11/2017 07:13 AM, Keerthy wrote: > > > On Tuesday 29 August 2017 03:41 PM, Viresh Kumar wrote: >> On 21-08-17, 15:17, Simon Horman wrote: >>> Sorry, I seem to have accidently sent this email as Virish rather than >>> myself. I will try again. >> >> No issues. I see that Rafael has already applied my patches, you can send >> additional patches over that to make sure everything is clear. > > Viresh, > > I see below warning with this patch on am57xx-beagle > > [ 3.545247] WARNING: CPU: 1 PID: 1 at fs/sysfs/dir.c:31 > sysfs_warn_dup+0x58/0x78 > [ 3.553099] sysfs: cannot create duplicate filename > '/devices/platform/cpufreq-dt' > [ 3.561126] Modules linked in: > [ 3.564402] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W > 4.13.0-next-20170911-12690-ga31cc45-dirty #7 > [ 3.575071] Hardware name: Generic DRA74X (Flattened Device Tree) > [ 3.581484] [] (unwind_backtrace) from [] > (show_stack+0x10/0x14) > [ 3.589620] [] (show_stack) from [] > (dump_stack+0xac/0xe0) > [ 3.597209] [] (dump_stack) from [] > (__warn+0xd8/0x104) > [ 3.604532] [] (__warn) from [] > (warn_slowpath_fmt+0x34/0x44) > [ 3.612390] [] (warn_slowpath_fmt) from [] > (sysfs_warn_dup+0x58/0x78) > [ 3.620988] [] (sysfs_warn_dup) from [] > (sysfs_create_dir_ns+0x80/0x98) > [ 3.629773] [] (sysfs_create_dir_ns) from [] > (kobject_add_internal+0x9c/0x2d4) > [ 3.639177] [] (kobject_add_internal) from [] > (kobject_add+0x4c/0x9c) > [ 3.647764] [] (kobject_add) from [] > (device_add+0xcc/0x57c) > [ 3.655542] [] (device_add) from [] > (platform_device_add+0x100/0x220) > [ 3.664138] [] (platform_device_add) from [] > (platform_device_register_full+0xf4/0x118) > [ 3.674378] [] (platform_device_register_full) from > [] (ti_cpufreq_init+0x150/0x22c) > [ 3.684326] [] (ti_cpufreq_init) from [] > (do_one_initcall+0x3c/0x170) > [ 3.692916] [] (do_one_initcall) from [] > (kernel_init_freeable+0x1fc/0x2c4) > [ 3.702049] [] (kernel_init_freeable) from [] > (kernel_init+0x8/0x110) > [ 3.710639] [] (kernel_init) from [] > (ret_from_fork+0x14/0x3c) > [ 3.718680] ---[ end trace 33482508cbb50156 ]--- > [ 3.720850] ata1: SATA link down (SStatus 0 SControl 300) > [ 3.729278] ------------[ cut here ]------------ > [ 3.734147] WARNING: CPU: 1 PID: 1 at lib/kobject.c:240 > kobject_add_internal+0x254/0x2d4 > [ 3.742709] kobject_add_internal failed for cpufreq-dt with -EEXIST, > don't try to register things with the same name in the same directory. > [ 3.755900] Modules linked in: > [ 3.759239] CPU: 1 PID: 1 Comm: swapper/0 Tainted: G W > 4.13.0-next-20170911-12690-ga31cc45-dirty #7 > [ 3.769907] Hardware name: Generic DRA74X (Flattened Device Tree) > [ 3.776321] [] (unwind_backtrace) from [] > (show_stack+0x10/0x14) > [ 3.784454] [] (show_stack) from [] > (dump_stack+0xac/0xe0) > [ 3.792043] [] (dump_stack) from [] > (__warn+0xd8/0x104) > [ 3.799364] [] (__warn) from [] > (warn_slowpath_fmt+0x34/0x44) > [ 3.807227] [] (warn_slowpath_fmt) from [] > (kobject_add_internal+0x254/0x2d4) > [ 3.816552] [] (kobject_add_internal) from [] > (kobject_add+0x4c/0x9c) > [ 3.825139] [] (kobject_add) from [] > (device_add+0xcc/0x57c) > [ 3.832913] [] (device_add) from [] > (platform_device_add+0x100/0x220) > [ 3.841504] [] (platform_device_add) from [] > (platform_device_register_full+0xf4/0x118) > [ 3.851729] [] (platform_device_register_full) from > [] (ti_cpufreq_init+0x150/0x22c) > [ 3.861686] [] (ti_cpufreq_init) from [] > (do_one_initcall+0x3c/0x170) > [ 3.870273] [] (do_one_initcall) from [] > (kernel_init_freeable+0x1fc/0x2c4) > [ 3.879412] [] (kernel_init_freeable) from [] > (kernel_init+0x8/0x110) > [ 3.888002] [] (kernel_init) from [] > (ret_from_fork+0x14/0x3c) > [ 3.896035] ---[ end trace 33482508cbb50157 ]--- > > I believe in two places platform_device_register_* calls are made with > the same name 'cpufreq-dt' > > First place is: cpufreq_dt_platdev_init and the other i believe is > ti_cpufreq_init. > > Dave, > > Should the ti-cpufreq driver also be calling > platform_device_register_simple? Yes, ti-cpufreq registers the cpufreq-dt platdev in order to ensure the ti-cpufreq driver probes first and provides the necessary opp-supported-hw for cpufreq-dt. This applies to am335x, am437x, dra7xx, and am57xx. I suppose these platforms will need to be added to the 'blacklist' to prevent the cpufreq-dt platdev from being created automatically, unless there is a better way to handle this dependency... Regards, Dave > > Regards, > Keerthy > >>