From patchwork Thu Jul 13 13:32:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Georgi Djakov X-Patchwork-Id: 107680 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp2277457obm; Thu, 13 Jul 2017 06:32:34 -0700 (PDT) X-Received: by 10.101.73.197 with SMTP id t5mr9320939pgs.160.1499952753931; Thu, 13 Jul 2017 06:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499952753; cv=none; d=google.com; s=arc-20160816; b=az64nHPidhjeOgbjYNT5h/VNoUFO5taNA52FmbQUAsu2l9/kD7s4tk6V64iVQqki2f 5dwOYUmNnuVfUaBk7VzEU+0ErT/fUcPILFxXTmiyPPKfzT8z6hrFuBGHi1SC2YhC9zGa NOhHGOLSzlgpwjqMVQAYO4G8doZ/E64gxwTlhPUiXLJf0CH9W5sY1er5k6HOKDfaQR0x ScJ7M5HoM845JamqnKPu5ry9xGmwNBAaS4A7InPIyMCnl060w8FYNFb+v1PJGjc3XSBG nA+kU6WvU4waHSDBOg4O8iuIRTjiYDROhKdTM95JuUtwY9VFziiyc/ik5z0GlvuhmsP9 A96A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=C8WXbgDwhuRCkg86Ov0VBkb07kKVntrsHNd7YO91KFg=; b=gV3AxFV5RERWaunsYaIkag/ZX7v0mUb9jf5P4/kIkPRjv+JgpvjD9vKzwrhHGE1pX/ dhMLcbImRgA7+twdOrCkNtOn/9Ue05FiS5iEcXlC+WD5k2TCx/rye3bUZwgKMbxatjrg EpvY/iewV6vbmOx6ovH2fq+BEh9BWzRaz2X0sz9fqw8DOyYAWOshLVvvB3LcHe+C08bq sEMdkFgdMZNC3nJpz0AZNJCur29wce/oA3NOU/QmdH54sm6uE1YO1JWV3eZaZGhRrT8h TGjAOEluqO2VUCV/pZimyOZK64IlbgzFhWMnbWZgkJ5bCjQP2FpRZCyV/s2Nw+KPZkol 35vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=CwEdEVBJ; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o186si4203898pga.543.2017.07.13.06.32.33; Thu, 13 Jul 2017 06:32:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=CwEdEVBJ; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751193AbdGMNcc (ORCPT + 10 others); Thu, 13 Jul 2017 09:32:32 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:37478 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751157AbdGMNcb (ORCPT ); Thu, 13 Jul 2017 09:32:31 -0400 Received: by mail-wm0-f48.google.com with SMTP id i127so26194184wma.0 for ; Thu, 13 Jul 2017 06:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2vlVWEtOi4Ywv/K0quk9wIAPRw/8B3KYA1QAWigMXBQ=; b=CwEdEVBJZ35aPlJ2NQGQ+J7576qVoQ9mAFG2NteFnsXfGHD8eHVqXLOavnSrL9wTaB ZLk5OBu3lfyACHNn1LLy/R7uPtgsXF/LeVYMiS6AfJ9xdB3DkGhUVrKhaa8Fl+XpMzfa QOPPDoCWVK6dAbw2Mf8gmHd5DjytFRUsIBaPU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2vlVWEtOi4Ywv/K0quk9wIAPRw/8B3KYA1QAWigMXBQ=; b=Y9fNCzgxxzp+KmY8pHO4jzlJbcPkPiSsp9qokVPZ6Lc7wMU60X85xNuczdOXL5K2bv lsM0ezxKSLHYfjR+iSZR2gzloGydsBQE4I7YDHjE7yJV6PnOex75vqYMcG2mKghH+lix wlC9r9t3UqejQlZEwngwBDU1pzS76YVO0miMiWHFAcRhxGiekVrs+EVS6DGk+gyx+0xI 4hqXK6nM3yL3P7cMCmqn8QkbuA95rHlwKpeqCFo8RCr0fiIVFrrvsIymlXsjdSpln2KJ swpWagM4wXW1wpp/H7F5c851yd65B3sOLcGjyQy6h1DK7y5OxNepKtw6bZNxmpgE0TD3 1XDQ== X-Gm-Message-State: AIVw113mmtdIqm7gRPsM+c63Jt/0zqHstzjBx1MrDoBILsT6Y6601qJ0 NwFpIyEmsyDxWUP9 X-Received: by 10.80.175.198 with SMTP id h64mr3000640edd.131.1499952749842; Thu, 13 Jul 2017 06:32:29 -0700 (PDT) Received: from mms-0441.qualcomm.mm-sol.com ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id e54sm2590763eda.27.2017.07.13.06.32.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Jul 2017 06:32:28 -0700 (PDT) From: Georgi Djakov To: sboyd@codeaurora.org Cc: mturquette@baylibre.com, andy.gross@linaro.org, architt@codeaurora.org, hverkuil@xs4all.nl, bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, georgi.djakov@linaro.org Subject: [PATCH v2] clk: qcom: clk-smd-rpm: Fix the reported rate of branches Date: Thu, 13 Jul 2017 16:32:24 +0300 Message-Id: <20170713133224.753-1-georgi.djakov@linaro.org> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170712231413.GP22780@codeaurora.org> References: <20170712231413.GP22780@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org As there is no way to actually query the hardware for the current clock rate, now racalc_rate() just returns the last rate that was previously set. But if the rate was not set yet, we return the bogus rate of 1000Hz. The branch clocks actually have the same rate as their parent (xo_board), so just return this rate. Reported-by: Archit Taneja Fixes: 00f64b58874e ("clk: qcom: Add support for SMD-RPM Clocks") Signed-off-by: Georgi Djakov --- drivers/clk/qcom/clk-smd-rpm.c | 4 ++++ 1 file changed, 4 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index d990fe44aef3..b45782657ca9 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -364,6 +364,10 @@ static unsigned long clk_smd_rpm_recalc_rate(struct clk_hw *hw, { struct clk_smd_rpm *r = to_clk_smd_rpm(hw); + /* Return the parent rate for branches */ + if (r->branch) + return parent_rate; + /* * RPM handles rate rounding and we don't have a way to * know what the rate will be, so just return whatever