From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E4176445AE3 for ; Thu, 30 Jul 2026 17:38:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785433098; cv=none; b=Qmj/Qew76u0SIXJ0ixnyDgaDFiSOWUIxvsPsGI78ih0TrtCUwHVlVxwvDoHzJX+QckvsYzTxGpxUh3Ey2ROguUFkTD4GO+OPESGh1/rjJ/+SA8ZjVjnDhE/ORBH+chvyOvoNCexA6VqXqGDICClQ+keLYOZc3UupUoTsgVSYDlc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785433098; c=relaxed/simple; bh=tcCAaJdWJcVjCNXkGXLQhu11kXbWbdF1H1Q7waoPhQI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gRJDuIJT7u6YYPp7HJj4J1cXoeZxEHnruWPCNS/LtXXywjtBkvnYf0dv7LvuHQVG44Jvj0SKB634cn+wGFAgYmIXlHSwrBfT1hbLJEo0FY/ei2GV3O+04k5ppEk8IaaUjiUTZ6qRurHd6v/mYzYgU2U/iUdHXN/51I7aAyimVC0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=dCkxqSXq; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=Qmv4/Aed; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dCkxqSXq"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="Qmv4/Aed" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1785433095; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PRVLUAMqt9btSYcKLPYN+Dg017FHNaeUxumso8uAL/U=; b=dCkxqSXqqJL4mE6nhO57kWbmJh4GPGTgT0Nm/Fq9ho0kJnwcrU1m+QBBDDG01r+kKyxtZc 5o1PnHUKvaRTPVK//7j7IK3s2FbJf93p3hLlBXoYyfgRkheCp5vNd+/eKFv2Yb0VBJ/bKH cytgUXkfE+u5odefvuwxUPkma2r84bA= Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-451-QGZ2ZIyNOl6NEHQW6YCXLg-1; Thu, 30 Jul 2026 13:38:12 -0400 X-MC-Unique: QGZ2ZIyNOl6NEHQW6YCXLg-1 X-Mimecast-MFC-AGG-ID: QGZ2ZIyNOl6NEHQW6YCXLg_1785433092 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-81e8a76a273so2899727b3.1 for ; Thu, 30 Jul 2026 10:38:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1785433092; x=1786037892; darn=vger.kernel.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:content-type:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=PRVLUAMqt9btSYcKLPYN+Dg017FHNaeUxumso8uAL/U=; b=Qmv4/Aedan7hcQz8zdo06qi5nF2HNxgwap8nyZp7bAn8QBUXc3TOzbpUdal1eFiUML C0zklhtMi0rR5A4m1KlyOi54aCNThRh8/1nCR0poZuqEpAMZWpI1k/DAz59nd8p+IaMY tcDhI1OybMqq/BZhZQAQEUClDgzELJ/OmpAQ7zz1XpJpsyyMRqmE9+HU9O65nNnsBSrH BWhkVFtHlc85dNdGdzJX7tyBC+ue+SZOH37guVAEXzPs1KZKGve+ATqOcWuo0ej0lQLC PXEBIFcsfmPmaxWRLYgZNRJi9fHbAS5xw681j6aOK0IiCdUBfa5K2YKQ60ft7Ur+VwzO OLVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785433092; x=1786037892; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:content-type:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=PRVLUAMqt9btSYcKLPYN+Dg017FHNaeUxumso8uAL/U=; b=krw1k7Do/q433S6uqOfExTsmTSCLpKrWtkSLcRciynGczInlxz5WtDHUf+antlxTCS RBrxqHUzElSTzVsYkwPP1W35bV+BZ4uYLCAu+Km3MNg6Lub+0BuBEkXwyRAAooTvJjxZ eMUi+WFY00iSsZA1vKuTY2db7rUqVUf0SEJj7G5B7WQFKKvNsFJC1EkEQbFGHB4soJv7 x1Mz2nJlMJqKUo3sbVXlrSlwXeeKL369sOpZpKi3MRMhyjbp0yIH8X8UyCmc8iFXCzbT SMHqdaYiuOuL1At1Bru/i+h2/Xqa4VyB6dGkekDjTiYR/wkEcxvNum3W4cIBJfleqSVe HX6A== X-Forwarded-Encrypted: i=1; AHgh+RpZ4SUV7jMcQ3fFT4ngNQhQ0DDQSoRL9Z/RlAkCU9RuOnApRWjD8m7UDcIUi8pdtAR8doJLdjE8f2L5m24=@vger.kernel.org X-Gm-Message-State: AOJu0YwW5nHuYgFBtaaRHe+E9BMxOhUhCRyKdSBZR/RouQmyNVNDkl+O 4c5llp4Jdnast62EelWKDO83NAKwy3iY1sYhLdEKBMMbuv0OAVdAiQ/eOPhbEYQZEnvjMtt5eZF pkCJwk3/CiRdA4pxOIp7KBc/cfUiDpUMM5kuE6MjVrBPwESx6se4mhdFRCNlMO2OLIQ== X-Gm-Gg: AR+sD1243VUvALteH1BDmL8EifRaLlyj164yvY7aJ22khm29W1VM7qJ3Iz7Hi10vO/9 jhazAVInw/NQPTgZU4Vc8Hfp0RrmMPVoxIYA5iFD+/AEAzybwd89SSNSmgVv2daT7yMyarmL26p nvKfEeaGVh8W14VsoZnaUaJbHvpgVugb2LV3l4vgeLHOv9yg/USOaoCLXFqDkl3mhMpy/kSO0OK 72ccyvU6KtIf8iG9EJtYQU6/RQsPhztr7acj6jVbBbrrRjAstn6kdvgnmBsCTj20FUyPBvBhGLV Sx62SbkRR+fhasQoK+fy5vBcmASf2KNlKfFipDek2nEtZo+YBBbdLI4hgH1vXPpCfCwJmr09I8T YnhrPoSb8DiOGWO66Em5qdWXUQ4e5mXYPMJU= X-Received: by 2002:a05:690c:698f:b0:81e:fd36:ff73 with SMTP id 00721157ae682-81fb891d54cmr25018647b3.5.1785433091930; Thu, 30 Jul 2026 10:38:11 -0700 (PDT) X-Received: by 2002:a05:690c:698f:b0:81e:fd36:ff73 with SMTP id 00721157ae682-81fb891d54cmr25018367b3.5.1785433091480; Thu, 30 Jul 2026 10:38:11 -0700 (PDT) Received: from redhat.com (c-73-183-53-213.hsd1.pa.comcast.net. [73.183.53.213]) by smtp.gmail.com with ESMTPSA id 00721157ae682-81fb87315cdsm14274757b3.0.2026.07.30.10.38.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jul 2026 10:38:10 -0700 (PDT) Date: Thu, 30 Jul 2026 13:38:08 -0400 From: Brian Masney To: Stefan =?iso-8859-1?Q?D=F6singer?= Cc: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Vinod Koul , Neil Armstrong , Russell King , Lee Jones , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, mfd@lists.linux.dev Subject: Re: [PATCH v8 05/12] clk: zte: Add Clock registration infrastructure Message-ID: References: <20260727-zx29clk-v8-0-7a107b00f1dd@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.4.0 (2026-06-19) Hi Stefan, On Wed, Jul 29, 2026 at 12:25:34AM +0300, Stefan Dösinger wrote: > Thanks for the review! > > Am Dienstag, 28. Juli 2026, 16:53:17 Ostafrikanische Zeit schrieben Sie: > > Looking into the other patches. There's more mixing of the clk provider > > calling the clk consumer APIs here. It looks like this just takes a > > reference and holds them. Would moving to parent_data address this? > > I think so. parent_data::fw_name is indeed something I have been looking for > and didn't stumble across myself. And I suspect when you say "use > parent_data", you don't mean "use parent_data.name everywhere". > > But it raises the question of how to handle internal clocks, e.g. foo_gate- > >foo_div->foo_mux->clock-26m. Only "clock-26m" is passed through the DT and > found via fw_name, and only foo_gate is exported. > > For the other clocks I currently rely on the string matching to resolve the > parent named in the static init data to an actual registered clk_hw. The > alternative I see is storing the struct clk_hw * in a table by index and pass > it in parent_data.hw, but that'd require managing the extra indices. Or build > a clock-local name->clk_hw lookup, but then I am just reinventing the old name > matching. > > Am I missing something obvious? Is there a canonical implementation somewhere > that implements modern best practices? I learned that looking at existing > drivers isn't always a reliable guide. You'll want to register all of the clocks with the subsystem. Take a look at drivers/clk/qcom/gcc-sa8775p.c and here's an example I picked at random that shows how you can reference the parents with the parent_data: static const struct clk_parent_data gcc_parent_data_8[] = { { .index = DT_BI_TCXO }, { .hw = &gcc_gpll7.clkr.hw }, { .index = DT_RXC1_REF_CLK }, { .hw = &gcc_gpll0_out_even.clkr.hw }, }; static struct clk_rcg2 gcc_emac1_rgmii_clk_src = { ... .clkr.hw.init = &(const struct clk_init_data){ .name = "gcc_emac1_rgmii_clk_src", .parent_data = gcc_parent_data_8, .num_parents = ARRAY_SIZE(gcc_parent_data_8), .ops = &clk_rcg2_shared_ops, }, }; Brian