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]
Date:	Tue, 13 May 2014 17:11:55 +0200
From:	Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>
To:	Mark Rutland <mark.rutland@....com>,
	Gabriel FERNANDEZ <gabriel.fernandez@...com>
CC:	"mturquette@...aro.org" <mturquette@...aro.org>,
	"robh+dt@...nel.org" <robh+dt@...nel.org>,
	Pawel Moll <Pawel.Moll@....com>,
	"ijc+devicetree@...lion.org.uk" <ijc+devicetree@...lion.org.uk>,
	"galak@...eaurora.org" <galak@...eaurora.org>,
	"rdunlap@...radead.org" <rdunlap@...radead.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"kernel@...inux.com" <kernel@...inux.com>,
	Lee Jones <lee.jones@...aro.org>,
	Gabriel Fernandez <gabriel.fernandez@...aro.org>
Subject: Re: [PATCH 1/2] clk: of: helper for determining flags properties

On 05/13/2014 02:20 PM, Mark Rutland wrote:
> On Tue, May 13, 2014 at 12:57:32PM +0100, Gabriel FERNANDEZ wrote:
>> The patch provides a helper to get flags properties of
>> a clock node.
>>
>> Signed-off-by: Gabriel Fernandez <gabriel.fernandez@...aro.org>
>> ---
>>   drivers/clk/clk.c            | 11 +++++++++++
>>   include/linux/clk-provider.h |  6 ++++++
>>   2 files changed, 17 insertions(+)
>>
>> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
>> index 4d56220..cae8985 100644
>> --- a/drivers/clk/clk.c
>> +++ b/drivers/clk/clk.c
>> @@ -2528,6 +2528,17 @@ const char *of_clk_get_parent_name(struct device_node *np, int index)
>>   }
>>   EXPORT_SYMBOL_GPL(of_clk_get_parent_name);
>>
>> +unsigned long of_clk_get_flags(struct device_node *np)
>> +{
>> +	unsigned long flags = 0;
>> +
>> +	if (of_property_read_bool(np, "set-rate-parent"))
>> +		flags |= CLK_SET_RATE_PARENT;
>
> NAK.
>
> This is _not_ a hardware property. This flag describes internals of the
> Linux clock framework, and is thus not suitable for DT.

Mark,

while I agree above property is not a hardware property, it is at least
some kind of use-case property. If not by DT, we will have to allow some
way to describe master-slave relationships between clocks in a driver
independent way.

> You've also failed to document the property.
>
> What are you trying to achieve here, and why do you think this is the
> best way of achieving that?

I cannot tell from the commit msgs, but consider clk-si5351 which is a
driver for an external programmable clock with N PLLs and M outputs. Now
connect a video clock consumer and an audio clock consumer to two
different outputs and those to one PLL (as you want audio clock derived
from video clock, typical HDMI scenario).

Now, there should be a way to tell the generic driver which outputs are
allowed to change the PLLs rate and which don't. Otherwise, the clock
chip would be pretty useless as e.g. your audio clock consumer will
overwrite the rate the video clock consumer has chosen.

BTW, clk-si5351 has vendor-specific properties to specify which output
clocks are pll-masters for some kernel cycles already.

Sebastian

>> +
>> +	return flags;
>> +}
>> +EXPORT_SYMBOL_GPL(of_clk_get_flags);
>> +
>>   struct clock_provider {
>>   	of_clk_init_cb_t clk_init_cb;
>>   	struct device_node *np;
>> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
>> index 59e2eb5..650bc10 100644
>> --- a/include/linux/clk-provider.h
>> +++ b/include/linux/clk-provider.h
>> @@ -519,6 +519,7 @@ int of_clk_get_parent_count(struct device_node *np);
>>   const char *of_clk_get_parent_name(struct device_node *np, int index);
>>
>>   void of_clk_init(const struct of_device_id *matches);
>> +unsigned long of_clk_get_flags(struct device_node *np);
>>
>>   #else /* !CONFIG_OF */
>>
>> @@ -546,6 +547,11 @@ static inline const char *of_clk_get_parent_name(struct device_node *np,
>>   {
>>   	return NULL;
>>   }
>> +static inline unsigned long of_clk_get_flags(struct device_node *np)
>> +{
>> +	return NULL;
>> +}
>> +
>>   #define of_clk_init(matches) \
>>   	{ while (0); }
>>   #endif /* CONFIG_OF */
>> --
>> 1.9.1
>>
>>
> --
> 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/
>

--
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