Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp320808lqt; Thu, 6 Jun 2024 04:56:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVUghOiAMBgDrJmuVOpqDoGsF6+vsPXBWsZtoi7DB3np54D5X1c6VZVhlUf52UMap7bidfKBGT2kvAtP4gR6UeE5bElctflvF+xXrrQoQ== X-Google-Smtp-Source: AGHT+IETnDJz0gGHoAyQkwb0zVupBUfW+9PnKqrhfO49+6PKxwpEEWudgrP+aPDMgrpe2UAq7JfB X-Received: by 2002:a17:906:2bd4:b0:a6c:7486:8e82 with SMTP id a640c23a62f3a-a6c74869138mr165680666b.15.1717674999180; Thu, 06 Jun 2024 04:56:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717674999; cv=pass; d=google.com; s=arc-20160816; b=N5wROozqtbae6dD+AhJit2rZys7+LugJVOiBz2W4VQjJgnt8+MlKSlcHecTTvwSYV1 IdNZjz09BhW9R6dFqWVifDpajbfw3tXfNR9Jo9B2GxMoQ7odhrjRdEAX7oHyxtLiDoSW o57c2X1hFqpeT5vRv/yPCtT3VlemVzXoNK2BIQJtY0zsQAyIIPRXTxCoVjnzq38WE/VX KHmf/Mz5VRI9b0KCv9z71TEeLLJEH0GzsAnJOqfWKXU9dscIWs1kr2zY0nsDaWnRu2Zm c2wiK4sJcSEUxBkA4Pa7pz68dUjmYvzs7xFIT9xdFvM3HMFyFCVjEtCs2ybA1dPxLIHl l/tA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=qigu9PmFJTxWiF2SHmyTiEeuSsK0KUDZ4LsRQKX0REc=; fh=R85Y8OfTgkXAd7uZ3hxI2d563GNBqrQvkx0eVZAnAkk=; b=YzgqMfM5+HEpt+BlMt5n6R3fXABW30nBsFmxh6KO2M746yLQBjUGEeuSbVL+yv51LJ LnbhDtonhN0p1zVZ0Qr72R7GkNmFWFf7BB+yzTEdkVx+1+nuKuBg0KhuB8/YtBS7xiCH G7q+79H8RpK1y8kskqNU6R4aczaGNygyaOOAoOhJztNfyGtcMPU3zJiT2WmGNKrIe0FY w2F/ltS7kQXZ8Bz/QH10zJ0WfAosii6VZP/D1SZ73e0Nyf64vJO8XBPWmQ3o7iIh7NXf vWom+jksN5xi04zrrW1TGDd9t9nHpSfXHXOM58ryjzOF8Oh+2dboBQTCFHj/1U/8Vi50 yC3g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WCzgZrWv; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204210-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204210-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c806dc04csi60670166b.461.2024.06.06.04.56.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 04:56:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204210-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WCzgZrWv; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204210-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204210-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B69151F27344 for ; Thu, 6 Jun 2024 11:56:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0CB6419596A; Thu, 6 Jun 2024 11:56:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="WCzgZrWv" Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 680C213AD25 for ; Thu, 6 Jun 2024 11:56:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717674992; cv=none; b=VIj3TOuKCrktiFYW4jk2NQsj4VT+i3khRjNI9RklOU/af4bLcEzm/RtoBOyLDx+8hBZDF3L94dh3i9HnzSLcHPLDluT5ezINs1epUegvqANgaK1hL+Bg+l8+AFI51Fg2L8QRHjB/QCyi50HNomrvryV55hs1c9rD3OkiZ1VYBQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717674992; c=relaxed/simple; bh=0mrz4Ql+/szyW/Tn0jSJew7WyN8DrpJkwgiX14efqeA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=R45ByQxLz7ikGtJ5XF8r+DEoZj5lw4JIH/zfVj1ACi6TtJZK2GSuG5PUiidzz+1M1JymOx4pSvmG72slEPXO7elB00w+fEV2KSoSVlYwoZprE1PF+LBcb/nE/tuenhszTpoE0datAY93GE+KhQFJ85lrMzQ91ut0vM2CXD3OAJU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=WCzgZrWv; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a683868f463so93270666b.0 for ; Thu, 06 Jun 2024 04:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717674989; x=1718279789; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=qigu9PmFJTxWiF2SHmyTiEeuSsK0KUDZ4LsRQKX0REc=; b=WCzgZrWvQXmCBE/q2ufc/dn/y6eLZRGNrnn18LCAJSjOUjaonjUN53gLqqR8LRdBgu XrS94bM1elWGw461Vpc5IRmk4kHxMgEfcIjpeLJZ2M2bppCeVCo0MbiVPh2Ig/ImqnpR sG1EEAriXMWSgSO18ZL/sJw0maLPDr8gKi0uCcr10+sZJCLGsxQVl8/QpFD40JggeTur kUu+rLNJtzXecHvjLPKIlfxVbx4cJWIaPSX2tYuAwp+4z9Wpb5B7QMw+Akoj7h7/beAl M4ff2OkE7+v52q4o6WY3jPjGHqqxmDYn+b9QTEH7h5ISGf2UixRbLm00ePcspqX1bmY9 cBhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717674989; x=1718279789; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qigu9PmFJTxWiF2SHmyTiEeuSsK0KUDZ4LsRQKX0REc=; b=nIpqtwVwYpFw5O5qXyEcNBUu1+ELzZMHHYPP8iC25Np0CIGdoMuIKMwo6gDTgVAccS OM+cGaFIqNtCrfTupIltHW8BDkSw4GqjBMn8G3kEtTQwYyiYV/PjDZAgRceLlsc+VMOB xkvaaF8d74FpFr18LLXy/xqJeZgcjyJ7sDAhUKAOqeo/VAq6Ln0cnydJo6oXhXH+AZth ZRcnQXK0zt+4jhG7Djug+cwDDw1rhvHRxv35Jtr3exYg2LeMZNvX1eIHR75GKZ7xZQk/ LpUKX6Dh/nPkS3/zDrR4GKl9KCWWqDH948Pbqle4RGVztzShDPcl99Qy81rWjYi7pwCc o9yg== X-Forwarded-Encrypted: i=1; AJvYcCVcnTFWYmTOR69enJIdJpfSxinEPORm/QpsU1AnfpMCNIyTckaPeHjm/oNET05SPhop5xaCHg3DC+nt660TR0XLEC/ErjynRR6v+/TY X-Gm-Message-State: AOJu0Yz/seNGhUQpEsWsw1Jvi/NviJu30fy7/AC+br+cEhV9b0QnVsZx nJuJDiB3v/Nqyn6LLmsRGlaiTmdBIslYoCbzB5AHKcR3LeNcG67H/Ac9Grut9dg= X-Received: by 2002:a17:907:cb21:b0:a62:c2a5:cff5 with SMTP id a640c23a62f3a-a69a002e7d1mr313879066b.56.1717674988815; Thu, 06 Jun 2024 04:56:28 -0700 (PDT) Received: from [192.168.128.139] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c806eb018sm87811066b.127.2024.06.06.04.56.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Jun 2024 04:56:27 -0700 (PDT) Message-ID: <93eb11e7-21d7-4d3b-b033-b66898ea7874@linaro.org> Date: Thu, 6 Jun 2024 13:56:25 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] clk: qcom: gcc-sm8450: set OPS_PARENT_ENABLE on gcc_sdcc2_apps_clk_src To: Stephen Boyd , Bjorn Andersson , Michael Turquette , Vinod Koul Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Baryshkov References: <20240427-topic-8450sdc2-v1-1-631cbb59e0e5@linaro.org> <2337ba58adb3fb127710bead9b8665a9.sboyd@kernel.org> <11bd7146-30cd-4b71-b2ca-d76875763731@linaro.org> <6ba2967c6c9d24e3f1c9b76496176010.sboyd@kernel.org> <3a3c4279-a254-48d0-91ad-70b7f1e3eb77@linaro.org> <7baef7a173dc4d1ecf8b0dafde565b1a.sboyd@kernel.org> <9440dd954294db7c02a11a1807d75ad9.sboyd@kernel.org> Content-Language: en-US From: Konrad Dybcio Autocrypt: addr=konrad.dybcio@linaro.org; keydata= xsFNBF9ALYUBEADWAhxdTBWrwAgDQQzc1O/bJ5O7b6cXYxwbBd9xKP7MICh5YA0DcCjJSOum BB/OmIWU6X+LZW6P88ZmHe+KeyABLMP5s1tJNK1j4ntT7mECcWZDzafPWF4F6m4WJOG27kTJ HGWdmtO+RvadOVi6CoUDqALsmfS3MUG5Pj2Ne9+0jRg4hEnB92AyF9rW2G3qisFcwPgvatt7 TXD5E38mLyOPOUyXNj9XpDbt1hNwKQfiidmPh5e7VNAWRnW1iCMMoKqzM1Anzq7e5Afyeifz zRcQPLaqrPjnKqZGL2BKQSZDh6NkI5ZLRhhHQf61fkWcUpTp1oDC6jWVfT7hwRVIQLrrNj9G MpPzrlN4YuAqKeIer1FMt8cq64ifgTzxHzXsMcUdclzq2LTk2RXaPl6Jg/IXWqUClJH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XgB+IW8ESflz6nDY3b5KQRF8Z6XLP0+IEdLOOARkOW7yEgorBgEEAZdVAQUBAQdAwmUx xrbSCx2ksDxz7rFFGX1KmTkdRtcgC6F3NfuNYkYDAQgHwsF2BBgBCAAgFiEEU24if9oCL2zd AAQVR4cBcg5dfFgFAmQ5bvICGwwACgkQR4cBcg5dfFju1Q//Xta1ShwL0MLSC1KL1lXGXeRM 8arzfyiB5wJ9tb9U/nZvhhdfilEDLe0jKJY0RJErbdRHsalwQCrtq/1ewQpMpsRxXzAjgfRN jc4tgxRWmI+aVTzSRpywNahzZBT695hMz81cVZJoZzaV0KaMTlSnBkrviPz1nIGHYCHJxF9r cIu0GSIyUjZ/7xslxdvjpLth16H27JCWDzDqIQMtg61063gNyEyWgt1qRSaK14JIH/DoYRfn jfFQSC8bffFjat7BQGFz4ZpRavkMUFuDirn5Tf28oc5ebe2cIHp4/kajTx/7JOxWZ80U70mA cBgEeYSrYYnX+UJsSxpzLc/0sT1eRJDEhI4XIQM4ClIzpsCIN5HnVF76UQXh3a9zpwh3dk8i bhN/URmCOTH+LHNJYN/MxY8wuukq877DWB7k86pBs5IDLAXmW8v3gIDWyIcgYqb2v8QO2Mqx YMqL7UZxVLul4/JbllsQB8F/fNI8AfttmAQL9cwo6C8yDTXKdho920W4WUR9k8NT/OBqWSyk bGqMHex48FVZhexNPYOd58EY9/7mL5u0sJmo+jTeb4JBgIbFPJCFyng4HwbniWgQJZ1WqaUC nas9J77uICis2WH7N8Bs9jy0wQYezNzqS+FxoNXmDQg2jetX8en4bO2Di7Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: <9440dd954294db7c02a11a1807d75ad9.sboyd@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 7.05.2024 11:52 PM, Stephen Boyd wrote: > Quoting Konrad Dybcio (2024-05-07 14:17:01) >> >> >> On 5/7/24 22:28, Stephen Boyd wrote: >>>> >>> >>> Can you share your patch that prints the message? What bit are you >>> checking in the hardware to determine if the RCG is enabled? Do you also >>> print the enable count in software? >> >> I already reset-ed the tree state, but I added something like >> >> if (rcg->cmd_rcgr == the one in the declaration) >> pr_err("gcc_sdcc2_apps_clk_src is %s\n", clk_is_enabled(hw) ? "ENABLED" : "DISABLED"); >> >> to drivers/clk/qcom/clk-rcg2.c : __clk_rcg2_set_rate() >> >> > > Ok. You're reading the software state because there isn't an is_enabled > clk_op for RCGs. Can you also read the CMD register (0x0 offset from > base) and check for CMD_ROOT_EN (bit 1) being set? That's what I mean > when I'm talking about the RCG being enabled in hardware. Similarly, > read CMD_ROOT_OFF (bit 31) to see if some child branch of the RCG is > enabled at this time. [ 3.998362] gcc_sdcc2_apps_clk_src is SW-DISABLED, CMD_ROOT_EN=0 CMD_ROOT_OFF=1 [ 3.999896] scsi host0: ufshcd [ 4.006712] ------------[ cut here ]------------ [ 4.013751] gcc_sdcc2_apps_clk_src: rcg didn't update its configuration. [...] [ 4.288626] gcc_sdcc2_apps_clk_src is SW-ENABLED, CMD_ROOT_EN=0 CMD_ROOT_OFF=0 Code: diff --git a/drivers/clk/qcom/clk-rcg2.c b/drivers/clk/qcom/clk-rcg2.c index 9b3aaa7f20ac..a24b8931d7a1 100644 --- a/drivers/clk/qcom/clk-rcg2.c +++ b/drivers/clk/qcom/clk-rcg2.c @@ -471,6 +471,12 @@ static int __clk_rcg2_set_rate(struct clk_hw *hw, unsigned long rate, struct clk_rcg2 *rcg = to_clk_rcg2(hw); const struct freq_tbl *f; + if (rcg->cmd_rcgr == 0x24014) + pr_err("gcc_sdcc2_apps_clk_src is SW-%s, CMD_ROOT_EN=%u CMD_ROOT_OFF=%u\n", + clk_hw_is_enabled(hw) ? "ENABLED" : "DISABLED", + regmap_test_bits(rcg->clkr.regmap, 0x24014 + CMD_REG, CMD_ROOT_EN), + regmap_test_bits(rcg->clkr.regmap, 0x24014 + CMD_REG, CMD_ROOT_OFF)); + switch (policy) { case FLOOR: f = qcom_find_freq_floor(rcg->freq_tbl, rate); Konrad