linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Voss, Nikolaus" <N.Voss@weinmann.de>
To: "'dedekind1@gmail.com'" <dedekind1@gmail.com>
Cc: "'Nicolas Ferre'" <nicolas.ferre@atmel.com>,
	"'linux-mtd@lists.infradead.org'" <linux-mtd@lists.infradead.org>,
	"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] mtd: atmel_nand: fix access to 16 bit NAND devices
Date: Mon, 30 Jan 2012 08:57:17 +0100	[thread overview]
Message-ID: <EF2E73589CA71846A15D0B2CDF79505D08AD3E5453@wm021.weinmann.com> (raw)
In-Reply-To: <1327670996.26648.43.camel@sauron.fi.intel.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1651 bytes --]

Artem Bityutskiy wrote on 2012-01-27:
> On Wed, 2012-01-18 at 10:16 +0100, Nikolaus Voss wrote:
>> commit fb5427508abbd635e877fabdf55795488119c2d6 optimizes PIO
>> NAND accesses by using IO memcpy instead of IO read/write
>> repeated functions.
>> 
>> This breaks access to 16 bit NAND devices as memcpy_fromio()/toio()
>> _always_ use byte accesses (see arch/arm/kernel/io.c), so with
>> 16 bit NAND, one byte gets lost per NAND access cycle and NAND
>> address count is wrong.
>> 
>> Using memcpy() instead of the IO memcpy functions fixes this, but
>> depends on correct word alignment of the buffer and length has to
>> be a multiple of four, otherwise it might issue byte accesses and
>> possibly break 16 bit NAND access (cf arch/arm/lib/copy_template.S).
>> 
>> Memcpy variants seem to be the wrong approach here, since the
>> NAND controller doesn't make the NAND appear as truely randomly
>> accessible memory (as opposed to the DRAM controller which does
>> exactly that).
>> 
>> So, my proposal is to use 32 bit IO read/write (and let SMC
>> map it to 8 bit or 16 bit NAND accesses) and account for
>> length % 4 > 0 with two additional IO read/writes.
>> 
>> Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>
> 
> Why not to revert fb5427508abbd635e877fabdf55795488119c2d6 instead, it
> is in my opinion a bit more readable?

No objections. I've tried to save the idea of
fb5427508abbd635e877fabdf55795488119c2d6 but that length % 4 > 0 stuff
uglifies it a little bit...

Niko


ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2012-01-30  8:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-18  9:16 [PATCH] mtd: atmel_nand: fix access to 16 bit NAND devices Nikolaus Voss
2012-01-27 13:29 ` Artem Bityutskiy
2012-01-30  7:57   ` Voss, Nikolaus [this message]
2012-01-30  8:57     ` Nicolas Ferre
2012-02-01 10:43       ` Eric Bénard
2012-02-02 12:06       ` Artem Bityutskiy
2012-02-03  3:35         ` Venu Byravarasu
2012-02-03  5:32           ` Artem Bityutskiy

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=EF2E73589CA71846A15D0B2CDF79505D08AD3E5453@wm021.weinmann.com \
    --to=n.voss@weinmann.de \
    --cc=dedekind1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=nicolas.ferre@atmel.com \
    /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).