Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp171919lqg; Wed, 10 Apr 2024 21:18:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUjLRpGoY7A3I0nzNNrD8vmeUEdOmZJDRwI/Bl2yuBo5G/SqBLRWsOgwYqH+PKihChMeKPAc54p9kkUdqSzyAFYo/+Q5OZ4mM9y3iD8Sw== X-Google-Smtp-Source: AGHT+IEqKUMlq19Phkch0WmvPgR557HPpftLKiFEfkUjopZyD6l1IedB/Mr6RN09Tw1f3g7VgdCd X-Received: by 2002:a05:6102:32c9:b0:47a:3b53:a02c with SMTP id o9-20020a05610232c900b0047a3b53a02cmr105819vss.22.1712809082099; Wed, 10 Apr 2024 21:18:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712809082; cv=pass; d=google.com; s=arc-20160816; b=02/f0PDtFHaP6sE4gzxyQ03l0glO2SHAIw+ofk8+OYig6gvlawnTnpuJL/4oBSV7Mh 6WFyhd51vhUT2CePrrRYxZqkml04BlcmpLpmurZfLvH3dD/i/EOsx9ooI92dyrqZXOW6 nziYMWnkQtwKaX3V0LuLP9Rp7K15SLJ2wV3qPtdzcCd2qHF6PqoI5UmDgZImnMBd+8Qu OWg3Sh/5nb6k2fPYjDtNR8wM+hVrpigLA7ZnB+Zp+yj9f61f7B3I14lTflf8cUjLPMyP KZ2E40YE+B1r04wXQ+0ATw02Ui/GAq9A2G8o1+ZR7NR9Xn+2Fjskml1MdnBSvfTpPZBO 2+HQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:date:to:cc:from:subject:references:in-reply-to :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:dkim-signature; bh=cFZroYOaKCEpXN6th9+F3DBCo+uVQgk49NHmz3Dq5Ss=; fh=1/zVx2cTTTmOVEFwbeWM/sByrT+uwITcNTtOvR4ygCE=; b=WZNkmw1sfd4q4IyQ0BVN/w90Fvd1KffFiF921ySxXWyKJaRyz9gEXqqgpDuq0+5Nd2 ADz9D+QHmGE3oReIJf2p63JK0gDIOi0lhqUuoUGZVAwdu5JcCleRDOZeZtEBSHcuPuy9 cA5eDQPKCQStlBUhs4pZZXAuamIes66SFhX7yKJQw6bE4YNah2MuBEs+GO9H1SvArkRB J1fQmQ8W/f8bMImZaDadea+GGDqXk6FqClWKheBVa0zvOPmO3lCLcIRqAJU17N4YCfPb +WBKA5srwMob8pbSZ1KKZ+lUbgH8JafYGrmA/xvAVg214a6nqTph3yVOOXHgnc7ODwfy +KQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Jku8B7I+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-139739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139739-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id pv11-20020ad4548b000000b0069b4f599635si21152qvb.231.2024.04.10.21.18.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 21:18:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-139739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Jku8B7I+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-139739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-139739-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D0D691C21141 for ; Thu, 11 Apr 2024 04:18:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E2B513BC21; Thu, 11 Apr 2024 04:17:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Jku8B7I+" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A1BD82BB09; Thu, 11 Apr 2024 04:17:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712809075; cv=none; b=lu1gKfdlHRewBJi8UxLxpT43BDQuonk0Fr35hltseZqF1TNvvWX0J85F3cGAWxEhziROV7xqZL9zN8A+vWF5C+hfuSLBkzWfpPcAUvnBVH4eRJxQQV/khVFVou++QZ0hrBHyb9COTpLgK4bW52SF5+gAL0TnDDGj+lrQoQ/DKs4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712809075; c=relaxed/simple; bh=LQWAuoCn1kPcx9Am/NeCrTjJ5/EuA4eOzZJNn5sTNoo=; h=Message-ID:Content-Type:MIME-Version:In-Reply-To:References: Subject:From:Cc:To:Date; b=vCV8RNKRFnodjc0yzXs180051ISvy/CgCPDUbKRFOTpIQXvI7QerutwRiCbtKZ/Ypx3c+AIpNrlQZha/Pge7G/h472A+kecc1JyYlVZXVgLaM6dvQpVHcBlD9qJatEUfhpQUH0qtknFsgHL6hskdxMCsTakezYJseyVqvZL25os= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Jku8B7I+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EBC2C433F1; Thu, 11 Apr 2024 04:17:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712809075; bh=LQWAuoCn1kPcx9Am/NeCrTjJ5/EuA4eOzZJNn5sTNoo=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=Jku8B7I+9+3tnBQAf2WhJg2Ed1NYpFtEmT+qE3US5JblrZOe8lm0Skz9pEMMOI59G PtXFGbvMygs6lIJwso1QEbCJIZFdxX6WTNhy1ue+iSpoJzMNmirEW8C3CRFyN+N2Tf csgmu/JsWKxn2qd55EhDPEeIiDIDxq2/80KDJTUy7lFpaoFUHcCj0kQt+b+hzCREsf j6PC282NPnyl7Kflrw6+XItaHpaoZ1NdbOqp9Sz8IbuBKDGuWeCV6Gd5PtuRsYY4Fy Vi/shDWklwA+92j9WOP72tMmlKqSY2ANuUxjS1ygt8KnnGBTKfPbV976YXpMPmJDkl yEH6eyv4MV4LA== Message-ID: Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20240103072017.1646007-1-naman.trivedimanojbhai@amd.com> <55fd522918aa41f386e01432248933da.sboyd@kernel.org> Subject: RE: [PATCH] drivers: clk: zynqmp: remove clock name dependency From: Stephen Boyd Cc: linux-clk@vger.kernel.org , linux-arm-kernel@lists.infradead.org , linux-kernel@vger.kernel.org To: "Simek, Michal" , "Trivedi Manojbhai, Naman" , robh@kernel.org Date: Wed, 10 Apr 2024 21:17:52 -0700 User-Agent: alot/0.10 Quoting Trivedi Manojbhai, Naman (2024-03-26 22:47:28) > >>Quoting Naman Trivedi Manojbhai (2024-01-02 23:20:17) > >>> Currently, from zynqmp_get_parent_list() function the clock driver > >>> references the clock by name instead of its reference from device tre= e. > >>> This causes problem when the clock name in the device tree is changed. > >>> > >>> Remove hard dependency of clock name and update the logic to use > >>> clock reference from device tree instead of clock name. > >> > >>Please use struct clk_parent_data instead. > >Thanks for review. As per my understanding, you suggest to replace the > >proposed logic, and use "struct clk_parent_data" to get the clock name f= rom > >device tree. No, do not get the clock name of a parent in the driver. Use struct clk_parent_data to tell the clk framework what the parent is. > > > >I have gone through other drivers which use the "struct clk_parent_data" > >structure, they have hard coded clock names in the driver. In zynqmp, the > >driver receives clock name from firmware. Don't use a string name. The devicetree index must be stable, so simply use the index that the binding has as the index in struct clk_parent_data. struct clk_parent_data parent_map[] =3D { { .index =3D MY_DT_PARENT_1 }, /* parent index 0 */ { .index =3D MT_DT_PARENT_2 }, /* parent index 1 */ }; > > > >Also, the "zynqmp_get_parent_list" function is called before clocks are > >registered. So at this point, we don't have the hw structure which has > >clk_parent_data. I guess that's a problem with how the code is written?=20 > > > >So, I did not get how to use the struct clk_parent_data in this case. Ca= n you > >please provide an example which I can look at as a reference? > > There are many references. A new qcom one is drivers/clk/qcom/gcc-x1e80100.c