Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp611510ybl; Fri, 9 Aug 2019 10:51:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwYmUtu9uNJ+WuLCuHknVcKwv9LyT8BJ9Y3Rh6apiNPUd6eZ1MTdz12HTyq9Z/3n32AP0G2 X-Received: by 2002:a17:90a:ff17:: with SMTP id ce23mr10530282pjb.47.1565373100344; Fri, 09 Aug 2019 10:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565373100; cv=none; d=google.com; s=arc-20160816; b=hScj4QTW0L76lwgFiMWkHKwaTO2FQym/kdTW818AyXNw2hxlnVVrX+i66tou5ahSdy qQ5W8XVq15mOICw3Pjm2cmxokuvvRuWGYh5lDzhaCJFACtZL+nUBvXtFHiyjTZ8bwpLu 3dkUqCq9/Kz82TSbxcHxPYvMRmWnJlSJFxDePdnQgxZ2ZtwGklc3UhqNf2kKtLraJPCA SKQL17Ng+HxRk5LuaDLp5Yl8ofwvamiWFgrAVNSkppl1WdX+XietVHpNf4KCBgQFhAYu 6W9FtotWSLbtLdCg2Z7pLpyzp/xcBQPLZbIeKpneuT+i+qpQavHvqs6AgKr+9lg39TWl GB1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=0Sw/1ZpNovS8GPU6ODyACBRq1n5M5z9Hj/A0TEehRpc=; b=Pfs4r7UV3B2BMvQ6R9/sqfbnFAcNGmIK+R4XYgz7lrOmBexIWnxuDCMqNR+dhxMN/p YQ/XDMrd9lROSmK65Xh935xqvczRTaKznqOHIC4hlbW8QM6g+OC/QyYE5msAJkecIHd6 GgCGQvyqBBjXLYiZxaDj16Hy32LeAoPe9/DjbDz+8TIySqvYbz1TVmTEZI7tYEjUuWjo ENUa9H1MchgkoMF7cGVw/VN64hcXs6h4tH96QQC4zCF16gO2UAlLNiJGzbz8GenRUHn2 9AnTqSyCACNvgtdVGfG60dZNAFwk/aWlKz0wtcynrY4ND3QSUoZE69znNEC0uDTZ2PGF S0sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jS9A76Gu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 71si50316546plf.156.2019.08.09.10.51.24; Fri, 09 Aug 2019 10:51:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jS9A76Gu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407609AbfHIRug (ORCPT + 99 others); Fri, 9 Aug 2019 13:50:36 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:42735 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407597AbfHIRug (ORCPT ); Fri, 9 Aug 2019 13:50:36 -0400 Received: by mail-lf1-f68.google.com with SMTP id s19so7430921lfb.9; Fri, 09 Aug 2019 10:50:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=0Sw/1ZpNovS8GPU6ODyACBRq1n5M5z9Hj/A0TEehRpc=; b=jS9A76GubJnVatO7k3NABYv63ju5mshD/TETrek1lijcq/jbSPQCt6zahaAWnXevhi Gt6zxeNBm23WDf41yPsrBCZcRGf0PGbMhEn43V8NLayKWAd+n+fKOjOTTYpnDho7TUwU gFRC3NcdK6Ui3znt2gGHAkBpj7IkNGqhiKiLvCH8SyYg37UV0MDRsOum5FA8AoCEbEsv /EMozayAvs4Alfg7ObXiQwZ6zjKgqq/9GaOSVbJV0jJbQQYvW6VF6B+b07HufvoSizqb h1PfZQjl44IjfYzBsZ1OMxDYapaC1GH1VL/F0T9g4QIqfaY2vG+WsduozIsEBMe8WZQn ACZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0Sw/1ZpNovS8GPU6ODyACBRq1n5M5z9Hj/A0TEehRpc=; b=E1MAkXKNVWTXt93r0ryZaKW2wf7jnJVgsQ3FfYctq9lpRiBaJVytrR8sECzN44FZ8d c0FoU5iEKEOPffbMxdUIuFvya37DrDDwcorqKDsRPbsQo2pLYb4GwEW3TSefOOItegir jLv2pcRYJXeIqJFDvqlddotB7IjyQ3XE/0HdDQUtu8Ri/KRYR3NkYAF2FWmcRZhVT4E8 GqitGsU5bplK74mKCrK0c8IGdCVxqqN6rRpIvxZgGcjntTRKsNxRR2g8tkolpRgEoAT2 08dDUAc+gixvEq1M0ph+FeOMvR7cJ9/853aPxasz0K92IAqaUa2QjH1JqzVq0Iwol17M jCzg== X-Gm-Message-State: APjAAAWBzLjkwx+95LQ9F+qOcFX9ErmR6k6Qb7LftHEYB8R88YhMQ4I5 Ss/l2eRi53sQttFGzOUB7MNC0ILM X-Received: by 2002:ac2:5dd6:: with SMTP id x22mr13071555lfq.92.1565373033199; Fri, 09 Aug 2019 10:50:33 -0700 (PDT) Received: from [192.168.2.145] ([94.29.34.218]) by smtp.googlemail.com with ESMTPSA id u21sm19568030lju.2.2019.08.09.10.50.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Aug 2019 10:50:32 -0700 (PDT) Subject: Re: [PATCH v8 05/21] clk: tegra: pll: Save and restore pll context To: Sowjanya Komatineni , thierry.reding@gmail.com, jonathanh@nvidia.com, tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com, linus.walleij@linaro.org, stefan@agner.ch, mark.rutland@arm.com Cc: pdeschrijver@nvidia.com, pgaikwad@nvidia.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, jckuo@nvidia.com, josephl@nvidia.com, talho@nvidia.com, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, mperttunen@nvidia.com, spatra@nvidia.com, robh+dt@kernel.org, devicetree@vger.kernel.org, rjw@rjwysocki.net, viresh.kumar@linaro.org, linux-pm@vger.kernel.org References: <1565308020-31952-1-git-send-email-skomatineni@nvidia.com> <1565308020-31952-6-git-send-email-skomatineni@nvidia.com> <68f65db6-44b7-1c75-2633-4a2fffd62a92@gmail.com> From: Dmitry Osipenko Message-ID: <2eecf4ff-802d-7e0e-d971-0257fae4e3a2@gmail.com> Date: Fri, 9 Aug 2019 20:50:30 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 09.08.2019 20:39, Sowjanya Komatineni пишет: > > On 8/9/19 4:33 AM, Dmitry Osipenko wrote: >> 09.08.2019 2:46, Sowjanya Komatineni пишет: >>> This patch implements save and restore of PLL context. >>> >>> During system suspend, core power goes off and looses the settings >>> of the Tegra CAR controller registers. >>> >>> So during suspend entry pll context is stored and on resume it is >>> restored back along with its state. >>> >>> Acked-by: Thierry Reding >>> Signed-off-by: Sowjanya Komatineni >>> --- >>>   drivers/clk/tegra/clk-pll.c | 88 ++++++++++++++++++++++++++++----------------- >>>   drivers/clk/tegra/clk.h     |  2 ++ >>>   2 files changed, 58 insertions(+), 32 deletions(-) >>> >>> diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c >>> index 1583f5fc992f..e52add2bbdbb 100644 >>> --- a/drivers/clk/tegra/clk-pll.c >>> +++ b/drivers/clk/tegra/clk-pll.c >>> @@ -1008,6 +1008,28 @@ static unsigned long clk_plle_recalc_rate(struct clk_hw *hw, >>>       return rate; >>>   } >>>   +static void tegra_clk_pll_restore_context(struct clk_hw *hw) >>> +{ >>> +    struct tegra_clk_pll *pll = to_clk_pll(hw); >>> +    struct clk_hw *parent = clk_hw_get_parent(hw); >>> +    unsigned long parent_rate = clk_hw_get_rate(parent); >>> +    unsigned long rate = clk_hw_get_rate(hw); >>> +    u32 val; >>> + >>> +    if (clk_pll_is_enabled(hw)) >>> +        return; >>> + >>> +    if (pll->params->set_defaults) >>> +        pll->params->set_defaults(pll); >>> + >>> +    clk_pll_set_rate(hw, rate, parent_rate); >>> + >>> +    if (!__clk_get_enable_count(hw->clk)) >> What about orphaned clocks? Is enable_count > 0 for them? > There are no orphaned pll clocks. Sorry, I meant the "clk_ignore_unused".