Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp675262pxu; Wed, 14 Oct 2020 10:44:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzTMaYw4+ns3Uz/ExwT+RoI44/EXS/75HHkPLcksku/jO69X5NnQe0tyZpfqvDmkitLE7c X-Received: by 2002:a17:906:2747:: with SMTP id a7mr138097ejd.301.1602697462308; Wed, 14 Oct 2020 10:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602697462; cv=none; d=google.com; s=arc-20160816; b=AbiQPE6wi79PRLEETR4ArWrRyTJ1NbPhSgJpmH0EP2FR/YoH5+GSZP4+Rp8p8AJMYj R+MECxtOx2ULilMTLOnnjGz6qzBnJ6j35j0AWVOYVnvCfzmJEnzzlM+Ja5pXX40Gd53G Zk9qqsCXF5W7wIPzK+patGZIaWbVyQhC8WqeLNAmCOzGV3s1QI0UXoE3AUbo5PMwCHON fdL68QwWVvMZAtjbWKc5JuM7cnWidH6bI2oV76wYeskitS7c6l6v95zzY80jwNCsuqX7 XuVj7NMjq8+V6aozzwJug1CzFcmbQSz4iUf+DjQkciajCUEiuLhwZV04PfRr1gWBsCDS xHdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dmarc-filter:sender:dkim-signature; bh=/WiCKZgABcCtQ7yaRnJzgeqNLWkv78uh7AEEZ3EoiUI=; b=RhxZLupKiWXbI/DPS8BGNgmZqd8I0LFWXuI8kEAoqMbhdpZ35fRelapcgnIX09z8Zl fGWE2d/U6ry5zp89BTIlWZs/FQKlzQWwILy/kgFmQ3yZ9e1+fvvlHYIFPV2bFlEWwN6X AbzHJlzOH2lZqWK1boaDkOj1XkmOPFuAEhhRznnDk17b2yKKxSLElkiZCE5B9VYj0qOM fVLRjYiAJpOADEgIR5BjjT/h8AWreoBJ2hZJlVjATyq3t79NJXcPMpegRQqGHve3XKCp kDQVwx+0Pwf9QbV79lGheD7PXPALjkkZ3zzf+cqtwtkHv6jYG8/KNDiSIXK1b+51BsX9 /LeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=nGYrFLeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c2si115982edq.270.2020.10.14.10.44.00; Wed, 14 Oct 2020 10:44:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=nGYrFLeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728987AbgJNRWZ (ORCPT + 99 others); Wed, 14 Oct 2020 13:22:25 -0400 Received: from m42-4.mailgun.net ([69.72.42.4]:46529 "EHLO m42-4.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726269AbgJNRWZ (ORCPT ); Wed, 14 Oct 2020 13:22:25 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1602696145; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=/WiCKZgABcCtQ7yaRnJzgeqNLWkv78uh7AEEZ3EoiUI=; b=nGYrFLeTFjJTgR+Z4enjDreDMDpXde4RPBPCqhI1imDDnDzMGTkbKMmy7HvaZ4MTRXmZtFYa iBmOCvwiAWDCCHNYKrt9zrNIPpA/kT4QUH90NqJ9CeuxK6M6SEGu9EZiBThQGut+tYjotIJ3 122Z9YRLl0MA8jJA1HoJSoqjea8= X-Mailgun-Sending-Ip: 69.72.42.4 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 5f8733a2aad2c3cd1c499bf5 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 14 Oct 2020 17:21:37 GMT Sender: tdas=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 2FB44C43385; Wed, 14 Oct 2020 17:21:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.0.102] (unknown [49.204.181.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tdas) by smtp.codeaurora.org (Postfix) with ESMTPSA id 418FCC433C9; Wed, 14 Oct 2020 17:21:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 418FCC433C9 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=tdas@codeaurora.org Subject: Re: [PATCH v2] clk: qcom: lpasscc: Re-configure the PLL in case lost To: Douglas Anderson , Stephen Boyd Cc: David Brown , Rajendra Nayak , linux-soc@vger.kernel.org, Andy Gross , Bjorn Andersson , Michael Turquette , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org References: <20201014085758.v2.1.Id0cc5d859e2422082a29a7909658932c857f5a81@changeid> From: Taniya Das Message-ID: <711a8178-dcf7-d541-a468-ac34d6d14bb1@codeaurora.org> Date: Wed, 14 Oct 2020 22:51:30 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <20201014085758.v2.1.Id0cc5d859e2422082a29a7909658932c857f5a81@changeid> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks Doug for the patch. On 10/14/2020 9:28 PM, Douglas Anderson wrote: > From: Taniya Das > > In the case where the PLL configuration is lost, then the pm runtime > resume will reconfigure before usage. > > Fixes: edab812d802d ("clk: qcom: lpass: Add support for LPASS clock controller for SC7180") > Signed-off-by: Taniya Das > Signed-off-by: Douglas Anderson > --- > I took the liberty of fixing my own nits that I had with Taniya's > patch, AKA: > > https://lore.kernel.org/r/1602614008-2421-2-git-send-email-tdas@codeaurora.org > > Changes in v2: > - Don't needlessly have a 2nd copy of dev_pm_ops and jam it in. > - Check the return value of pm_clk_resume() > - l_val should be unsigned int. > > drivers/clk/qcom/lpasscorecc-sc7180.c | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > > diff --git a/drivers/clk/qcom/lpasscorecc-sc7180.c b/drivers/clk/qcom/lpasscorecc-sc7180.c > index 228d08f5d26f..ee23eb5b9bf2 100644 > --- a/drivers/clk/qcom/lpasscorecc-sc7180.c > +++ b/drivers/clk/qcom/lpasscorecc-sc7180.c > @@ -356,6 +356,25 @@ static const struct qcom_cc_desc lpass_audio_hm_sc7180_desc = { > .num_gdscs = ARRAY_SIZE(lpass_audio_hm_sc7180_gdscs), > }; > > +static int lpass_core_cc_pm_clk_resume(struct device *dev) > +{ > + struct regmap *regmap = dev_get_drvdata(dev); > + unsigned int l_val; > + int ret; > + > + ret = pm_clk_resume(dev); > + if (ret) > + return ret; > + > + /* Read PLL_L_VAL */ > + regmap_read(regmap, 0x1004, &l_val); > + if (!l_val) > + clk_fabia_pll_configure(&lpass_lpaaudio_dig_pll, regmap, > + &lpass_lpaaudio_dig_pll_config); > + > + return 0; > +} > + > static int lpass_core_cc_sc7180_probe(struct platform_device *pdev) > { > const struct qcom_cc_desc *desc; > @@ -373,6 +392,8 @@ static int lpass_core_cc_sc7180_probe(struct platform_device *pdev) > if (IS_ERR(regmap)) > return PTR_ERR(regmap); > > + dev_set_drvdata(&pdev->dev, regmap); > + > /* > * Keep the CLK always-ON > * LPASS_AUDIO_CORE_SYSNOC_SWAY_CORE_CLK > @@ -449,7 +470,7 @@ static int lpass_core_sc7180_probe(struct platform_device *pdev) > } > > static const struct dev_pm_ops lpass_core_cc_pm_ops = { > - SET_RUNTIME_PM_OPS(pm_clk_suspend, pm_clk_resume, NULL) > + SET_RUNTIME_PM_OPS(pm_clk_suspend, lpass_core_cc_pm_clk_resume, NULL) There are two devices and "lpass_hm_core" and the PLL is not part of the HM_CORE, thus was the reason to separate out the pm_ops. > }; > > static struct platform_driver lpass_core_cc_sc7180_driver = { > -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation. --