All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Puschmann <andre.puschmann@imms.de>
To: linux-mtd@lists.infradead.org
Subject: Re: flash read performance
Date: Fri, 07 Nov 2008 10:47:55 +0100	[thread overview]
Message-ID: <gf12sb$oo3$1@ger.gmane.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0811061815190.3864@t2.domain.actdsltmp>

Hi,

Trent Piepho wrote:
> I've found that writes do not work with caching enabled.  When the CPU writes
> to the flash and then reads it back, it gets returned what it wrote.  That's
> not what is supposed to happen.  

Sure, writes should be uncached and unbuffered. But I thought the mtd 
layer handles this correctly as there are two different ioremap's in the 
driver:

map.virt = ioremap(..);
map.cached = ioremap_cached(..);
map.inval_cache = inval_cache_fct();

So, calling inval_cache_fct() just before any write operation and then 
using the uncached mapping should do the trick, no? On the other hand, I 
am not sure if the mtd-layer really behaves like that. Can somebody 
confirm this?
Anyway, I tried to write a cramfs-image to a previously (in uboot) 
erased flash area. After that, I could successfully boot the system 
using this cramfs as my root. So I would reason that writes are OK.
Time is another point (cramfs_xip.bin is 1.6MB):

# time cp cramfs_xip.bin /dev/mtd3
real    4m 13.52s
user    0m 0.00s
sys     4m 13.03s

This is around 6,3kB/s. Doing the same write in uboot with cp.b takes 
about 26sec. So this is around 62kB/s.


> I measured by reading flash linearly from beginning to end 32-bits at a time. 
> Since the flash is bigger than the cache, ever read should have come from the
> flash.  If I just read the same 1k over and over that would obviously be much
> faster if it could come from the cache.

I measured by reading from mtd char device, which is not reading the 
same data over and over again.
I copied the whole partition into a ramdisk. mtd3 is 3MB in size so this 
yields to a read speed of 11.53MB/s

# time cp /dev/mtd3 /tmp/test
real    0m 0.26s
user    0m 0.01s
sys     0m 0.24s


> I'm just using the GPCM mode of the Freescale eLBC, which means I have to use
> the same timings both for writes and reads.  There are parts of the timing I
> could make faster for reads, but then they would be too short for writes, and
> vice versa.  It also means I can't use the page burst mode, which would
> speed up reads significantly.

I am not familiar with GPCM and eLBC, but it sounds about the same here. 
Same timings for writes and reads. But I use burst mode (4 words), but 
this only applies to reads.

> The biggest bootup delay I have now is waiting for the ethernet phy to get
> online, which takes almost 3 seconds.

Same here, ethernet phy takes sooo long. Here is what I do: I am using a 
parallel init. On script is just for loading the ethernet-module which 
is done next to the other scripts. So 2sec is cheated, cause ethernet 
isn't really available at this point of time.

Regards,
Andre

  parent reply	other threads:[~2008-11-07  9:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-28 10:14 flash read performance Andre Puschmann
2008-10-29 11:42 ` Josh Boyer
2008-10-29 12:03   ` Jamie Lokier
2008-10-29 15:52   ` Andre Puschmann
2008-10-30  8:33     ` Arnaud Mouiche
2008-10-30  9:52       ` Andre Puschmann
2008-10-30 10:06         ` Arnaud Mouiche
2008-11-03 14:23           ` Andre Puschmann
2008-11-04  8:30             ` Andre Puschmann
2008-11-04 11:42             ` Jamie Lokier
2008-11-04 14:31               ` Andre Puschman
2008-11-07  2:41                 ` Trent Piepho
2008-11-07  4:02                   ` Jamie Lokier
2008-11-07  5:36                     ` Trent Piepho
2008-11-07  5:57                       ` Jamie Lokier
2008-11-07  9:47                   ` Andre Puschmann [this message]
2008-11-08  5:28                     ` Trent Piepho
2008-11-11 13:28                       ` Andre Puschmann
2008-11-15  2:02                         ` Trent Piepho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='gf12sb$oo3$1@ger.gmane.org' \
    --to=andre.puschmann@imms.de \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.