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: <CAAYSxhoBvr2Q=ZEQX6hgBjLorgjCjeLLqB9WP2RQ1YFBejjHbg@mail.gmail.com>
Date:	Mon, 21 Oct 2013 14:07:14 -0700
From:	Tim Kryger <tim.kryger@...aro.org>
To:	Mark Rutland <mark.rutland@....com>
Cc:	Christian Daudt <bcm@...thebug.org>,
	"rob.herring@...xeda.com" <rob.herring@...xeda.com>,
	Pawel Moll <Pawel.Moll@....com>,
	Stephen Warren <swarren@...dotorg.org>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Daniel Lezcano <daniel.lezcano@...aro.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Chris Ball <cjb@...top.org>,
	"devicetree@...r.kernel.org" <devicetree@...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>,
	"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
	"patches@...aro.org" <patches@...aro.org>
Subject: Re: [RESEND PATCH v2 4/6] clocksource: kona: Add basic use of
 external clock

On Thu, Oct 17, 2013 at 7:05 AM, Mark Rutland <mark.rutland@....com> wrote:
> On Wed, Oct 16, 2013 at 10:47:08PM +0100, Tim Kryger wrote:
>> When an clock handle is specified in the device tree, enable it and use
>> it to determine the external clock frequency.
>
> I'd drop handle here and just say "When a clock is specified".
>
> This will need a binding document update.

Can you be more specific about what you are looking for here?

Shall I just say that the frequency property is now deprecated since
it actually belongs to the external clock whose association with a
kona timer instance might be declared in the DT using the common clock
bindings but could also be declared through other means?

>> Signed-off-by: Tim Kryger <tim.kryger@...aro.org>
>> Reviewed-by: Markus Mayer <markus.mayer@...aro.org>
>> Reviewed-by: Matt Porter <matt.porter@...aro.org>
>> ---
>>  drivers/clocksource/bcm_kona_timer.c | 14 +++++++++++---
>>  1 file changed, 11 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/clocksource/bcm_kona_timer.c b/drivers/clocksource/bcm_kona_timer.c
>> index 0d7d8c3..fd11f96 100644
>> --- a/drivers/clocksource/bcm_kona_timer.c
>> +++ b/drivers/clocksource/bcm_kona_timer.c
>> @@ -17,6 +17,7 @@
>>  #include <linux/jiffies.h>
>>  #include <linux/clockchips.h>
>>  #include <linux/types.h>
>> +#include <linux/clk.h>
>>
>>  #include <linux/io.h>
>>  #include <asm/mach/time.h>
>> @@ -107,11 +108,18 @@ static const struct of_device_id bcm_timer_ids[] __initconst = {
>>  static void __init kona_timers_init(struct device_node *node)
>>  {
>>       u32 freq;
>> +     struct clk *external_clk;
>>
>> -     if (!of_property_read_u32(node, "clock-frequency", &freq))
>> +     external_clk = of_clk_get_by_name(node, NULL);
>
> Is there only a single external clock input to the kona timer, or is
> only one relevant here?
>
> Are there any other inputs currently not modelled (e.g. regulators)?

The timer block relies upon a single clock and does not use any regulators.

>> +
>> +     if (!IS_ERR(external_clk)) {
>> +             arch_timer_rate = clk_get_rate(external_clk);
>> +             clk_prepare_enable(external_clk);
>> +     } else if (!of_property_read_u32(node, "clock-frequency", &freq)) {
>>               arch_timer_rate = freq;
>> -     else
>> -             panic("clock-frequency not set in the .dts file");
>> +     } else {
>> +             panic("neither clock-frequency or clocks handle in .dts file");
>
> Nit: it's not a handle, it's a phandle+args pair.
>
> Why not just "Unable to determine clock frequency"?

Sure that sounds fine.

>
> Do we need to panic here? Might a system have other clocks it could use
> to continue?

I completely agree that this driver could be improved.  However, this
is unrelated to the topic of this series so I will address it later in
a separate patch.
--
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