Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp324873rwl; Wed, 9 Aug 2023 15:22:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfabzNCaar0VRCQ758dq9bdqudx1AxOFS9R35Zx9ihKS8tKxX76fer96xlRSLbc0sykVrJ X-Received: by 2002:a17:902:cecf:b0:1bb:35b6:448f with SMTP id d15-20020a170902cecf00b001bb35b6448fmr557223plg.15.1691619777611; Wed, 09 Aug 2023 15:22:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691619777; cv=none; d=google.com; s=arc-20160816; b=ewrDLgPvOeNDhwufmyGMy7U3yrsrQqIwzvY5rq0+7LeKL2Snh/ZaXt3TCOQvq4vWDz 4j74ioD/eEAtKiFa/DpDfxR5pgDjAbNcU4CKgZatCtUHPZoRIK+qV6BTUK9CMrJZ2tcy aaFdYFNmNY7X8lAIrH7I3GdNslIFQrqTxqkahlAvkijQ+fe0gyT+/S885P87Zc+n1974 0hN3IVIsd8JD1a5zpT7nGsz6O9rlWtmM8bDD8TpPK3U0M1spxeHO1yatnieSM4PbkXAl B26ad4PIGaBBuuvd9Gqi+SnRThFpzAb+xp+6nVk0rwHj2EpKHo8aIP78PsTyRm1B3W2f +3Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=D6FUj+LMASIvlFO7A003cQAN8uYMLoKNwmsed17sZzg=; fh=TMdiRWNTAv+Ks6LHlo+GMibkk5gUX1xCmhBdbL5qdlw=; b=oE4+Zp4M5rdRL4OE5XioUeYfLXkKwkc8ZdF5W7iNMO2u9R4mT52rK75Vt17qjEB/Rf msezyuIP0tH8KkpZa4OlvDLZf2rRkRQiJVfttdgMy5+PZaHCHWKnZK9xPGtwsTk5lVCj 3b+3iUS37KvVkAMKLPSHAy0NFvkt5RM9zOd2S+iLvzURs7i50YJb6WcdsNLPJEc/qhp8 k1FjLl37+vh4WrzP5WRsLmgkXNDCg2aDAieTSh7oHd0z6/l9GAFt0DsnO/H4QEgDZLqa 1NVKd6K3jk57EU7jmWl8YDvnRuKVIhbb+zfUFXAnLfcbaaDgC1rMn7H2gKCfiXKw5+9k OM4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Tq/MHFiR"; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p1-20020a170902e74100b001bbad3b063bsi83622plf.345.2023.08.09.15.22.45; Wed, 09 Aug 2023 15:22:57 -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=@linaro.org header.s=google header.b="Tq/MHFiR"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231947AbjHIT7r (ORCPT + 99 others); Wed, 9 Aug 2023 15:59:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjHIT7q (ORCPT ); Wed, 9 Aug 2023 15:59:46 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56CC91FFA for ; Wed, 9 Aug 2023 12:59:45 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2b9aa1d3029so3220711fa.2 for ; Wed, 09 Aug 2023 12:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691611183; x=1692215983; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=D6FUj+LMASIvlFO7A003cQAN8uYMLoKNwmsed17sZzg=; b=Tq/MHFiRhJZQRaeiJQqB5B+MpW/wj6kc3gjJp10frqpYR/4fQGvIs4j9PctmP9nEX7 oe4//9aFHy2G0zWom+IBuuqlhRScgDim9c+em9KIkjAywooWmatBb4/C2ID+LAfD+w4H vLDzJLCih3Mvz6rjKhOADrkf63tuBy918c764R8W+l5gHG0UCKPA1jwfJo5/dsiA1kAQ xdoOXHC1fMwcUsy7SHJqNOkRGNUotwcFK3QUOIrb4EG1r80NZnRbn+Eyehsy+m3IDVWM uCMCjq6a7WtBXmEVqyp8RTlfrq9/W9teOakZUbHrAJq2DowXRQLDWVgZbAqu4xvxsnim SwtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691611183; x=1692215983; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=D6FUj+LMASIvlFO7A003cQAN8uYMLoKNwmsed17sZzg=; b=ViTz21M8ThcpAvAwGQWQ7Vhw2w8JV6DhIEjmKz0TfCBBxsJCYgg9XeuHtlDwEhyxD6 ptJABJmRkUGAR58uBkn/0+qdUnb5cQ5+PvZina5KrF+yqpTdlW4g5M1Z5inmmFZ793iy 5u1dfhKI6ZtTT3cEVqpyH3/U7nGmXT+nm1/4GT3bcFk7ICIfyuH/4+0MtRl5fHqCRmip bW/7B+gXd/9GfBOxQBfG1OOy3BL9R87mwphmU1ylH5e0KkOe+WL7DQV19yxRKOYtxtrN plnFe8nI3WskoSsJT3IUvDSgU+yeUDPbAvnJeU9Wk1WPmy+5TVagfy31EzDqVUPxXtyO bENw== X-Gm-Message-State: AOJu0YxRbQHa9LX7y8rFsN/GBvxdMa5DcxIyEGkxAeAeOPfhAVWG+Dbl zrx73ZG9rrvperJ3zF9Mmr+gPw== X-Received: by 2002:a05:651c:1053:b0:2b9:b693:c906 with SMTP id x19-20020a05651c105300b002b9b693c906mr162862ljm.27.1691611183479; Wed, 09 Aug 2023 12:59:43 -0700 (PDT) Received: from [192.168.1.101] (abxi185.neoplus.adsl.tpnet.pl. [83.9.2.185]) by smtp.gmail.com with ESMTPSA id c19-20020a05651c015300b002b9358f5088sm2876186ljd.53.2023.08.09.12.59.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Aug 2023 12:59:43 -0700 (PDT) Message-ID: <1e8fb9ba-9b18-487d-aa2e-4b246ae5b352@linaro.org> Date: Wed, 9 Aug 2023 21:59:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/4] clk: qcom: branch: Add mem ops support for branch2 clocks Content-Language: en-US To: Imran Shaik , Andy Gross , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson Cc: Taniya Das , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Ajit Pandey , Jagadeesh Kona References: <20230808051407.647395-1-quic_imrashai@quicinc.com> <20230808051407.647395-3-quic_imrashai@quicinc.com> From: Konrad Dybcio Autocrypt: addr=konrad.dybcio@linaro.org; keydata= xsFNBF9ALYUBEADWAhxdTBWrwAgDQQzc1O/bJ5O7b6cXYxwbBd9xKP7MICh5YA0DcCjJSOum BB/OmIWU6X+LZW6P88ZmHe+KeyABLMP5s1tJNK1j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gIbFPJCFyng4HwbniWgQJZ1WqaUC nas9J77uICis2WH7N8Bs9jy0wQYezNzqS+FxoNXmDQg2jetX8en4bO2Di7Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: <20230808051407.647395-3-quic_imrashai@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org On 8.08.2023 07:14, Imran Shaik wrote: > From: Taniya Das > > Clock CBCRs with memories need an update for memory before enable/disable > of the clock. Add support for the mem ops to handle this sequence. > > Signed-off-by: Taniya Das > Signed-off-by: Imran Shaik > --- > drivers/clk/qcom/clk-branch.c | 38 +++++++++++++++++++++++++++++++++++ > drivers/clk/qcom/clk-branch.h | 4 ++++ > 2 files changed, 42 insertions(+) > > diff --git a/drivers/clk/qcom/clk-branch.c b/drivers/clk/qcom/clk-branch.c > index fc4735f74f0f..95ffcd380039 100644 > --- a/drivers/clk/qcom/clk-branch.c > +++ b/drivers/clk/qcom/clk-branch.c > @@ -1,6 +1,7 @@ > // SPDX-License-Identifier: GPL-2.0 > /* > * Copyright (c) 2013, The Linux Foundation. All rights reserved. > + * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. > */ > > #include > @@ -134,6 +135,43 @@ static void clk_branch2_disable(struct clk_hw *hw) > clk_branch_toggle(hw, false, clk_branch2_check_halt); > } > > +static int clk_branch2_mem_enable(struct clk_hw *hw) > +{ > + struct clk_branch *br = to_clk_branch(hw); > + u32 val; > + int count = 200; > + > + regmap_update_bits(br->clkr.regmap, br->mem_enable_reg, > + br->mem_enable_ack_bit, br->mem_enable_ack_bit); > + > + regmap_read(br->clkr.regmap, br->mem_ack_reg, &val); > + > + while (count-- > 0) { > + if (val & br->mem_enable_ack_bit) One more comment, since the variable is named "ack bit", perhaps the value within could be a bit number and you could use BIT() here. Otherwise with you having chosen u8 for the type, there's not a whole lot of flexibility. Konrad