Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp321968rwl; Wed, 9 Aug 2023 15:19:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFa8P0UQD4my9CKEwmw7blmkdpYftmEQCEmVMj1NOD2eL49NZUCrBgAYOGHbJurS28g2Viy X-Received: by 2002:a05:6a00:2d9d:b0:687:3bc2:58de with SMTP id fb29-20020a056a002d9d00b006873bc258demr594863pfb.6.1691619576745; Wed, 09 Aug 2023 15:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691619576; cv=none; d=google.com; s=arc-20160816; b=UeEpF2nZGoGvHY4WxlJx8bmi4L43bcPUf4vpq22z8XcmzAXpu7aBhGfFhzhC3A7t/g HbNLZti6RBvKH92u26cczUhE/wn3mMkZ/PIdJUw3xb0wO31DjVcfa7szbiG+FdjAO+Ax hQvM0mDrGOYE2FzLDDcW/rTro5buNz6Regv/KfIDCvAy4Y8432ivmrQRM451VciB2kCA Wev1ONK3ViJHOZjQW7MCPtMuzge2CE5TIP3PLZrfUMZJ/qMNwLf2RsrFrDSTkxcl/ZXO K8bQYzlVwUqqSQFZ1ZmateXi/1cd19Fr/kAWDN9GXMQy8n+m7yIRvr9MzVHAt6WHBBtg H/BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:date:to:cc:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:message-id :dkim-signature; bh=9gxcMPacVGodKGfPf7GVWXwyy92UZZwmIbtVakmVjyU=; fh=cDLyN2lu5+TB13FIExUBug676gup1gHPsPb976HKqjo=; b=V++iSDLRYm7lcakd8jpFQ2MH7YzhxKdEYx27ku+uajjfo9I4WcRhoot/6u5/G9hLY3 RJSeX9teIZJQ86MDLzOYmJ4VMwK75hn5bcODJhwLg4lN9YopaLLARCIhgX57eVjt5ciy 8S4699Go9egOXF5689ZaPD2o+2xr4oHyfkJ90ta+SSABO3gWBEjo9QyhdjTSQ1841bTN /QxIVUV5H/LBLlGVxeM2y7FIRTopyLsXyjjBCNTLNN5i9xfHCaMisrvo+KpNduUsmVbf PZ0XqgTVEh1BbaQIj+2kNYxu9N3fDogrllJY3k1QL/Ausu903gctGIRnAgG8ISQ5Q2ok pUKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cNf7z67O; 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 i189-20020a6387c6000000b0056467852fbesi153458pge.779.2023.08.09.15.19.25; Wed, 09 Aug 2023 15:19:36 -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=cNf7z67O; 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 S232117AbjHIVzo (ORCPT + 99 others); Wed, 9 Aug 2023 17:55:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbjHIVzo (ORCPT ); Wed, 9 Aug 2023 17:55:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A530A6; Wed, 9 Aug 2023 14:55:43 -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) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 30072611E6; Wed, 9 Aug 2023 21:55:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B4C7C433C7; Wed, 9 Aug 2023 21:55:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691618142; bh=GBr8tP2xiR6kjAiKJjegxph8j+qf/XK7FEXmUzHGfvw=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=cNf7z67Owtgupg9IttvWd1t/X9qF1l4mmgKeGs80EmheYnbCsDypIuDu+/DnNuqty Na93XYJKdBf21P3iZrhKeUwCmgYbeSTujeGxg5zL8ImEby++YRSud1bhw06ozyo4PD cffqsGTr86j+OM74cHhsE7xMFsjXxJz0en4E2AyYuncRb2dvCXL7d+t8RJCjTDKeZz 2iG5B+WpdmkHNLkVORs/VCg9y/42ynvS2csdXDKMIMY5SnQAq4QzpTF5ZXcMSjYfJT ihcq2nvjzDbP+YGCA7d6rRnfoyUeLRG8AHF9cWkq0dqtx2StELpz9LbyPwp7sZhZqK duFuLxyVUAxnQ== Message-ID: <0dde6d95f4e92da68ad3a3122056bfbd.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <1jpm3xoea9.fsf@starbuckisacylon.baylibre.com> References: <20230731042807.1322972-1-wenst@chromium.org> <1jpm3xoea9.fsf@starbuckisacylon.baylibre.com> Subject: Re: [PATCH] clk: meson: meson8b: Simplify notifier clock lookup From: Stephen Boyd Cc: linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org To: Chen-Yu Tsai , Jerome Brunet , Kevin Hilman , Martin Blumenstingl , Neil Armstrong Date: Wed, 09 Aug 2023 14:55:40 -0700 User-Agent: alot/0.10 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 Quoting Jerome Brunet (2023-08-08 06:21:46) >=20 > On Mon 31 Jul 2023 at 12:27, Chen-Yu Tsai wrote: > > @@ -3847,9 +3846,7 @@ static void __init meson8b_clkc_init_common(struc= t device_node *np, > > * tricky programming sequence will be handled by the forthcoming > > * coordinated clock rates mechanism once that feature is release= d. > > */ > > - notifier_clk_name =3D clk_hw_get_name(&meson8b_cpu_scale_out_sel.= hw); > > - notifier_clk =3D __clk_lookup(notifier_clk_name); > > - ret =3D clk_notifier_register(notifier_clk, &meson8b_cpu_nb_data.= nb); > > + ret =3D clk_notifier_register(meson8b_cpu_scale_out_sel.hw.clk, &= meson8b_cpu_nb_data.nb); >=20 > Hi Chen-Yu, >=20 > Your patch seems valid, as CCF stands right now. >=20 > However, I believe there is a will to drop the 'struct clk' instance that > automatically gets created with each 'struct clk_hw'. This change would > not help going in this direction >=20 Yes. Use clk_hw_get_clk() here, or introduce a clk_hw_notifier_register() API that does that automatically. We will have to put the clk on unregister path as well though, so maybe struct clk_notifier needs to be extended to store the clk_hw pointer. The notifier code kinda needs an overhaul to be clk_hw/clk_core aware. I think it predates the introduction of struct clk_core? It's a bunch of work I've been putting off.