Message ID | 20230501152732.9245-1-quic_tdas@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp16791vqo; Mon, 1 May 2023 08:54:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6VytXU8ytYk4gN+NKglKIZfDTd9ODv5YCvkjaDCCk5WBietZuTwr/ew4egvE83n9HWMBd2 X-Received: by 2002:a05:6a00:1d23:b0:63b:8cdc:b38f with SMTP id a35-20020a056a001d2300b0063b8cdcb38fmr19854732pfx.5.1682956469633; Mon, 01 May 2023 08:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682956469; cv=none; d=google.com; s=arc-20160816; b=BLov6TNKiXsIr2qyIj8JnLYtxmXT93m3Y+QFndHMF0Ee4/3SLxxks61t1l2DIISuhF bV23WXZXDEdIv+bObPOqCQTbNvE4e0ICzdtgxoICpZV6LHVcJkltEFqgEepWMsRpB7ji 5ST65yOnf9ma349HiLkxvUzbXuObzEVkwA9kbBQsxolJmTbDaHoa70ZmNtKpiJz9eRqa PKzm8k9uJfDB8IJF7eO3sbhOHoT/lGcOxgqwOfYHJjIH2G8ZFpZFe6ZY2WQZuk3VEjjA 6CL/62u/koqTYJS8JGz1LkjXUlLLuyEDrS3EO/AOaUEg/Jh8ZSkdfBcajup7A8ii3e34 6pCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=WxVYXWAROQLyqngVyIjkA6PL1TyrGM+M/4XnTbSf9Js=; b=TqqUMFvy1/2k1Uhp9C26kK790D0+FOSCpi1R0g6rNqPCe362F4yPeJoZaxJt6s7O6B 3FjXnseCL317OEKkE5X+FdrnR6Sq4daijRpSgkZUVUDSWtdZBf/tCED2bL3mrG0zcu5v 2cyNDLm7ltsh1kPO42GLnjVdjh0Goh0yHonBf6VGHdxN/LbMR/FdRJIbUbtMpf45iA/i /YkpFU5VQOKcj9Iy7D+3lwpHcHgQCXUnyEiR1PSFNXTS/GwiZfByOEd1UbS5xeLhYRMt im1hVloPkD/migbpu9pAR4rHcQsoQv6t3JGh7J+wRn4JyfrANSw96gzywv57Bgf81qiA 86hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=NikjnHdx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x187-20020a6263c4000000b0063b8af69b09si27659895pfb.314.2023.05.01.08.54.04; Mon, 01 May 2023 08:54:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=NikjnHdx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232473AbjEAP20 (ORCPT <rfc822;rbbytesnap@gmail.com> + 99 others); Mon, 1 May 2023 11:28:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232193AbjEAP2X (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 1 May 2023 11:28:23 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 942ABAA; Mon, 1 May 2023 08:28:22 -0700 (PDT) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 341FSIYV003625; Mon, 1 May 2023 15:28:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=qcppdkim1; bh=WxVYXWAROQLyqngVyIjkA6PL1TyrGM+M/4XnTbSf9Js=; b=NikjnHdxgDowrfCxfzuCBzAH7GgfIfY3/8adlGc83PyI4gTVRvFgHP1zqg8uC9RkAk6L qEoKAsma4r1Uz8TKmqBbDr7DhcpSNBOafa4dBSuChGtW5KKWfdnULvwyG+sYrHz0MaxX Rgoz8+VG+S1pQ6ZMgbTno/dbX1HCYj39OfZ3/Sa9MnKNr+nRcTi8sg52S9zVvkneRgmq 3+gerSOuABk59pH/KH7GFsdj3fJSbeEtgRaQvRNtYau1t3Qns1t252B57kgpYYzmp6RC KDQO5gIGUyUS6uleS9KpSlECC9ZoIlniAQlZxlUyurL89yqsDhp0QpdoM3a5oOJBGQbw Ag== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3q8ub33vsr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 01 May 2023 15:28:18 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 341FSGhm001480 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 1 May 2023 15:28:16 GMT Received: from hu-tdas-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Mon, 1 May 2023 08:28:13 -0700 From: Taniya Das <quic_tdas@quicinc.com> To: Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Stephen Boyd <sboyd@kernel.org>, Michael Turquette <mturquette@baylibre.com> CC: Konrad Dybcio <konrad.dybcio@linaro.org>, <linux-arm-msm@vger.kernel.org>, <linux-clk@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <quic_skakitap@quicinc.com>, Taniya Das <quic_tdas@quicinc.com> Subject: [PATCH] clk: qcom: rcg: Update rcg configuration before enabling it Date: Mon, 1 May 2023 20:57:32 +0530 Message-ID: <20230501152732.9245-1-quic_tdas@quicinc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 8qeVBL17wU7HePPciFAE2GRzCOu06Gat X-Proofpoint-ORIG-GUID: 8qeVBL17wU7HePPciFAE2GRzCOu06Gat X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-01_08,2023-04-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 mlxscore=0 impostorscore=0 spamscore=0 mlxlogscore=803 lowpriorityscore=0 phishscore=0 adultscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305010125 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764707763109769706?= X-GMAIL-MSGID: =?utf-8?q?1764707763109769706?= |
Series |
clk: qcom: rcg: Update rcg configuration before enabling it
|
|
Commit Message
Taniya Das
May 1, 2023, 3:27 p.m. UTC
If rcg is in disabled state when clk_rcg2_shared_set_rate is called, the
new configuration is written to the configuration register but it won't be
effective in h/w yet because update bit won't be set if rcg is in disabled
state. Since the new configuration is not yet updated in h/w, dirty bit of
configuration register will be set in such case. Clear the dirty bit and
update the rcg to proper new configuration by setting the update bit before
enabling the rcg.
Signed-off-by: Taniya Das <quic_tdas@quicinc.com>
---
drivers/clk/qcom/clk-rcg2.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--
2.17.1
diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c index 76551534f10d..b36377979f21 100644 --- a/drivers/clk/qcom/clk-rcg2.c +++ b/drivers/clk/qcom/clk-rcg2.c @@ -980,7 +980,13 @@ static int clk_rcg2_set_force_enable(struct clk_hw *hw) { struct clk_rcg2 *rcg = to_clk_rcg2(hw); const char *name = clk_hw_get_name(hw); - int ret, count; + int ret, count, val; + + if (!__clk_is_enabled(hw->clk)) { + regmap_read(rcg->clkr.regmap, rcg->cmd_rcgr + CMD_REG, &val); + if (val & CMD_DIRTY_CFG) + update_config(rcg); + } ret = regmap_update_bits(rcg->clkr.regmap, rcg->cmd_rcgr + CMD_REG, CMD_ROOT_EN, CMD_ROOT_EN);