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: <1119f60e-99dd-45f8-8d91-2b0fa8b7f03b@DB8EHSMHS027.ehs.local>
Date:	Wed, 18 Sep 2013 16:32:59 -0700
From:	Sören Brinkmann <soren.brinkmann@...inx.com>
To:	Joe Perches <joe@...ches.com>
CC:	Rob Herring <rob.herring@...xeda.com>,
	Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Stephen Warren <swarren@...dotorg.org>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Rob Landley <rob@...dley.net>,
	Mike Turquette <mturquette@...aro.org>,
	Grant Likely <grant.likely@...aro.org>,
	Guenter Roeck <linux@...ck-us.net>,
	Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
	<devicetree@...r.kernel.org>, <linux-doc@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>,
	Hyun Kwon <hyunk@...inx.com>
Subject: Re: [PATCH v2] clk: si570: Add a driver for SI570 oscillators

On Wed, Sep 18, 2013 at 04:18:56PM -0700, Joe Perches wrote:
> On Wed, 2013-09-18 at 16:09 -0700, Sören Brinkmann wrote:
> > On Wed, Sep 18, 2013 at 04:02:41PM -0700, Joe Perches wrote:
> > > On Wed, 2013-09-18 at 15:43 -0700, Soren Brinkmann wrote:
> > > > Add a driver for SILabs 570, 571, 598, 599 programmable oscillators.
> > > > The devices generate low-jitter clock signals and are reprogrammable via
> > > > an I2C interface.
> > > []
> > > > v2:
> > > []
> > > >  - use 10000 as MIN and MAX value in usleep_range
> > > []
> > > > diff --git a/drivers/clk/clk-si570.c b/drivers/clk/clk-si570.c
> > > []
> > > > +static int si570_set_frequency(struct clk_si570 *data, unsigned long frequency)
> > > > +{
> > > []
> > > > +	/* Applying a new frequency can take up to 10ms */
> > > > +	usleep_range(10000, 10000);
> > > 
> > > Generally it's nicer to have an actual range for usleep_range.
> > Well, as I said in the discussion with Guenther. I'm flexible and nobody
> > objected when I said to make both equal. A real range doesn't make sense
> > here though, but I don't know what's common practice for cases like
> > this.
> 
> udelay is normal, but I guess you don't need atomic context.
After checkpatch correcting me a few times I went with what
Documentation/timers/timers-howto.txt suggests. But yes, then we have
this situation, that I want to sleep 10ms, but not longer using a
*_range function. I guess it is very application specific whether a
longer delay here is acceptable or not.

>  
> > > Is there a bit you could periodically poll to see
> > > if the new frequency has been set or is stable so
> > > that a 10ms delay isn't always used?
> 
> > Unfortunately not.
> 
> Thanks.  I suppose I should read the datasheets before asking.
> 
> http://www.silabs.com/Support%20Documents/TechnicalDocs/si570.pdf
> (page 12)
> 
> Anyway, perhaps si570_set_frequency_small needs a delay too.'
> 
> The 570 datasheet says it needs a 100uS delay.
You're right. I'll add a delay there as well. The 'rang' question
applies here as well.

	Sören


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