From: Robert Jarzmik <robert.jarzmik@free.fr>
To: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org
Subject: Re: [PATCH] mtd: docg3 fix in-middle of blocks reads
Date: Tue, 15 May 2012 20:25:05 +0200 [thread overview]
Message-ID: <87ipfxuwse.fsf@free.fr> (raw)
In-Reply-To: <1337094261.4170.70.camel@shinybook.infradead.org> (David Woodhouse's message of "Tue, 15 May 2012 16:04:21 +0100")
David Woodhouse <dwmw2@infradead.org> writes:
> On Mon, 2012-04-09 at 13:19 +0200, Robert Jarzmik wrote:
>>
>> The reason seams that the first 111 bytes read ends between
>> the 2 docg3 planes, and that the first following read (in
>> the 12 bytes sequence, read of 16 bit word) returns the byte
>> of the rightmost plane duplicated in high and lower byte of
>> the word.
>>
>> Fix this behaviour by ensuring that if the previous read
>> ended up in-between the 2 planes, there will be a first 1
>> byte read to get back to the beginning of leftmost plane.
>
> Um, this seems complex. Wouldn't it be easier just to say "Don't Do That
> Then" — always read a multiple of two bytes, even if the caller doesn't
> care about the last byte?
Hi David,
I don't get the "Don't Do That Then".
The caller here, UBIFS, wants to read 12 bytes at offset 111 => [
byte111..byte122]. Note that the number of wanted bytes is even, and it's the
offset which is _odd_.
The problem for the driver is to read the 111 first bytes and forget them, and
then store the next 12 bytes. I don't see an alternative here, apart from having
a bounce buffer to read the bytes [byte110..byte122], and then copy into the
destination buffer. And I really don't want the bounce buffer.
Do you see any other alternative ?
Cheers.
--
Robert
prev parent reply other threads:[~2012-05-15 18:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-09 11:19 [PATCH] mtd: docg3 fix in-middle of blocks reads Robert Jarzmik
2012-04-12 19:17 ` Robert Jarzmik
2012-04-13 17:30 ` Artem Bityutskiy
2012-04-14 8:46 ` Robert Jarzmik
2012-04-13 17:30 ` Artem Bityutskiy
2012-05-15 15:04 ` David Woodhouse
2012-05-15 18:25 ` Robert Jarzmik [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=87ipfxuwse.fsf@free.fr \
--to=robert.jarzmik@free.fr \
--cc=dwmw2@infradead.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox