Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754008AbcDYJgz (ORCPT ); Mon, 25 Apr 2016 05:36:55 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:36464 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753617AbcDYJgy (ORCPT ); Mon, 25 Apr 2016 05:36:54 -0400 Date: Mon, 25 Apr 2016 15:06:50 +0530 From: Viresh Kumar To: Stephen Boyd Cc: Rafael Wysocki , linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, nm@ti.com, arnd.bergmann@linaro.org, andrew@lunn.ch, gregory.clement@free-electrons.com, jason@lakedaemon.net, sebastian.hesselbarth@gmail.com, thomas.petazzoni@free-electrons.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 07/10] cpufreq: dt: Identify cpu-sharing for platforms without operating-points-v2 Message-ID: <20160425093650.GG32183@vireshk-i7> References: <20160422222736.GU13149@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160422222736.GU13149@codeaurora.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1160 Lines: 33 On 22-04-16, 15:27, Stephen Boyd wrote: > On 04/21, Viresh Kumar wrote: > > @@ -167,14 +167,16 @@ static int cpufreq_init(struct cpufreq_policy *policy) > > /* Get OPP-sharing information from "operating-points-v2" bindings */ > > ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, policy->cpus); > > if (ret) { > > + if (ret != -ENOENT) > > + goto out_put_clk; > > + > > /* > > * operating-points-v2 not supported, fallback to old method of > > - * finding shared-OPPs for backward compatibility. > > + * finding shared-OPPs for backward compatibility if the > > + * platform hasn't set sharing CPUs. > > */ > > - if (ret == -ENOENT) > > - opp_v1 = true; > > - else > > - goto out_put_clk; > > + if (dev_pm_opp_get_sharing_cpus(cpu_dev, policy->cpus)) > > + fallback = true; > > I'm sort of lost, we make the same call twice here. Why would the > return value change between the first time and the second? Two different APIs, which look similar :) The first one tries to find the sharing-cpus relation from DT, the other one is for v1 bindings and finds it due to platform code dev_pm_opp_set_sharing_cpus() call. -- viresh