[PATCH] [MTD] Adjust the NOR CFI flash timeouts to round better

Artem Bityutskiy dedekind1 at gmail.com
Mon Oct 15 15:28:19 EDT 2012


On Mon, 2012-10-15 at 09:09 -0700, David Woodhouse wrote:
> On Mon, 2012-10-15 at 16:42 +0300, Artem Bityutskiy wrote:
> > On Fri, 2012-10-05 at 12:32 -0600, Jason Gunthorpe wrote:
> > > -	/* see comments in do_write_oneword() regarding uWriteTimeo. */
> > > -	unsigned long uWriteTimeout = ( HZ / 1000 ) + 1;
> > > +	/* see comments in do_write_oneword() regarding uWriteTimeo.
> > > +	   Note: write_buffer commands take longer so we use a higher
> > > +	   time. The AMD 29LV256M for instance has a datasheet max
> > > +	   of 1.2ms for page and 600us for byte */
> > > +	unsigned long uWriteTimeout = (HZ / 1500) + 2;
> > 
> > What does HZ / 1500 mean? HZ is amount of timer interrupts per second,
> > which may be 1/100, or 1/1000, or 1/300, depending on the system.
> 
> If HZ is the amount of timer interrupts per second, then HZ/1500 is the
> amount of timer interrupts in 1/1500 of a second, aka 666.7µs.¹

First of all, yes, my e-mail was not very clear, I guess I just wanted
to express that it is not very readable. Also, HZ / 1500 would be 0 for
HZ < 1500, since we are using integer arithmetic.

-- 
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20121015/82b090e6/attachment.sig>


More information about the linux-mtd mailing list