linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Milton Miller <miltonm@bga.com>
To: Steve Deiters <SteveDeiters@BASLER.com>
Cc: Albrecht Dreß <albrecht.dress@arcor.de>,
	linuxppc-dev@ozlabs.org, David Woodhouse <dwmw2@infradead.org>
Subject: Re: arch/powerpc/lib/copy_32.S: Use alternate memcpy for MPC512x and MPC52xx
Date: Sun, 11 Jul 2010 02:40:22 -0500	[thread overview]
Message-ID: <1278834022_17748@mail4.comsite.net> (raw)
In-Reply-To: <181804936ABC2349BE503168465576460F272CA4@exchserver.basler.com>


Steve wrote:
> These processors will corrupt data if accessing the local bus with
> unaligned addresses. This version fixes the typical case of copying from
> Flash on the local bus by keeping the source address always aligned.

As Dave said in May of 2008[1], the map driver is advertising xip access
to userspace so jffs2 is taking the XIP path and doing straight memcpy.

My reading of the mtd code says this is because map_is_linear() is true
a cfi cmdset 0001 nor flash will create a point function which jffs2
calls and it finds it will map the whole fs, so it just reads at will
from the direct mapping.

If the point fails to map the whole device, then jffs2 will use the
mtd mapping driver to copy to a buffer, and the default mapping drivers
will use memcpy_fromio to fill this buffer.

Steve, can you verify this by setting phys to NO_XIP in the mapping
driver and setting CONFIG_MTD_COMPLEX_MAPPINGS?  This is just a test,
as it is aparent this driver needs to have a custom mapping driver
that handles the alignment and read/modfiy/write issues -- the existing
memcopy_*io assumes byte writes are always ok which is not the case for
this processor and bus.


[1] http://thread.gmane.org/gmane.linux.drivers.mtd/21521
(found from the link in Albrecht's reply)

milton

      parent reply	other threads:[~2010-07-11  7:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-29 16:04 [PATCH] arch/powerpc/lib/copy_32.S: Use alternate memcpy for MPC512x and MPC52xx Steve Deiters
2010-06-29 16:58 ` Segher Boessenkool
2010-07-08  5:10 ` Benjamin Herrenschmidt
2010-07-08  5:38   ` Grant Likely
2010-07-08 14:38     ` Steve Deiters
2010-07-08 15:22       ` Grant Likely
2010-07-08 18:40         ` Albrecht Dreß
2010-07-08 19:30           ` Segher Boessenkool
2010-07-08 20:09             ` Scott Wood
2010-07-09 12:59               ` Segher Boessenkool
2010-07-09 16:18                 ` Scott Wood
2010-07-08 20:09             ` Albrecht Dreß
2010-07-09 13:03               ` Segher Boessenkool
2010-07-11  7:40 ` Milton Miller [this message]

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=1278834022_17748@mail4.comsite.net \
    --to=miltonm@bga.com \
    --cc=SteveDeiters@BASLER.com \
    --cc=albrecht.dress@arcor.de \
    --cc=dwmw2@infradead.org \
    --cc=linuxppc-dev@ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).