From patchwork Sat Dec 26 12:15:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 11990327 X-Patchwork-Delegate: neil.armstrong@linaro.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A48D2C433DB for ; Sat, 26 Dec 2020 12:19:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6126B221E2 for ; Sat, 26 Dec 2020 12:19:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6126B221E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7nNJjkln10k4tNpx2LHi5xIaQCQJsEbMwXd+I9KbFuo=; b=on64OF8zhaCa2pEWVVlYLMqIJ IcuBinkHarNDWaBTpbp/rXtlUB0Fyt/yB/Ju2U3vnTu9jqqSw1vw7Ndquq4GUHJTZQRm3KELzLIiS I2WOARf8leIzPMGcQu0PTEOVQLb2xOlqsvRwkQwfrwJog36k/jPbnlErAOskMNV/qutqPVaiDjCRJ 6V6Of6u9KvjZ9c+oDiqGehc4jwDJzqEuJPRCxd4qKn4ttso2swwITN/WjjObFLszbMFhOm7Roh82z abja6N0bF69p+lJJCqsyGnl63UaQTM28IEf+09bLt9k+N6xUZqf97CgzPhsqg2j5r6Osvr3xqEkoA Of6RYYm9Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kt8Xr-0005XM-Ht; Sat, 26 Dec 2020 12:19:39 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kt8Xn-0005V3-EE; Sat, 26 Dec 2020 12:19:36 +0000 Received: by mail-ej1-x634.google.com with SMTP id qw4so8573011ejb.12; Sat, 26 Dec 2020 04:19:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=91uzX9btarYwTY48OYqVxCEpJMafqGhM2WDmwvMf2Sw=; b=o5krIQlBbFhNaKiyKPhMe1CnTfx/qpi2Q/3thkkIJvjGnJC72ealIx5Oh+pdBbZrTf NmT/WpQ/EVCy8FMLda5DsUYxqSgCxDYv9GeACSMig54Z0/GaEw42/qFTRZ0pVOyZ8Po8 5DFy0lvRDSOH/90p5HXIFIAMMPzteeY0yjkQ0PcuzRlPkyI4qTcZorA1zhV3ToEgdsoi AaXufWncHt28dOh3/qEudRyVq6BluZCktrI7JYDA9fVjl8B5rRvI/+cZABF9no9czPcV a+ztkbfrEwVLtRSXzaMOV6YO8QQwRQW3n8GYB7P2cZJdA73d0M6OnLGS8cODr98tHB/8 Wp8g== 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:mime-version:content-transfer-encoding; bh=91uzX9btarYwTY48OYqVxCEpJMafqGhM2WDmwvMf2Sw=; b=XoU7pksAbL3T9JhElWFbbZ1/sv04wWtag3DW/FBLt2HdNz2+B++DjfNw8VEfMbG2Ho +BDx+N1BUqy2U3CTmdW5QNWatywH/IzAatZuziT22lQArsr5HBsFXiydfzy5M/R3ByJL WXsJZOFeF+um2Z6M+08hrNf6fb8rQCTWrDpD+0/cz0buEGWZFqZSbaVB5A79H+Mfd3g7 Kvhfb0dqCUF3NxYAQ+NZD2L5bsetUT+/Xgpgd+ofPpNIYnC9D5Qtv26t9hCau1RisY0/ kHYf5jAAgxW0FGpb5uqP2Q+8+ra+jlPsISaKgF7Cp5Zf3JwlOe4zfEg7uTHSuikKNqSh QhHw== X-Gm-Message-State: AOAM532w9h5b56P+C1uveSukAHJPXKscJmZ1hCOCmnku9vLkxYoJt3w2 z1Hiz5Bpv7y9Pdi8KePIwAXEpmsCjgM= X-Google-Smtp-Source: ABdhPJxW3YGRfa4J2RJQPTSv758UIElxdRO96NXJv6iOlUdtwSq6Q9RL32l7OoaHk5kn5ZtqlwHyUA== X-Received: by 2002:a17:906:174f:: with SMTP id d15mr28145594eje.52.1608985174028; Sat, 26 Dec 2020 04:19:34 -0800 (PST) Received: from localhost.localdomain (p200300f137218200428d5cfffeb99db8.dip0.t-ipconnect.de. [2003:f1:3721:8200:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id j9sm33842662eds.66.2020.12.26.04.19.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Dec 2020 04:19:33 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, jbrunet@baylibre.com Subject: [PATCH 1/3] clk: meson: clk-pll: fix initializing the old rate (fallback) for a PLL Date: Sat, 26 Dec 2020 13:15:54 +0100 Message-Id: <20201226121556.975418-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201226121556.975418-1-martin.blumenstingl@googlemail.com> References: <20201226121556.975418-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201226_071935_534431_CAD40FCD X-CRM114-Status: GOOD ( 14.52 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sboyd@kernel.org, mturquette@baylibre.com, linux-kernel@vger.kernel.org, Martin Blumenstingl , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org The "rate" parameter in meson_clk_pll_set_rate() contains the new rate. Retrieve the old rate with clk_hw_get_rate() so we don't inifinitely try to switch from the new rate to the same ratte again. Fixes: 7a29a869434e8b ("clk: meson: Add support for Meson clock controller") Signed-off-by: Martin Blumenstingl --- drivers/clk/meson/clk-pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c index b17a13e9337c..9404609b5ebf 100644 --- a/drivers/clk/meson/clk-pll.c +++ b/drivers/clk/meson/clk-pll.c @@ -371,7 +371,7 @@ static int meson_clk_pll_set_rate(struct clk_hw *hw, unsigned long rate, if (parent_rate == 0 || rate == 0) return -EINVAL; - old_rate = rate; + old_rate = clk_hw_get_rate(hw); ret = meson_clk_get_pll_settings(rate, parent_rate, &m, &n, pll); if (ret) From patchwork Sat Dec 26 12:15:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 11990331 X-Patchwork-Delegate: neil.armstrong@linaro.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2F27C433DB for ; Sat, 26 Dec 2020 12:19:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A9A3A221E2 for ; Sat, 26 Dec 2020 12:19:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9A3A221E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7fsGh6YlEVmJ4fPjE4K8LU7rpXpbRA1EFckjmbEVAx0=; b=Zi8jGIO9J3fuFdZRunhdv+2jT NVgh/vyIK3llswd36PQiC3uUpAHmRZZGrVh2ZbBcusBP+BV0R/uyOaGchv3zOyQQkNdlsli6V+maV diM52VWBRlEUguEgffXnzU95a2+5DT1SeWMlcqvItV8KcRhfCjYcEUgSTduTWxzn5+SFSWly99YN4 oxw5AL7dsVQg5Qu45WC+Snxe2m3ZL0sAU9Dz3VszGOqKYiJGqBP+SiqU76NRSdNxr+mc6Oz5w0PSR gigaZS/RwSpZgzyFqRyjwCjj+RZkP0Sy5cN/UaSzTz+X5vhfclZjfCXasN7mPw4iQxvwEGbTQSORk 1kPrdndVQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kt8Y1-0005aU-8G; Sat, 26 Dec 2020 12:19:49 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kt8Xo-0005VD-88; Sat, 26 Dec 2020 12:19:37 +0000 Received: by mail-ed1-x531.google.com with SMTP id cm17so5796760edb.4; Sat, 26 Dec 2020 04:19:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yL2fcbE5+ZP0jQqdAhaNB9vo2w/Z2fyL3TP12vjX7FU=; b=CckdE00RXIg+P0KXwsJ2zofSD+5xhSncRG6G+APdtZkMLB2RknEgvQ/HKJ+nlURq2F hn3yJQ4THduC7LanFchEBXYEVrNKq4a+T5RDsqY2atQm3mT2jvv5fqzugiq43TGpsmzw xh2vzap9jz3yBfykGOcAD9RAklebl/s5gxjqcuaxODBbokuQJM/8U8KdB50TsqOeBd3G 9ic+Vl2tNLJrjL6yMxbYY1GTYipIR5gPa0bxWpx8zQWmQ+LQZ8oRYssW+gGLt/S4DXQb am28sItsBC2uhgqdFSsgQ3YAxY1PigWdShJBfo4JHyZn337c/70eqrLxJoLcxd7L9TWi 8SvQ== 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:mime-version:content-transfer-encoding; bh=yL2fcbE5+ZP0jQqdAhaNB9vo2w/Z2fyL3TP12vjX7FU=; b=OZ4wzq58uya+hy4QYnbQ9M6apv0jPA/WMM7RPERnBHltHPAxKPNEtnl4KR2kzizKJc 5W7G0WPNs/sF4L9RRT6ViYsbBKT6wv9VjtgXQ3Cxwd84bTY+qwiM+GUAeRiplTBWi0tP ksHdBNBUB+4eb0axMiJOBO45mhMyJwALTHxwGAYLVz9lLukgDh1okXGkKXluGOVdqyDj MyhcAcG0w5RTJ8OQBbFghNE8cEKYsAykj6jOAEDN6JdhPZJ/WzKKdS0ETw3OENUQPtDJ /l/HjHRC+zNyNULuKgmJMA56UW/AfonhagYtMCdUgvgcydJs3fCLr3OKQ099K7+8RM3j f6pA== X-Gm-Message-State: AOAM532b6KCwTS0VcemB36OrUE5+AvTU1ELZKlg0bx9OQnhQpQoogN8D CMqJF1rGTtRFvLDMU5ts1AbCPUpM0TI= X-Google-Smtp-Source: ABdhPJzsj81ND9dZvGlpw/Zntemt5voV2doEU3AM0Bu6D87Z1uIxXjmwFspZHh7RGGNPJXzYKGmjOA== X-Received: by 2002:a05:6402:2207:: with SMTP id cq7mr34967288edb.310.1608985174842; Sat, 26 Dec 2020 04:19:34 -0800 (PST) Received: from localhost.localdomain (p200300f137218200428d5cfffeb99db8.dip0.t-ipconnect.de. [2003:f1:3721:8200:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id j9sm33842662eds.66.2020.12.26.04.19.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Dec 2020 04:19:34 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, jbrunet@baylibre.com Subject: [PATCH 2/3] clk: meson: clk-pll: make "ret" a signed integer Date: Sat, 26 Dec 2020 13:15:55 +0100 Message-Id: <20201226121556.975418-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201226121556.975418-1-martin.blumenstingl@googlemail.com> References: <20201226121556.975418-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201226_071936_367468_2394B73D X-CRM114-Status: GOOD ( 13.59 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sboyd@kernel.org, mturquette@baylibre.com, linux-kernel@vger.kernel.org, Martin Blumenstingl , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org The error codes returned by meson_clk_get_pll_settings() are all negative. Make "ret" a signed integer in meson_clk_pll_set_rate() to make it match with the clk_ops.set_rate API as well as the data type returned by meson_clk_get_pll_settings(). Fixes: 8eed1db1adec6a ("clk: meson: pll: update driver for the g12a") Signed-off-by: Martin Blumenstingl --- drivers/clk/meson/clk-pll.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c index 9404609b5ebf..5b932976483f 100644 --- a/drivers/clk/meson/clk-pll.c +++ b/drivers/clk/meson/clk-pll.c @@ -365,8 +365,9 @@ static int meson_clk_pll_set_rate(struct clk_hw *hw, unsigned long rate, { struct clk_regmap *clk = to_clk_regmap(hw); struct meson_clk_pll_data *pll = meson_clk_pll_data(clk); - unsigned int enabled, m, n, frac = 0, ret; + unsigned int enabled, m, n, frac = 0; unsigned long old_rate; + int ret; if (parent_rate == 0 || rate == 0) return -EINVAL; From patchwork Sat Dec 26 12:15:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 11990333 X-Patchwork-Delegate: neil.armstrong@linaro.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36218C433DB for ; Sat, 26 Dec 2020 12:20:06 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E6584221E2 for ; Sat, 26 Dec 2020 12:20:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6584221E2 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=dgVVc8Yc7kVImuWwkGcYfniq/qrG1y9aaleF6iepnPE=; b=FujkRpCShZBPDwmKTdinlUc/4 50/FmHpK4M6JqAV0AcNMcDG1OGs4Aha2HsJFnMxFZLgZ5xPm90l1ACPWyM5zDY2bgZyMMyS74SyJH 5LeCQdGCfT46rKua5838TCT3ktRQMrdZhw3VqKQzNDlz841z4KDtvlkOEm20SwQxoOUzAB8/bvqvf I6e5J86oDw2eif5vK87ZdII7VykkR5tCdtJSXAqOikrUDLc8hBkBXYfIJGj9rUYe+F8UDEBOxvIKR meYsaoBSOBl1JFgESOs6xTFi0n6xgHo20jJ6Zg9R8r1ZC0kjx2WPfNDRzXJxBJVeT3JobfF6B4hmH hkUkTL+sw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kt8YC-0005fa-TO; Sat, 26 Dec 2020 12:20:00 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kt8Xp-0005Vl-7f; Sat, 26 Dec 2020 12:19:38 +0000 Received: by mail-ej1-x632.google.com with SMTP id d17so8603000ejy.9; Sat, 26 Dec 2020 04:19:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jgtk+KcYyeTyKMF2wBck7uk+kOOkd8Plk6T6cyUk1SU=; b=h0MV1bgX+w+hpPaEDwSDbkou5jwKH2cZNkqWGQYlliiu2AMHrlF2ho8iDlO9vofXAO aGz2mnJENLqSqhGBCtvqTiuratZ/R9LSU1zSAcRJZvTteBi/lvdxd3AoXz7jmng7fm/R VG7MpdnH17d3SFXK5/oeB8PjLdiZJKL5hHgYuxk1A5RxxEv2K47il3iB5+Ue+f+X/tey agltcayNClMcjHi0IDZTW5xkR9eSesUqcBCMtu2j5XA7QiH2PMH3Qwm1kfHfAZSUd/rw FS0kJajLFOJkpJ3yHuakUICrDiukBLweKzekiB1IOLcnGu1kOvqrtgsnusIQrf3cbhoG j7xQ== 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:mime-version:content-transfer-encoding; bh=jgtk+KcYyeTyKMF2wBck7uk+kOOkd8Plk6T6cyUk1SU=; b=ab7lk2FteRu7Qa7VBmK1thQbmKNXhyBMdTmsBLuk7fGvlm8S+HeAntM8CCXXxXtMvE UarXjl13e1LZZWgOs34PeiO/aeYpDgS/pzx+a7UJZdOGBCopxrObVkOjknGaafxbxw4s bXrI+O49L1hvKQvJm9WZCwuQSDjTe6RauinAijoqQ1ybRv7+Kh7LzNapScOWrBMpgEmz R22zJpCoEwp/ShEIyYyx2xH+N5MpkWt9UlZ/4H8coUncyKC6O4F4E1udfhstwx33huF3 4pwA6LJdLRQsTO+PVE31eS/PM93XsrkQBr0+/2tJNm1iuLA47zUOQfYlc3UCqjlpaRVB uUgQ== X-Gm-Message-State: AOAM533JaIeGDzTWDlCIFGbI2PwVxsTA14/MaBI9JqAFn5xqIc/Lth5Q xnO0IdNgwafkv2GDkq0nVUrekj/m9tU= X-Google-Smtp-Source: ABdhPJzHaWUeLtjGXKYoDfO7HC3w7pkh1RekDFMx1JlDPGbafzIaTA84by+pmeSOGaq0otfnF7PKrg== X-Received: by 2002:a17:906:971a:: with SMTP id k26mr35375666ejx.515.1608985175831; Sat, 26 Dec 2020 04:19:35 -0800 (PST) Received: from localhost.localdomain (p200300f137218200428d5cfffeb99db8.dip0.t-ipconnect.de. [2003:f1:3721:8200:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id j9sm33842662eds.66.2020.12.26.04.19.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Dec 2020 04:19:35 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, jbrunet@baylibre.com Subject: [PATCH 3/3] clk: meson: clk-pll: propagate the error from meson_clk_pll_set_rate() Date: Sat, 26 Dec 2020 13:15:56 +0100 Message-Id: <20201226121556.975418-4-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201226121556.975418-1-martin.blumenstingl@googlemail.com> References: <20201226121556.975418-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201226_071937_323036_A8F1D88B X-CRM114-Status: GOOD ( 14.32 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sboyd@kernel.org, mturquette@baylibre.com, linux-kernel@vger.kernel.org, Martin Blumenstingl , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Popagate the error code from meson_clk_pll_set_rate() when the PLL does not lock with the new settings. Fixes: 722825dcd54b2e ("clk: meson: migrate plls clocks to clk_regmap") Signed-off-by: Martin Blumenstingl --- drivers/clk/meson/clk-pll.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/clk/meson/clk-pll.c b/drivers/clk/meson/clk-pll.c index 5b932976483f..49f27fe53213 100644 --- a/drivers/clk/meson/clk-pll.c +++ b/drivers/clk/meson/clk-pll.c @@ -394,7 +394,8 @@ static int meson_clk_pll_set_rate(struct clk_hw *hw, unsigned long rate, if (!enabled) return 0; - if (meson_clk_pll_enable(hw)) { + ret = meson_clk_pll_enable(hw); + if (ret) { pr_warn("%s: pll did not lock, trying to restore old rate %lu\n", __func__, old_rate); /* @@ -406,7 +407,7 @@ static int meson_clk_pll_set_rate(struct clk_hw *hw, unsigned long rate, meson_clk_pll_set_rate(hw, old_rate, parent_rate); } - return 0; + return ret; } /*