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: 9838471 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5D744602D8 for ; Thu, 13 Jul 2017 13:32:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CCE728501 for ; Thu, 13 Jul 2017 13:32:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EC7428574; Thu, 13 Jul 2017 13:32:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B43D528501 for ; Thu, 13 Jul 2017 13:32:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751334AbdGMNcc (ORCPT ); Thu, 13 Jul 2017 09:32:32 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:37478 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751193AbdGMNcb (ORCPT ); Thu, 13 Jul 2017 09:32:31 -0400 Received: by mail-wm0-f54.google.com with SMTP id i127so26194203wma.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=ftzdO9iz67k3QKxko9xim7nsxF4M9p1lMzH9dMqFq/UEwJ16o2amZZ7EM4mjsVNz40 4thbeKOmdENr+ch4dHoScT6MbB6P5G24AoKsyZT+HqXdugsixaoAh1gFm/Wq1dJK/c6T smy4b/Do90BQyuNgNPhxaERr/6AMa0cU5/Y4oAng6cqwXjMtvs418cq6JKEAX7txZikB /kRGQ1jtSWE6T7HzeiH4CjwFWPOoX0ccyE16MxysV48bN+fESmAtztU7aAIbm9R1zlnl wcxZYx2AIc5c94HpD3qrtbUWz4W2zano95JaY/pXWHTvIcZgLV0Vgf43kAyep83w8ERQ qL+Q== X-Gm-Message-State: AIVw111glqC0QxFcWYvja1p3J5g2w+x4Rfvp8M4chFqO4/SUf8qyQfxF feaAEO9CgFiICCWR 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-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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-clk" 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