public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Andrey Volkov <avolkov@varma-el•com>
To: Sascha Hauer <s.hauer@pengutronix•de>
Cc: Sylvain Munaut <tnt@246tNt•com>,
	Paul Mackerras <paulus@samba•org>,
	Linuxppc-embedded <Linuxppc-embedded@ozlabs•org>
Subject: Re[2]: MPC5200 + LocalPlus Bus + memcpy
Date: Fri, 7 Apr 2006 12:57:00 +0400	[thread overview]
Message-ID: <646456017.20060407125700@varma-el.com> (raw)
In-Reply-To: <20060407073701.GC10831@localhost.localdomain>

Hello, Sascha.

On Friday, April 7, 2006, Sascha Hauer wrote:

> Hello,

> On Thu, Apr 06, 2006 at 06:21:44PM +0400, Andrey Volkov wrote:
>> Hello, Sascha.
>> 
>> On Wednesday, April 5, 2006, Sascha Hauer wrote:
>> 
>> > Hi all,
>> 
>> > I try to use jffs2 on a flash device connected to the mpc5200
>> > LocalPlus Bus. This bus does not allow misaligned accesses.
>> > The jffs2 code uses memcpy to copy from a word aligned address to an
>> > odd address. The ppc memcpy implementation first copies three bytes to get
>> > the target address word aligned, but then the source address is on an
>> > odd address. The following word accesses on this unaligned address fail
>> > badly.
>> Invalid crc on 'name' field ;)?

> Yes, exactly ;)
:)
>> 
>> > I have fixed my problem by modifying the physmap mtd driver, but some
>> > day someone wants to connect SRAM to the LocalPlus Bus and I guess he
>> > will expect memcpy to work.
>> Heh, I'll have same problem. Patch (dirty hack)
>> attached (vs head of vanilla 2.6. tree)
>> 
>> > (BTW the arm implementation of memcpy seems to work around this problem)
>> Wrong, memcpy to/from SDRAM _may_ be unaligned, only
>> memcpy_fromio/memcpy_toio _must_ be aligned to even addresses.

> Hm, then a proper fix would be:
> - implement an optimized version of memcpy_fromio/memcpy_toio, this
>   could be a version of memcpy which only alignes on the io side
Yes.

> - use memcpy_fromio/memcpy_toio in jffs2 code
They already use it (from jffs2_read/write), only scan.c doesn't
calling this fns.

> Do I see this right?
Yes.

> Is SRAM considered io? I know (Arm-)Boards which do not have SDRAM, they
> run completely from SRAM.
Only LBP demand alignment, SDRAM/DDR and internal SRAM didn't.



-- 
Regards,
Andrey Volkov

      reply	other threads:[~2006-04-07  8:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-05 11:38 MPC5200 + LocalPlus Bus + memcpy Sascha Hauer
2006-04-06 14:21 ` Andrey Volkov
2006-04-07  7:37   ` Sascha Hauer
2006-04-07  8:57     ` Andrey Volkov [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=646456017.20060407125700@varma-el.com \
    --to=avolkov@varma-el$(echo .)com \
    --cc=Linuxppc-embedded@ozlabs$(echo .)org \
    --cc=paulus@samba$(echo .)org \
    --cc=s.hauer@pengutronix$(echo .)de \
    --cc=tnt@246tNt$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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