From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752609AbcFPGzV (ORCPT ); Thu, 16 Jun 2016 02:55:21 -0400 Received: from nat-hk.nvidia.com ([203.18.50.4]:18454 "EHLO hkmmgate101.nvidia.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751275AbcFPGzS (ORCPT ); Thu, 16 Jun 2016 02:55:18 -0400 X-PGP-Universal: processed; by hkpgpgate101.nvidia.com on Wed, 15 Jun 2016 23:55:15 -0700 Subject: Re: [PATCH] PM / OPP: 'UNKNOWN' status of opp-table->shared To: Viresh Kumar , Rafael Wysocki , Viresh Kumar , Nishanth Menon , Stephen Boyd References: <87bd097db7b673b1f75ca2086dfa76f4dfbf7f8c.1466058619.git.viresh.kumar@linaro.org> CC: , , , , From: Alexandre Courbot Organization: NVIDIA X-Nvconfidentiality: public Message-ID: Date: Thu, 16 Jun 2016 15:55:11 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <87bd097db7b673b1f75ca2086dfa76f4dfbf7f8c.1466058619.git.viresh.kumar@linaro.org> X-Originating-IP: [10.19.57.156] X-ClientProxiedBy: HKMAIL103.nvidia.com (10.18.16.12) To HKMAIL103.nvidia.com (10.18.16.12) Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/16/2016 03:33 PM, Viresh Kumar wrote: > dev_pm_opp_get_sharing_cpus() returns 0 even in the case where the OPP > core doesn't know if the table is shared or not. It is working for most > of the platforms, as the OPP table was never created and we returned > -ENODEV then. > > But in case of one of the platforms (Jetson TK1) at least, the situation > is a bit different. The OPP table is created (somehow) before > dev_pm_opp_get_sharing_cpus() is called and so we returned 0. The caller > of this routine treated that as 'CPUs don't share OPPs' and that had bad > consequences on performance. > > Fix this by converting 'shared_opp' to an integer and have an extra > value when its state in undefined. dev_pm_opp_get_sharing_cpus() returns > -EINVAL now in that case, so that the caller can handle it accordingly > (cpufreq-dt considers that as 'all CPUs share the table'). > > Fixes: 6f707daa3833 ("PM / OPP: Add dev_pm_opp_get_sharing_cpus()") > Reported-by: Alexandre Courbot > Signed-off-by: Viresh Kumar > --- > Hi Alexandre, > > This is untested, can you please confirm if this fixes it for you? Yep, with this cpufreq_init() takes the fallback path and cpufreq behaves as expected thereafter. Thanks for reacting so quickly! Can this go into 4.7 fixes? Tested-by: Alexandre Courbot