From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753144AbbJSIoU (ORCPT ); Mon, 19 Oct 2015 04:44:20 -0400 Received: from foss.arm.com ([217.140.101.70]:48272 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750958AbbJSIoT (ORCPT ); Mon, 19 Oct 2015 04:44:19 -0400 Subject: Re: [PATCH] cpufreq: arm_big_little: fix frequency check when bL switcher is active To: "Jon Medhurst (Tixy)" References: <1443807532.2845.25.camel@linaro.org> <20151007173920.GG4557@linux> <1444296229.2847.9.camel@linaro.org> <561BB39A.4020400@arm.com> <1444720744.2686.10.camel@linaro.org> <561CDEA9.7020700@arm.com> <1444806720.2691.15.camel@linaro.org> <561E16E0.8030906@arm.com> <1445243581.2831.9.camel@linaro.org> Cc: Sudeep Holla , Viresh Kumar , "Rafael J. Wysocki" , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org From: Sudeep Holla Message-ID: <5624AD5F.7020807@arm.com> Date: Mon, 19 Oct 2015 09:44:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1445243581.2831.9.camel@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/10/15 09:33, Jon Medhurst (Tixy) wrote: > On Wed, 2015-10-14 at 09:48 +0100, Sudeep Holla wrote: >> [...] >> >> OK, I understand what you mean now. I don't have a strong opinion, but >> here is the reason why I prefer the approach I said earlier: >> clk_set_rate doesn't return error if the h/w or f/w return error which >> is usually the last step. So calling clk_get_rate when clk_set_rate >> return error quite early makes no sense to me. > > It doesn't to me either, but my suggested code doesn't do that, it only > calls clk_get_rate if the is _no_ error from clk_set_rate, the pseudo > code again... > > ret = clk_set_rate() > if(!ret) /* if no error from clk_set_rate */ > if(clk_get_rate()!=correct) /* but some additional checks fail */ > ret = -EIO; /* then indicate an error anyway */ > > !ret is ret==0 is 'no error' as the comment says. So the clock framework > thinks the rate was set OK and we then use clk_get_rate to see if those > unreported h/w or f/w errors mean that it actually wasn't set OK. > Ah sorry, my mistake. May be I got carried away by that extra if(!ret). I am fine with the patch. Acked-by: Sudeep Holla -- Regards, Sudeep