Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp626598rdg; Thu, 12 Oct 2023 16:31:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFNyJHPnl+lYJUbMT0+6/4CNpsyQqOnq465Es/k/t4RTG90dTw6C1tGzbEp6DDUKfWWpQ4L X-Received: by 2002:a05:6a20:8e0e:b0:16b:bd0f:ad0d with SMTP id y14-20020a056a208e0e00b0016bbd0fad0dmr23926076pzj.28.1697153462485; Thu, 12 Oct 2023 16:31:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697153462; cv=none; d=google.com; s=arc-20160816; b=owN7IgSo5qm5M7H/MAhe/oLXfDl60aYhBqqFjU3Wp/tDUYYyOJAUvO6mak1kK30PH/ LhrmS2tPJyBqw1TGzXjf6Ekz3QTkBiuk/FWbYbkEZu46+K3cmuU7UNf+gXZDsHMlvY/d O14eG/EZoh806LiCO3UVtWZEajG7Xp7b0USxq4rZd8+wagE9b+gtpjb0lN8ZYAvSGm02 zYYKRegG0haDtcWRKzulcorpjQV0902tc0HoWLD0UnXO5rOjIeAGEx9Uq56q1H00vy0a /oEpNeoZbNQuCZyd7ePrXs9BPbG/knHtqgGok2pd1nTTpd/tMwJMKXnkSZWrNmCn1V8u Y+9w== 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=3ufVuvkQ/gG5R94tLdvuv97BVye1qn+V9K5Gic/Bk7Y=; fh=LExgiPWHsfcfImddVNdCGE2Zz6Ch1FJYvJxXKf6chbc=; b=g5afAWb9nw/6N2/+IPDOPeZOcOlQnVLit2+wvitT6sHBx8CHrS9BrUTb3azd8dEqAy UrMZ5Te9CiiFPOybQJHKmVIVR1JjLZuYYIz4n2muECIz2gGKqiMnDgNwZ/iiYq6pZR3E 8jCGHCrYQNZaSoUxzF57Rmff4Pr3fEc1Lo+AWl3rGwSJgFG1e3J+wCLvoAvn0FjJiaI5 qJzZfIXZaQ11kt8ZrKLZ2BWorOSxNv50MtHyUCX59E1KNygPwX7S2FRgNDjB2X4CuuXa Yzy1kPBHp4nvkP3J097UhyVClMFEaY4kduPe32+NdlKkfrv+siJqeUjEq7Ho5oFQW6qg MkDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FbEckeNT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id t6-20020a17090a510600b0027677087be2si3286830pjh.108.2023.10.12.16.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 16:31:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FbEckeNT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 023728079312; Thu, 12 Oct 2023 16:30:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443100AbjJLXaI (ORCPT + 99 others); Thu, 12 Oct 2023 19:30:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443083AbjJLXaG (ORCPT ); Thu, 12 Oct 2023 19:30:06 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 856C2A9; Thu, 12 Oct 2023 16:30:05 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 207B5C433C8; Thu, 12 Oct 2023 23:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697153405; bh=y/FkUr/MyNlRX1DbU8ygsuC1i4kJtlBIup5GFvsNN7o=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=FbEckeNT8863IDZcMhJEvoKu4qKnHW9uHgJgKAsxiaDLTh1rJGi6NZkaLacieVXSs vM6bgM0ct4LBwaCiKEIdJZ4m7lVM5iUqFQ15/cGEtblSA3fPAvQDEl+smVp4mxaRqO rQlzaxVszZQYWQ6gw4wvXbGz29Tr0ZNSUDseyQii4UHwUj01uE525Gjp+bzTjV/HoP yb+5UqFcw7ojUGr/fKRjeKV5y4OMOiLtdp+c9Af+XLsEylOOrjCaPBXguo8f0wfC+w 8igvMVRLD+j4BH/GB/lOBgzoKMVT/bzzFGL64QCkKeFuRMoUzMBzpgADHmWJak070k SvltBycBwV1+g== Message-ID: <4be60c499a39fcca374bc8f8574a952e.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20231003120402.4186270-1-niravkumar.l.rabara@intel.com> References: <20231003120402.4186270-1-niravkumar.l.rabara@intel.com> Subject: Re: [PATCH v3] clk: socfpga: agilex: add support for the Intel Agilex5 From: Stephen Boyd Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, netdev@vger.kernel.org, Niravkumar L Rabara , Teh Wen Ping To: Dinh Nguyen , Michael Turquette , niravkumar.l.rabara@intel.com Date: Thu, 12 Oct 2023 16:30:02 -0700 User-Agent: alot/0.10 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 12 Oct 2023 16:30:20 -0700 (PDT) Quoting niravkumar.l.rabara@intel.com (2023-10-03 05:04:02) > From: Niravkumar L Rabara >=20 > Add support for Intel's SoCFPGA Agilex5 platform. The clock manager > driver for the Agilex5 is very similar to the Agilex platform, so > it is reusing most of the Agilex clock driver code. >=20 > Signed-off-by: Teh Wen Ping > Reviewed-by: Dinh Nguyen > Signed-off-by: Niravkumar L Rabara > --- >=20 > Changes in v3: > - Used different name for stratix10_clock_data pointer. > - Used a single function call, devm_platform_ioremap_resource(). > - Used only .name in clk_parent_data. >=20 > Stephen suggested to use .fw_name or .index, But since the changes are on= top > of existing driver and current driver code is not using clk_hw and removi= ng > .name and using .fw_name and/or .index resulting in parent clock_rate & > recalc_rate to 0. >=20 > In order to use .index, I would need to refactor the common code that is = shared > by a few Intel SoCFPGA platforms (S10, Agilex and N5x). So, if using .nam= e for > this patch is acceptable then I will upgrade clk-agilex.c in future submi= ssion. It is not acceptable. We don't want there to only be a name member set in a clk_parent_data structure. In fact, this driver is simply wrong because it has many clk_parent_data structures with .fw_name =3D=3D .name and I don't see any 'clock-names' property in the DT bindings. The driver looks like it should simply use clk_hw pointers directly and stop using clk_parent_data structures entirely. > diff --git a/drivers/clk/socfpga/clk-agilex.c b/drivers/clk/socfpga/clk-a= gilex.c > index 6b65a74aefa6..38ea7e7f600b 100644 > --- a/drivers/clk/socfpga/clk-agilex.c > +++ b/drivers/clk/socfpga/clk-agilex.c > @@ -1,6 +1,6 @@ > // SPDX-License-Identifier: GPL-2.0 > /* > - * Copyright (C) 2019, Intel Corporation > + * Copyright (C) 2019-2023, Intel Corporation > */ > #include > #include > @@ -8,6 +8,7 @@ > #include > =20 > #include > +#include > =20 > #include "stratix10-clk.h" > =20 > @@ -40,6 +41,44 @@ static const struct clk_parent_data mpu_free_mux[] =3D= { > .name =3D "f2s-free-clk", }, > }; > =20 > +static const struct clk_parent_data core0_free_mux[] =3D { > + { .name =3D "main_pll_c1" }, This is equivalent to the above. { .name =3D "main_pll_c1", .index =3D 0 }, and thus the index will be used. Luckily there's no clocks property in DT? But it also means that you're trying to lookup a clk from DT and falling back to the name field eventually, i.e. we're wasting time during parent discovery. > + { .name =3D "peri_pll_c0" }, > + { .name =3D "osc1" }, > + { .name =3D "cb-intosc-hs-div2-clk" }, > + { .name =3D "f2s-free-clk" }, > +}; > +