Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932707AbcLABog (ORCPT ); Wed, 30 Nov 2016 20:44:36 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:53180 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756545AbcLABoe (ORCPT ); Wed, 30 Nov 2016 20:44:34 -0500 X-AuditID: cbfee61a-f79916d0000062de-41-583f807a7aa2 Message-id: <583F80AB.5040408@samsung.com> Date: Thu, 01 Dec 2016 10:45:15 +0900 From: Joonyoung Shim User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-version: 1.0 To: Viresh Kumar Cc: Rafael Wysocki , Viresh Kumar , Nishanth Menon , Stephen Boyd , linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , "# v4 . 4+" , Joonyoung Shim Subject: Re: [PATCH V4] PM / OPP: Pass opp_table to dev_pm_opp_put_regulator() References: <480ae6e161788d338fb1637aa2615a75588ac3c6.1480478081.git.viresh.kumar@linaro.org> <583E6F88.9010805@samsung.com> <20161130080543.GJ3288@vireshk-i7> In-reply-to: <20161130080543.GJ3288@vireshk-i7> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKIsWRmVeSWpSXmKPExsVy+t9jAd2qBvsIg5nXFS1e3LvIYvH+0DNm i8u75rBZfO49wmjx5sdZJoszpy+xWvw4081isWDjI0aLjiPfmC02fvWw2PzgGJsDt8flvl4m j02rOtk87lzbw+Zx+99jZo8tV9tZPPq2rGL0OH5jO5PH501yARxRbjYZqYkpqUUKqXnJ+SmZ eem2SqEhbroWSgp5ibmptkoRur4hQUoKZYk5pUCekQEacHAOcA9W0rdLcMt40drNVNAmXtHS +4WpgfG6UBcjJ4eEgInErYY+dghbTOLCvfVsXYxcHEICSxklzi5pZYFw7jNKtG3cwAJSxSug JdGwZgpYB4uAqsThpyuZQGw2AT2JO9uOg9miAmESD9btZYWoF5T4MfkeUC8HhwhQ78ubqSAz mQVeMElMWd/CBlIjLOAn0XjkDCvEsu+MEvvOrWQHaeAU0Jdo75QCMZmB5t+/qAVSziwgL7F5 zVvmCYwCs5BsmIVQNQtJ1QJG5lWMEqkFyQXFSem5hnmp5XrFibnFpXnpesn5uZsYwVH6TGoH 48Fd7ocYBTgYlXh4F8TZRwixJpYVV+YeYpTgYFYS4d1UDxTiTUmsrEotyo8vKs1JLT7EaAoM gonMUqLJ+cAEklcSb2hibmJubGBhbmlpYqQkzts4+1m4kEB6YklqdmpqQWoRTB8TB6dUA6Px g0cTEmNP8JQnvW0JjYlZv3H3t/uJu/56u5e4pyS/759y0fHlR5mdr+oSY9WmX8xdeFF1ueM1 nosmyRdYBN+c1bOv+XTFK59zQdUGpyuq2oIbEmIFznI5RPcr2SSrf4gv33H2rLJ+UltJWOHM 1ad+rK/LTtvFGXtCKbjnzJukQwuex94ySVJiKc5INNRiLipOBAC1XWbD6AIAAA== X-MTR: 20000000000000000@CPGS Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2875 Lines: 75 On 11/30/2016 05:05 PM, Viresh Kumar wrote: > On 30-11-16, 15:19, Joonyoung Shim wrote: >> Hi Viresh, >> >> On 11/30/2016 12:59 PM, Viresh Kumar wrote: >>> From: Stephen Boyd >>> >>> Joonyoung Shim reported an interesting problem on his ARM octa-core >>> Odoroid-XU3 platform. During system suspend, dev_pm_opp_put_regulator() >>> was failing for a struct device for which dev_pm_opp_set_regulator() is >>> called earlier. >>> >>> This happened because an earlier call to >>> dev_pm_opp_of_cpumask_remove_table() function (from cpufreq-dt.c file) >>> removed all the entries from opp_table->dev_list apart from the last CPU >>> device in the cpumask of CPUs sharing the OPP. >>> >>> But both dev_pm_opp_set_regulator() and dev_pm_opp_put_regulator() >>> routines get CPU device for the first CPU in the cpumask. And so the OPP >>> core failed to find the OPP table for the struct device. >>> >>> In order to fix that up properly, we need to revisit APIs like >>> dev_pm_opp_set_regulator() and make them talk in terms of cookies >>> provided by the OPP core. But such a solution will be hard to backport >>> to stable kernels. >>> >>> This patch attempts to fix this problem by returning a pointer to the >>> opp_table from dev_pm_opp_set_regulator() and using that as the >>> parameter to dev_pm_opp_put_regulator(). This ensures that the >>> dev_pm_opp_put_regulator() doesn't fail to find the opp table. >>> >>> Note that similar design problem also exists with other >>> dev_pm_opp_put_*() APIs, but those aren't used currently by anyone and >>> so we don't need to update them for now. >>> >>> [Viresh]: Written commit log, minor improvements in the patch and tested >>> on exynos 5250. >>> >>> Cc: # v4.4+ >>> Reported-by: Joonyoung Shim >>> Signed-off-by: Stephen Boyd >>> Signed-off-by: Viresh Kumar >>> --- >>> V3->V4: >>> - Completely different approach, suggested earlier by Stephen. >>> - Can be merged safely now as both /me and Stephen agree to this one. >>> >>> @Joonyoung: Can you please test this last patch please ? >>> >> >> Just system suspend/resume is working > > Should I consider that as a Tested-by from you for the problem you > reported at least ? > My Tested-by is ok about the original problem reported by me. >> but i was missing below test case >> that you inform when i test for prior patches on my Odroid-XU3 board. >> >> - offline CPU 4 >> - suspend the system >> >> With this test case, now all patches posted have the problem that is >> failed to get clk: -2. > > That probably happens because your DT isn't good enough. Following DT > change may fix it for you: > Already i tried and the error was gone but sometimes system resume is halt. I'm not sure that it has any effect so i need to more dig. Thanks.