public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Ladislav Michl <ladis@linux-mips.org>
To: linux-mtd@lists.infradead.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Grant Erickson <gerickson@nuovations.com>
Subject: Re: [PATCH 6/6] [MTD-UTILS] nandwrite: Add Support for Reading from Standard Input
Date: Thu, 20 Nov 2008 23:50:22 +0100	[thread overview]
Message-ID: <20081120225022.GA3260@michl.2n.cz> (raw)
In-Reply-To: <C4EAA2B4.118A3%gerickson@nuovations.com>

On Mon, Sep 08, 2008 at 09:36:52AM -0700, Grant Erickson wrote:
> On 9/8/08 9:14 AM, Ladislav Michl wrote:
> > - code uses lseek. Obviously, you cannot seek on pipe.
> 
> True enough. The patch avoids the lseek to determine input file size;
> however, did not address the 'markbad' recovery lseek case.
> 
> Short-term proposal: like 'writeoob', disable 'markbad' support when reading
> from standard input and condition the whole 'markbad' logic on not reading
> from standard input.

It is not about marking bad blocks. Nandwrite will end with unrecoverable
error on first failed write and that is not acceptable in production
environment.

[snip]

> > PS: It is remotely possible that one day I do it myself, but I'm
> > notoriously slow on doing things I do not urgently need.

Well, it took less than three months. Not so bad :-)

And it turned out to be imposible to fix it properly without solving
following issue first.
MEMSETOOBSEL ioctl used to implement these options
  -a, --autoplace     Use auto oob layout
  -j, --jffs2         Force jffs2 oob layout (legacy support)
  -y, --yaffs         Force yaffs oob layout (legacy support)
  -f, --forcelegacy   Force legacy support on autoplacement-enabled mtd device
  -n, --noecc         Write without ecc
was removed more than two years ago and found its way into 2.6.18-rc1. See
http://lists.infradead.org/pipermail/linux-mtd-cvs/2006-May/005514.html

I hope legacy support can be safely removed (please raise your voice now)
which leaves only --noecc for implementation. Possible scenarios are:
1. Image does not contain OOB data
   Read whole eraseblock to buffer and write it to flash
2. Image contains OOB data (--oob is given)
   Set MTDFILEMODE to MTD_MODE_RAW, read whole eraseblock
   (data:oob:data:oob...) into buffer and write it to flash
3. Image does not contain OOB data and --noecc is given
   Set MTDFILEMODE to MTD_MODE_RAW, read whole eraseblock,
   insert 0xff into OOB after each writeblock, write into
   flash
4. Image contains OOB data and --noecc is given
   ???

As I have never need writing images with OOB I'd like to ask for help
how should be case 3 and 4 handled.

Thanks,
	ladis

  parent reply	other threads:[~2008-11-20 22:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-08  4:29 [PATCH 6/6] [MTD-UTILS] nandwrite: Add Support for Reading from Standard Input Grant Erickson
2008-09-08 16:14 ` Ladislav Michl
2008-09-08 16:36   ` Grant Erickson
2008-09-08 21:02     ` Ladislav Michl
2008-11-20 22:50     ` Ladislav Michl [this message]
2008-11-28 22:40       ` Schlaegl Manfred jun.

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=20081120225022.GA3260@michl.2n.cz \
    --to=ladis@linux-mips.org \
    --cc=gerickson@nuovations.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=tglx@linutronix.de \
    /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