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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151015180903.GG4558@codeaurora.org>
Date:	Thu, 15 Oct 2015 11:09:03 -0700
From:	Stephen Boyd <sboyd@...eaurora.org>
To:	Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>
Cc:	Mike Turquette <mturquette@...libre.com>,
	linux-kernel@...r.kernel.org, linux-clk@...r.kernel.org,
	Gregory CLEMENT <gregory.clement@...e-electrons.com>,
	Jason Cooper <jason@...edaemon.net>,
	Andrew Lunn <andrew@...n.ch>,
	Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>
Subject: Re: [PATCH 14/26] clk: mvebu: Convert to clk_hw based provider APIs

On 10/15, Thomas Petazzoni wrote:
> Stephen,
> 
> On Wed, 14 Oct 2015 14:08:59 -0700, Stephen Boyd wrote:
> 
> > Here's that untested patch, which we can throw into clk-next for
> > v4.4
> 
> It almost worked, but not completely. The issue is that by the time you
> call of_clk_get(np, index), index is no longer equal to the value
> passed as argument to of_clk_get_parent_name(), it has been modified to
> indicate the index of the *parent* clock.
> 
> So, after changing your patch to:
[...]
> It does work properly for me, on top of 4.3-rc5, without any change to
> my Device Tree files.

Good catch! Except we don't need to do all that complicated
stuff, right? We can use of_clk_get_from_provider() instead.

---8<----
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 16b86a551bcb..648fb2c8904d 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -3088,7 +3088,7 @@ const char *of_clk_get_parent_name(struct device_node *np, int index)
 		 * registered, we return the node name as the name of
 		 * the clock as long as #clock-cells = 0.
 		 */
-		clk = of_clk_get(np, index);
+		clk = of_clk_get_from_provider(clkspec);
 		if (IS_ERR(clk)) {
 			if (clkspec.args_count == 0)
 				clk_name = clkspec.np->name;

> 
> So, what is the plan now ?
> 
>  - Have the minimal fix in drivers/clk/mvebu/clk-cpu.c for 4.3.

Yep.

> 
>  - Have the patch improving the of_clk_get_parent_name() logic merged
>    in 4.4 + a revert of the fix done for 4.3 in clk-cpu.c. Unless maybe
>    you don't want to clutter the core of the clock framework to handle
>    this specific case?

Assuming that the patch doesn't cause problems for other
platforms, then I think we'll go with this approach.

> 
>  - Add the clock-output-names to the Marvell EBU Device Tree files, so
>    that in a couple of kernel releases we can remove the hacks and rely
>    on the generic logic of of_clk_get_parent_name().
> 

Naw, let's not change any DT files for this.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ