Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp29099rwl; Wed, 9 Aug 2023 10:23:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IECXi6vBnKHjolM6GouJ/xaL0kuBWsF8qNaSzWk1+L6qL/N8tpChtyeFovAyusVI9T31gIO X-Received: by 2002:a2e:7c0e:0:b0:2b9:acad:b4ab with SMTP id x14-20020a2e7c0e000000b002b9acadb4abmr2411991ljc.28.1691601791773; Wed, 09 Aug 2023 10:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691601791; cv=none; d=google.com; s=arc-20160816; b=sbTWVtF6lQzT/xf/4gsCK7gh52cXyKLTmTbDI5rj2yA52jmltg97qTTZaGkw/7pgBR nZJLUB9D0pOluFZO1GBNiBT8GniVwiu81HKOkMWEhDT1i1ecMK5nOQ4A9qoGfKkM75cE 4l5N4/98ZyUhS8QxAIodaRfsYegvPcxdjjAecKzCkG257THrbqBeSycP+5V4JuqG0iwa stl4CbC9TRhDB/kE1a54Bz81qlx7Wmwvc0l/5iKxzmJLo5cF5jGF8TU9r40Z4/NFalxc 3uFgq/Tvf5fRxcWrtCxg5VLpZtcBPqhfKg5N0mxBwwu5FprpD7++o9F1XUs/TmEq2D66 Ynkg== 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=TQJEv5Vw7ZJZLzL74/YFszGSXRtz97IWL9b+9KOEYBk=; fh=v+HPW4LhurA7K8AwfnoVzcEu1+ACbNIbBa9Derz2DSA=; b=waEfu5sC+V5YxKXb8yGxhhOZP0vVCf0Ot3GvFj1/6q8KVW3uzBJp+QrzFD5YqCarsC 0CJ+rDLcbaytruX/VwJhq2tdpAyyPeKG5+DssDc9mkGGNvnpyjO5gNGm+xiqxKb6s9hb 5Fplz1+MlWWZqhWZYnb2Yg6ZCy6FwQ5lXdMj8LsUk5xM+0+e07ejSqwzhuwIPCGAsqLU Upx2WFerJvjoKnPLZr94QTFVFTBsLPrvyd1+6nYn+RJKQZaoQq8CldWAYLZ+PEKb3Xc9 FEzypuBwlUPM+vJ61OVfbEzRK9C+gU0/V6iQMxJWraz08bdeFI+6Q3dLmvJuvO52UvvA 0A9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZO9GM7kM; 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 c7-20020a17090603c700b0099bcd27b459si2406882eja.20.2023.08.09.10.22.47; Wed, 09 Aug 2023 10:23:11 -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=ZO9GM7kM; 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 S231368AbjHIQwg (ORCPT + 99 others); Wed, 9 Aug 2023 12:52:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231415AbjHIQwf (ORCPT ); Wed, 9 Aug 2023 12:52:35 -0400 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02F1B211F for ; Wed, 9 Aug 2023 09:52:23 -0700 (PDT) Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2b9b904bb04so481661fa.1 for ; Wed, 09 Aug 2023 09:52:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691599939; x=1692204739; 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=TQJEv5Vw7ZJZLzL74/YFszGSXRtz97IWL9b+9KOEYBk=; b=ZO9GM7kMXDoegIZvjBMStvrp6k0mAqPeeKnZVncyjI7+NV+JiqCs4v1oWOzjGWf5i3 jWjFOuQ9uQTMZCKyW4vhy1nIipCY47B5mMkYGIEbldjoVUEFPleKpQEuJK1DlGg2mA9G +oX5pZ4MY+Q7IwuV3YHqwG38AGslp4Xfs0rYVMITikLmthAjz+17AHdkyiYBk1F5Sr32 wnS9cOcy0IRxja9nUUeFC31S9eb800X6nntcGCReQQS27uzpd+Mjk9s/e56lWTsfp3nL QSX/GXd7MrzDvYzDji+t/p/ChlJy04GchzD9M3hRWqz8DmP8+kgqElQYr1Smv8rEQ/aB Uksw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691599939; x=1692204739; 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=TQJEv5Vw7ZJZLzL74/YFszGSXRtz97IWL9b+9KOEYBk=; b=YH97n3QZDK01TAquEVlja/HdilgP7plUuuLf1+i9Mp7/HE76qDyKsJXkmE17NveQ0C e8Lf01l6Y+sA0V+dnfUTG1YarzmUSnhQRx0obuVZ41cObQJmJYTqylYdKcLomWWWbJB/ Wb9cjOi3mQ2VvT2E9v5m0zqRulI4E8DT0CBqJ/xYcdXg/I29a6fFqRT/AhqIUP89kwyP O3uacPKh4cLzj1yUolJuzyPK5lb6FPXPZfK7HZzvV9Sn8poPwNcW5PCQuPklmMvjCYNl xPgISIEBef+Z+ZGy/ja1uZitEQOns3eMNfMjEaFAv50YQ4GiXDR0HWkgwqmzDYulCYVa kfBg== X-Gm-Message-State: AOJu0YxgiWV7bVoDkUTT9NM02VgxI1eCEgEK3VP6vxRh7mtICYea8QUV elRUeeLOyxHKP39GVRVnC0rgSw== X-Received: by 2002:a2e:b0fc:0:b0:2b9:ee3e:240c with SMTP id h28-20020a2eb0fc000000b002b9ee3e240cmr2392361ljl.24.1691599939431; Wed, 09 Aug 2023 09:52:19 -0700 (PDT) Received: from [192.168.1.101] (abxi185.neoplus.adsl.tpnet.pl. [83.9.2.185]) by smtp.gmail.com with ESMTPSA id x10-20020a2e880a000000b002b9f03729e2sm2787141ljh.36.2023.08.09.09.52.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Aug 2023 09:52:18 -0700 (PDT) Message-ID: Date: Wed, 9 Aug 2023 18:52:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 03/15] clk: qcom: gcc-sm6375: Unregister critical clocks Content-Language: en-US To: Johan Hovold , Bjorn Andersson Cc: Andy Gross , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marijn Suijten , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20230717-topic-branch_aon_cleanup-v1-0-27784d27a4f4@linaro.org> <20230717-topic-branch_aon_cleanup-v1-3-27784d27a4f4@linaro.org> <33a26241-026a-9466-5dd6-e3202b29f57c@linaro.org> From: Konrad Dybcio Autocrypt: addr=konrad.dybcio@linaro.org; keydata= xsFNBF9ALYUBEADWAhxdTBWrwAgDQQzc1O/bJ5O7b6cXYxwbBd9xKP7MICh5YA0DcCjJSOum BB/OmIWU6X+LZW6P88ZmHe+KeyABL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Jmo+jTeb4JBgIbFPJCFyng4HwbniWgQJZ1WqaUC nas9J77uICis2WH7N8Bs9jy0wQYezNzqS+FxoNXmDQg2jetX8en4bO2Di7Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: 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_BLOCKED, 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 19.07.2023 10:43, Johan Hovold wrote: > On Tue, Jul 18, 2023 at 09:23:52AM -0700, Bjorn Andersson wrote: >> On Tue, Jul 18, 2023 at 03:26:51PM +0200, Konrad Dybcio wrote: >>> On 18.07.2023 15:20, Johan Hovold wrote: >>>> On Mon, Jul 17, 2023 at 05:19:10PM +0200, Konrad Dybcio wrote: >>>>> Some clocks need to be always-on, but we don't really do anything >>>>> with them, other than calling enable() once and telling Linux they're >>>>> enabled. >>>>> >>>>> Unregister them to save a couple of bytes and, perhaps more >>>>> importantly, allow for runtime suspend of the clock controller device, >>>>> as CLK_IS_CRITICAL prevents the latter. >>>> >>>> But this doesn't sound right. How can you disable a controller which >>>> still has clocks enabled? >>>> >>>> Shouldn't instead these clocks be modelled properly so that they are >>>> only enabled when actually needed? >>> Hm.. We do have clk_branch2_aon_ops, but something still needs to >>> toggle these clocks. >>> >> >> Before we started replacing these clocks with static votes, I handled >> exactly this problem in the turingcc-qcs404 driver by registering the >> ahb clock with a pm_clk_add(). The clock framework will then >> automagically keep the clock enabled around operations, but it will also >> keep the runtime state active as long as the clock is prepared. >> >> As mentioned in an earlier reply today, there's no similarity to this in >> the reset or gdsc code, so we'd need to add that in order to rely on >> such mechanism. > > This reminds me of: > > 4cc47e8add63 ("clk: qcom: gdsc: Remove direct runtime PM calls") > > which recently removed a broken attempt to implement this for gdscs. > > Just stumbled over GENPD_FLAG_PM_CLK which may provide a way forward at > least for genpd (but see below). > >>> I *think* we could leave a permanent vote in probe() without breaking >>> runtime pm! I'll give it a spin bit later.. >>> >> >> Modelling the AHB clock in DT and putting a devm_clk_get_enabled() would >> properly connect the two, and thereby handle probe order between the two >> clock controllers. > > Yeah, this dependency really should be described eventually. > >> But it would prevent the power-domain of the parent provider to ever >> suspending. Using pm_clk_add() this would at least depend on client >> votes. > > IIUC using pm_clk_add() would also prevent the parent from suspending > due to that resume call in clk_prepare(). > > And this mechanism is also used for GENPD_FLAG_PM_CLK... So.. how do we go about solving the issue that this patch tried to address? Konrad