Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7082030rwp; Tue, 18 Jul 2023 09:45:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlFaAkMpE2Bd6N0N5dm6wJtyRGhA7E9uyWPs5F6ySt0ZkQG/Bd0ei7oW23MNihtRd82BzOhb X-Received: by 2002:a05:6402:5202:b0:51e:5390:9166 with SMTP id s2-20020a056402520200b0051e53909166mr324939edd.2.1689698735576; Tue, 18 Jul 2023 09:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689698735; cv=none; d=google.com; s=arc-20160816; b=Y/xBbmvQNQUHylqCE/lxRolEWLk8JCI/LIhO+6I2bQQtxFhUDksOzESTxFpf4ybj96 T1epXKpHaI7VcGZQ/zutYpm2uQbXBBRq9IbN9DezAfMyvhLsVYklp1W1r/dPiVHr57GA kPhTmhAKMkqqSP/xfWs05YxAKN1o6L1gcmtqUKyMCv1BJ/PLZQnX5dpqfmQNilo+lL1m gUOS9t3Tnths4js1rDgZTxyLHbgwlVdbtmg4WR8V6cYopUiuD5ziPEaMlyjvQX02Hnm5 FcKumTjzu4qK3V19jDJPByWjdEAr57MKOGoQXloszH4sC2xQPLlTnhPnQ16bG8I6NZ3w pcug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=uOEEMJkKwIk+3dNENQklwfMjdaTQrw52dr57rxCxXNk=; fh=1lqu+xf3Vp9yu8x8VdChAV8IV1eZZGb02SRdR3Ts7wE=; b=OMKAIhFZlXiDdYncjIWczwrX6KWj5Y49ss+uXJzCRCJPre9KadXTZO/lzqlnAqX7fT +/GeDnlS3WtdFz+/0GeOFWCGrSO+Bo59Di8PSqx1j3vxZbP7usj/0fcxO2xsnhRY5Miq y2NIbzA2h3V/p9f80rX/++BGHw+tBpuFaN6NHmqBirVqaAvGhjC3KSJMBiAqB2oFZOby +A413h183Vpip3XdZ0roHOFRLioiEl+1q55B2gtN0HmXZ0vcvJJJpPjg+YWZEPpIDCUu 5kCpUQFAu9l2yf3vapX7/nbHy5qAXuFfic8bsQEpEqu5HaR32TD3FdClZFwj/6sb+cFj B99Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XOPUAa+e; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w20-20020aa7da54000000b0051e19aae8d1si1510678eds.378.2023.07.18.09.45.12; Tue, 18 Jul 2023 09:45:35 -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=@kernel.org header.s=k20201202 header.b=XOPUAa+e; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232177AbjGRQUc (ORCPT + 99 others); Tue, 18 Jul 2023 12:20:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbjGRQUb (ORCPT ); Tue, 18 Jul 2023 12:20:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FB73E0; Tue, 18 Jul 2023 09:20:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2CAFB615E4; Tue, 18 Jul 2023 16:20:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A43C6C433C8; Tue, 18 Jul 2023 16:20:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689697228; bh=c2kq9yglTyBKkN+7oETy1EDzjSuSLPZJWdny+o8VQ/o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XOPUAa+eM/tTEsH8tdvIg98C482Th52LWsYb76BnmMIgZuSXapxbuprHsiEa/rryS AhwTyreo6R6Xk556bDH47DjRdm8aj1UQ0D+hbnC+klT5lbWSIbXnUADzWuFKpf57LE xvd1P1URcwAHdRt6A58V4LgmREB0wM98hjoGwpayBqihkWyjMtxjEPW70DypGJ1tmZ qAGDkbOl1kbTx5hqWp0y1a26P09uBi5b4o8VdqYb5jb8JTz0tjeXrXbFsC7lyzYRQC 7C9LubKovEEw5jM96iJrP9Jg+IW0su5Uoj4vhppFVhdYJyoBe2mTEwOTYCAj5NB6am 0Z+rN207FLhvQ== Date: Tue, 18 Jul 2023 09:23:52 -0700 From: Bjorn Andersson To: Konrad Dybcio Cc: Johan Hovold , 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 Subject: Re: [PATCH 03/15] clk: qcom: gcc-sm6375: Unregister critical clocks Message-ID: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33a26241-026a-9466-5dd6-e3202b29f57c@linaro.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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: X-Mailing-List: linux-kernel@vger.kernel.org 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. > 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. 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. Regards, Bjorn