lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a48f6017bacb4aacb0a318554229cb65.sboyd@kernel.org>
Date: Wed, 10 Apr 2024 21:17:52 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: "Simek, Michal" <michal.simek@....com>, "Trivedi Manojbhai, Naman" <Naman.TrivediManojbhai@....com>, robh@...nel.org
Cc: linux-clk@...r.kernel.org <linux-clk@...r.kernel.org>, linux-arm-kernel@...ts.infradead.org <linux-arm-kernel@...ts.infradead.org>, linux-kernel@...r.kernel.org <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] drivers: clk: zynqmp: remove clock name dependency

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 tree.
> >>> 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 from
> >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[] = {
		{ .index = MY_DT_PARENT_1 }, /* parent index 0 */
		{ .index = 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? 

> >
> >So, I did not get how to use the struct clk_parent_data in this case. Can 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ