From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dmitry Osipenko Subject: Re: [PATCH v2 17/17] ARM: dts: tegra30: cardhu-a04: Add CPU Operating Performance Points Date: Wed, 13 Nov 2019 16:57:20 +0300 Message-ID: <8974f1a8-72bb-4413-d2b5-057853696fb4@gmail.com> References: <20191024221416.14197-1-digetx@gmail.com> <20191024221416.14197-18-digetx@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Jon Hunter , Thierry Reding , Peter De Schrijver , Prashant Gaikwad , "Rafael J. Wysocki" , Viresh Kumar , Rob Herring , Michael Turquette , Stephen Boyd , Peter Geis , Nicolas Chauvet , Marcel Ziswiler Cc: linux-pm@vger.kernel.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: linux-tegra@vger.kernel.org Hello Jon, 13.11.2019 09:52, Jon Hunter пишет: > > On 24/10/2019 23:14, Dmitry Osipenko wrote: >> Utilize common Tegra30 CPU OPP table. CPU DVFS is available now on >> cardhu-a04. >> >> Signed-off-by: Dmitry Osipenko >> --- >> arch/arm/boot/dts/tegra30-cardhu-a04.dts | 24 ++++++++++++++++++++++++ >> 1 file changed, 24 insertions(+) >> >> diff --git a/arch/arm/boot/dts/tegra30-cardhu-a04.dts b/arch/arm/boot/dts/tegra30-cardhu-a04.dts >> index 0d71925d4f0b..9234988624ec 100644 >> --- a/arch/arm/boot/dts/tegra30-cardhu-a04.dts >> +++ b/arch/arm/boot/dts/tegra30-cardhu-a04.dts >> @@ -2,6 +2,8 @@ >> /dts-v1/; >> >> #include "tegra30-cardhu.dtsi" >> +#include "tegra30-cpu-opp.dtsi" >> +#include "tegra30-cpu-opp-microvolt.dtsi" >> >> /* This dts file support the cardhu A04 and later versions of board */ >> >> @@ -127,4 +129,26 @@ >> nvidia,tegra-core-regulator; >> }; >> }; >> + >> + cpus { >> + cpu0: cpu@0 { >> + cpu-supply = <&vddctrl_reg>; >> + operating-points-v2 = <&cpu0_opp_table>; >> + }; >> + >> + cpu@1 { >> + cpu-supply = <&vddctrl_reg>; >> + operating-points-v2 = <&cpu0_opp_table>; >> + }; >> + >> + cpu@2 { >> + cpu-supply = <&vddctrl_reg>; >> + operating-points-v2 = <&cpu0_opp_table>; >> + }; >> + >> + cpu@3 { >> + cpu-supply = <&vddctrl_reg>; >> + operating-points-v2 = <&cpu0_opp_table>; >> + }; >> + }; >> }; > > Sorry for not testing this sooner, but this is generating the > following WARNING on boot ... > > [ 2.916019] ------------[ cut here ]------------ > [ 2.920669] WARNING: CPU: 2 PID: 1 at /dvs/git/dirty/git-master_l4t-upstream/kernel/drivers/opp/of.c:688 _of_add_opp_table_v2.part.2+0x45c/0x4d4 > [ 2.933713] Modules linked in: > [ 2.936785] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.4.0-rc7-next-20191112-gfc6d6db1df2c #1 > [ 2.945403] Hardware name: NVIDIA Tegra SoC (Flattened Device Tree) > [ 2.951706] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) > [ 2.959467] [] (show_stack) from [] (dump_stack+0xc0/0xd4) > [ 2.966707] [] (dump_stack) from [] (__warn+0xe0/0xf8) > [ 2.973593] [] (__warn) from [] (warn_slowpath_fmt+0xb0/0xb8) > [ 2.981090] [] (warn_slowpath_fmt) from [] (_of_add_opp_table_v2.part.2+0x45c/0x4d4) > [ 2.990583] [] (_of_add_opp_table_v2.part.2) from [] (dev_pm_opp_of_add_table+0x40/0x15c) > [ 3.000508] [] (dev_pm_opp_of_add_table) from [] (dev_pm_opp_of_cpumask_add_table+0x34/0xb4) > [ 3.010704] [] (dev_pm_opp_of_cpumask_add_table) from [] (cpufreq_init+0xf8/0x2cc) > [ 3.020024] [] (cpufreq_init) from [] (cpufreq_online+0x260/0x824) > [ 3.027953] [] (cpufreq_online) from [] (cpufreq_add_dev+0x6c/0x78) > [ 3.035976] [] (cpufreq_add_dev) from [] (subsys_interface_register+0xa0/0xec) > [ 3.044951] [] (subsys_interface_register) from [] (cpufreq_register_driver+0x14c/0x20c) > [ 3.054792] [] (cpufreq_register_driver) from [] (dt_cpufreq_probe+0x94/0x114) > [ 3.063771] [] (dt_cpufreq_probe) from [] (platform_drv_probe+0x48/0x98) > [ 3.072225] [] (platform_drv_probe) from [] (really_probe+0x234/0x34c) > [ 3.080502] [] (really_probe) from [] (driver_probe_device+0x60/0x168) > [ 3.088780] [] (driver_probe_device) from [] (device_driver_attach+0x58/0x60) > [ 3.097664] [] (device_driver_attach) from [] (__driver_attach+0x80/0xbc) > [ 3.106200] [] (__driver_attach) from [] (bus_for_each_dev+0x74/0xb4) > [ 3.114389] [] (bus_for_each_dev) from [] (bus_add_driver+0x164/0x1e8) > [ 3.122666] [] (bus_add_driver) from [] (driver_register+0x7c/0x114) > [ 3.130774] [] (driver_register) from [] (do_one_initcall+0x54/0x2a8) > [ 3.138974] [] (do_one_initcall) from [] (kernel_init_freeable+0x14c/0x1e8) > [ 3.147695] [] (kernel_init_freeable) from [] (kernel_init+0x8/0x10c) > [ 3.155887] [] (kernel_init) from [] (ret_from_fork+0x14/0x2c) > [ 3.163462] Exception stack(0xef0c9fb0 to 0xef0c9ff8) > [ 3.168519] 9fa0: 00000000 00000000 00000000 00000000 > [ 3.176706] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > [ 3.184893] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 > [ 3.191695] ---[ end trace a7dc36f7a4ddbdb2 ]--- > [ 3.197855] ------------[ cut here ]------------ > > Let me know if you can take a look at this. The warning happens because Cardhu now has CPU OPPs in the device-tree, but supported_hw isn't set for the OPPs and thus the count of available OPPs is 0. This is expected to happen because patch "cpufreq: tegra20: Use generic cpufreq-dt driver (Tegra30 supported now)" isn't applied yet. It is possible to factor out the blacklisting of Tegra SoCs in cpufreq_dt_platdev_init() into a separate patch and request backporting of that change in order to avoid the warning noise for older kernel versions + newer device-tree. Please let me know if you think that it's worth to do the separation.